Skip to content

Commit 674b2c5

Browse files
committed
Use GUEST_LOCAL_APIC_ADDR constant when building guest MADT
1 parent 3978f2b commit 674b2c5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mythril/src/kmain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn build_vm(
6363
);
6464

6565
let mut madt = acpi::madt::MADTBuilder::<[_; 8]>::new();
66-
madt.set_ica(0xfee00000);
66+
madt.set_ica(vm::GUEST_LOCAL_APIC_ADDR.as_u64() as u32);
6767
madt.add_ics(acpi::madt::Ics::LocalApic {
6868
apic_id: 0,
6969
apic_uid: 0,

mythril/src/vm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ use spin::RwLock;
2525
static BIOS_BLOB: &'static [u8] = include_bytes!("blob/bios.bin");
2626

2727
//TODO(alschwalm): this should always be reported by the relevant MSR
28-
const GUEST_LOCAL_APIC_ADDR: GuestPhysAddr = GuestPhysAddr::new(0xfee00000);
28+
/// The location of the local apic in the guest address space
29+
pub const GUEST_LOCAL_APIC_ADDR: GuestPhysAddr = GuestPhysAddr::new(0xfee00000);
2930

3031
static VIRTUAL_MACHINES: RoAfterInit<VirtualMachines> =
3132
RoAfterInit::uninitialized();

0 commit comments

Comments
 (0)