x86: clean up EFER definitions
Paolo Bonzini
maintainerPATCH 1/1 x86: clean up EFER definitions
The X86_EFER_LMA definition is wrong, while X86_IA32_EFER is unused. There are also two useless WRMSRs that try to set EFER_LMA in x86/pks.c and x86/pku.c. Clean them all up.
--- lib/x86/processor.h | 2 -- x86/pks.c | 1 - x86/pku.c | 1 - 3 files changed, 4 deletions(-)
lib/x86/processor.h +0 -2
@@ -72,8 +72,6 @@#define X86_EFLAGS_ALU (X86_EFLAGS_CF | X86_EFLAGS_PF | X86_EFLAGS_AF | \ X86_EFLAGS_ZF | X86_EFLAGS_SF | X86_EFLAGS_OF) -#define X86_IA32_EFER 0xc0000080 -#define X86_EFER_LMA (1UL << 8)/* * CPU features
x86/pks.c +0 -1
@@ -77,7 +77,6 @@ int main(int ac, char **av)setup_vm ();setup_alt_stack ();set_intr_alt_stack (14 , pf_tss); -wrmsr (MSR_EFER ,rdmsr (MSR_EFER ) |EFER_LMA );if (reserve_pages (SUPER_BASE ,SUPER_BASE >>12 ))report_abort ("Could not reserve memory" );
x86/pku.c +0 -1
@@ -76,7 +76,6 @@ int main(int ac, char **av)setup_vm ();setup_alt_stack ();set_intr_alt_stack (14 , pf_tss); -wrmsr (MSR_EFER ,rdmsr (MSR_EFER ) |EFER_LMA );if (reserve_pages (USER_BASE ,USER_BASE >>12 ))report_abort ("Could not reserve memory" );
Signature · 1 line
2.26.2
Quoted 3 lines · Paolo Bonzini
The
X86_EFER_LMAdefinition is wrong, whileX86_IA32_EFERis unused. There are also two useless WRMSRs that try to setEFER_LMAinx86/pks.candx86/pku.c. Clean them all up.
For posterity: EFER_LMA is incorrectly defined as EFER_LME, and both PKS and PKU tests are 64-bit only, so the WRMSRs are guaranteed to be nops.
Quoted 1 line
Signed-off-by Paolo Bonzini <[email protected]>
Paolo Bonzini
maintainerQuoted 7 lines · Sean Christopherson
Quoted 3 lines · Paolo Bonzini
The
X86_EFER_LMAdefinition is wrong, whileX86_IA32_EFERis unused. There are also two useless WRMSRs that try to setEFER_LMAinx86/pks.candx86/pku.c. Clean them all up.For posterity:
EFER_LMAis incorrectly defined asEFER_LME, and both PKS and PKU tests are 64-bit only, so the WRMSRs are guaranteed to be nops.
Added to the commit message and pushed, thanks.
Paolo
Quoted 4 lines
Quoted 1 line
Signed-off-by Paolo Bonzini <[email protected]>Reviewed-by Sean Christopherson <[email protected]>