diff options
author | Dylan Reid <dgreid@chromium.org> | 2018-03-28 20:20:35 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-03-29 17:02:43 -0700 |
commit | 45753529ba1b047822d9ef41df014a39d61ecf1a (patch) | |
tree | 92d14a274f122ee0201a62250122b7d7d34f650b /x86_64 | |
parent | 6ce158fb86b034c8a12bee4d65baba452ef42d6a (diff) | |
download | crosvm-45753529ba1b047822d9ef41df014a39d61ecf1a.tar crosvm-45753529ba1b047822d9ef41df014a39d61ecf1a.tar.gz crosvm-45753529ba1b047822d9ef41df014a39d61ecf1a.tar.bz2 crosvm-45753529ba1b047822d9ef41df014a39d61ecf1a.tar.lz crosvm-45753529ba1b047822d9ef41df014a39d61ecf1a.tar.xz crosvm-45753529ba1b047822d9ef41df014a39d61ecf1a.tar.zst crosvm-45753529ba1b047822d9ef41df014a39d61ecf1a.zip |
x86_64: Set EFER.LMA
We were setting LME (Long Mode Enabled) but not LMA (Long Mode Active). New kernels have a check in the kvm code that disallows this brokenness. Change-Id: Ic8950c8748ead81201223c19404fdd2c8d80f7dc Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/985733 Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'x86_64')
-rw-r--r-- | x86_64/src/regs.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/x86_64/src/regs.rs b/x86_64/src/regs.rs index aac058e..85d822a 100644 --- a/x86_64/src/regs.rs +++ b/x86_64/src/regs.rs @@ -209,6 +209,7 @@ const X86_CR0_PG: u64 = 0x80000000; const X86_CR4_PAE: u64 = 0x20; const EFER_LME: u64 = 0x100; +const EFER_LMA: u64 = 0x400; const BOOT_GDT_OFFSET: u64 = 0x500; const BOOT_IDT_OFFSET: u64 = 0x520; @@ -292,6 +293,7 @@ fn setup_page_tables(mem: &GuestMemory, sregs: &mut kvm_sregs) -> Result<()> { sregs.cr3 = boot_pml4_addr.offset() as u64; sregs.cr4 |= X86_CR4_PAE; sregs.cr0 |= X86_CR0_PG; + sregs.efer |= EFER_LMA; // Long mode is active. Must be auto-enabled with CR0_PG. Ok(()) } |