-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
efer: require the unconditional use of EFER.NXE
All processors that support virtualization also support NX. Therefore, there is no reason to detect NX via CPUID, and EFER.NXE can be enabled very early in boot, unconditionally, for simplicity in managing page tables. Signed-off-by: Jon Lange <[email protected]>
- Loading branch information
1 parent
5ad09f1
commit c47c34d
Showing
5 changed files
with
5 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,7 @@ | |
// | ||
// Author: Joerg Roedel <[email protected]> | ||
|
||
use super::features::cpu_has_nx; | ||
use super::msr::{read_msr, write_msr, EFER}; | ||
use crate::platform::SvsmPlatform; | ||
use bitflags::bitflags; | ||
|
||
bitflags! { | ||
|
@@ -34,15 +32,3 @@ pub fn write_efer(efer: EFERFlags) { | |
let val = efer.bits(); | ||
write_msr(EFER, val); | ||
} | ||
|
||
pub fn efer_init(platform: &dyn SvsmPlatform) { | ||
let mut efer = read_efer(); | ||
|
||
// All processors that are capable of virtualization will support | ||
// no-execute table entries, so there is no reason to support any processor | ||
// that does not enumerate NX capability. | ||
assert!(cpu_has_nx(platform), "CPU does not support NX"); | ||
|
||
efer.insert(EFERFlags::NXE); | ||
write_efer(efer); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters