linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: nVMX: add CR4_LA57 bit to nested CR4_FIXED1
@ 2019-11-19  8:33 Chenyi Qiang
  2019-11-19 11:09 ` Liran Alon
  0 siblings, 1 reply; 3+ messages in thread
From: Chenyi Qiang @ 2019-11-19  8:33 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář,
	Sean Christopherson, Vitaly Kuznetsov, Jim Mattson, Joerg Roedel
  Cc: Xiaoyao Li, kvm, linux-kernel

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 <chenyi.qiang@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
 arch/x86/kvm/vmx/vmx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 621142e55e28..89253d60e23a 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -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
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: nVMX: add CR4_LA57 bit to nested CR4_FIXED1
  2019-11-19  8:33 [PATCH] KVM: nVMX: add CR4_LA57 bit to nested CR4_FIXED1 Chenyi Qiang
@ 2019-11-19 11:09 ` Liran Alon
  2019-11-19 15:34   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Liran Alon @ 2019-11-19 11:09 UTC (permalink / raw)
  To: Chenyi Qiang
  Cc: Paolo Bonzini, Radim Krčmář,
	Sean Christopherson, Vitaly Kuznetsov, Jim Mattson, Joerg Roedel,
	Xiaoyao Li, kvm, linux-kernel



> On 19 Nov 2019, at 10:33, Chenyi Qiang <chenyi.qiang@intel.com> wrote:
> 
> 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 <chenyi.qiang@intel.com>
> Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>

Reviewed-by: Liran Alon <liran.alon@oracle.com>

> ---
> arch/x86/kvm/vmx/vmx.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 621142e55e28..89253d60e23a 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -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
> }
> -- 
> 2.17.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: nVMX: add CR4_LA57 bit to nested CR4_FIXED1
  2019-11-19 11:09 ` Liran Alon
@ 2019-11-19 15:34   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2019-11-19 15:34 UTC (permalink / raw)
  To: Liran Alon, Chenyi Qiang
  Cc: Radim Krčmář,
	Sean Christopherson, Vitaly Kuznetsov, Jim Mattson, Joerg Roedel,
	Xiaoyao Li, kvm, linux-kernel

On 19/11/19 12:09, Liran Alon wrote:
> Reviewed-by: Liran Alon <liran.alon@oracle.com>

Queued, thanks.

Paolo


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-19 15:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19  8:33 [PATCH] KVM: nVMX: add CR4_LA57 bit to nested CR4_FIXED1 Chenyi Qiang
2019-11-19 11:09 ` Liran Alon
2019-11-19 15:34   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).