KVM: nVMX: add CR4_LA57 bit to nested CR4_FIXED1
PATCH 1/1 KVM: nVMX: add CR4_LA57 bit to nested CR4_FIXED1
When L1 guest uses 5-level paging, it fails vm-entry to L2 due to invalid host-state. It needs to add CR4_LA57 bit to nested CR4_FIXED1 MSR.
Signed-off-by Chenyi Qiang <[email protected]>
Reviewed-by Xiaoyao Li <[email protected]>
--- arch/x86/kvm/vmx/vmx.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/kvm/vmx/vmx.c +1 -0
@@ -6962,6 +6962,7 @@ static void nested_vmx_cr_fixed1_bits_update(struct kvm_vcpu *vcpu)cr4_fixed1_update (X86_CR4_SMAP , ebx,bit (X86_FEATURE_SMAP ));cr4_fixed1_update (X86_CR4_PKE , ecx,bit (X86_FEATURE_PKU ));cr4_fixed1_update (X86_CR4_UMIP , ecx,bit (X86_FEATURE_UMIP )); +cr4_fixed1_update (X86_CR4_LA57 , ecx,bit (X86_FEATURE_LA57 ));#undef cr4_fixed1_update }
Signature · 1 line
2.17.1
Quoted 10 lines · Chenyi Qiang
When L1 guest uses 5-level paging, it fails vm-entry to L2 due to invalid host-state. It needs to add
CR4_LA57bit to nestedCR4_FIXED1MSR.Signed-off-by Chenyi Qiang <[email protected]>Reviewed-by Xiaoyao Li <[email protected]>
Reviewed-by Liran Alon <[email protected]>
Quoted 19 lines
---
arch/x86/kvm/vmx/vmx.c| 1 +1 file changed, 1 insertion(+)arch/x86/kvm/vmx/vmx.c +1
-0@@ -6962,6 +6962,7 @@ static void nested_vmx_cr_fixed1_bits_update(struct kvm_vcpu *vcpu)cr4_fixed1_update (X86_CR4_SMAP , ebx,bit (X86_FEATURE_SMAP ));cr4_fixed1_update (X86_CR4_PKE , ecx,bit (X86_FEATURE_PKU ));cr4_fixed1_update (X86_CR4_UMIP , ecx,bit (X86_FEATURE_UMIP )); +cr4_fixed1_update (X86_CR4_LA57 , ecx,bit (X86_FEATURE_LA57 ));#undef cr4_fixed1_update }Signature · 1 line
2.17.1