linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: VMX: Fix vm entry failure caused by invalid vmexit controls
@ 2019-01-22 15:29 Changbin Du
  2019-01-22 17:00 ` Sean Christopherson
  0 siblings, 1 reply; 3+ messages in thread
From: Changbin Du @ 2019-01-22 15:29 UTC (permalink / raw)
  To: pbonzini; +Cc: rkrcmar, tglx, mingo, x86, kvm, linux-kernel, Changbin Du

The commit c73da3f ("KVM: VMX: Properly handle dynamic VM Entry/Exit
controls") has a typo that cause invalid vmexit controls. The
VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL is against _vmentry_control.

KVM: entry failed, hardware error 0x7
EAX=00000000 EBX=00000000 ECX=00000000 EDX=000206c2
ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000
EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0000 00000000 0000ffff 00009300
CS =f000 ffff0000 0000ffff 00009b00
SS =0000 00000000 0000ffff 00009300
DS =0000 00000000 0000ffff 00009300
FS =0000 00000000 0000ffff 00009300
GS =0000 00000000 0000ffff 00009300
LDT=0000 00000000 0000ffff 00008200
TR =0000 00000000 0000ffff 00008b00
GDT= 00000000 0000ffff
IDT= 00000000 0000ffff
CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000
DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000000

Fixes: c73da3f ("KVM: VMX: Properly handle dynamic VM Entry/Exit controls")
Signed-off-by: Changbin Du <changbin.du@gmail.com>
---
 arch/x86/kvm/vmx/vmx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index f6915f10e584..0762fcab8fc9 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2344,7 +2344,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
 		case 37: /* AAT100 */
 		case 44: /* BC86,AAY89,BD102 */
 		case 46: /* BA97 */
-			_vmexit_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
+			_vmentry_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
 			_vmexit_control &= ~VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL;
 			pr_warn_once("kvm: VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL "
 					"does not work properly. Using workaround\n");
-- 
2.19.1


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

* Re: [PATCH] KVM: VMX: Fix vm entry failure caused by invalid vmexit controls
  2019-01-22 15:29 [PATCH] KVM: VMX: Fix vm entry failure caused by invalid vmexit controls Changbin Du
@ 2019-01-22 17:00 ` Sean Christopherson
  2019-01-23  0:49   ` Changbin Du
  0 siblings, 1 reply; 3+ messages in thread
From: Sean Christopherson @ 2019-01-22 17:00 UTC (permalink / raw)
  To: Changbin Du; +Cc: pbonzini, rkrcmar, tglx, mingo, x86, kvm, linux-kernel

On Tue, Jan 22, 2019 at 11:29:52PM +0800, Changbin Du wrote:
> The commit c73da3f ("KVM: VMX: Properly handle dynamic VM Entry/Exit
> controls") has a typo that cause invalid vmexit controls. The
> VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL is against _vmentry_control.
> 
> KVM: entry failed, hardware error 0x7
> EAX=00000000 EBX=00000000 ECX=00000000 EDX=000206c2
> ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000
> EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
> ES =0000 00000000 0000ffff 00009300
> CS =f000 ffff0000 0000ffff 00009b00
> SS =0000 00000000 0000ffff 00009300
> DS =0000 00000000 0000ffff 00009300
> FS =0000 00000000 0000ffff 00009300
> GS =0000 00000000 0000ffff 00009300
> LDT=0000 00000000 0000ffff 00008200
> TR =0000 00000000 0000ffff 00008b00
> GDT= 00000000 0000ffff
> IDT= 00000000 0000ffff
> CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000
> DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000
> DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400
> EFER=0000000000000000
> 
> Fixes: c73da3f ("KVM: VMX: Properly handle dynamic VM Entry/Exit controls")
> Signed-off-by: Changbin Du <changbin.du@gmail.com>

Patch already submitted[1].

Paolo/Radim, the VM-Exit fix needs to be queued asap.  The fix for the
objtool warning[2] should also go into v5.0.

[1] https://patchwork.kernel.org/patch/10763351/
[2] https://patchwork.kernel.org/patch/10765309/



> ---
>  arch/x86/kvm/vmx/vmx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index f6915f10e584..0762fcab8fc9 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -2344,7 +2344,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
>  		case 37: /* AAT100 */
>  		case 44: /* BC86,AAY89,BD102 */
>  		case 46: /* BA97 */
> -			_vmexit_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
> +			_vmentry_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
>  			_vmexit_control &= ~VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL;
>  			pr_warn_once("kvm: VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL "
>  					"does not work properly. Using workaround\n");
> -- 
> 2.19.1
> 

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

* Re: [PATCH] KVM: VMX: Fix vm entry failure caused by invalid vmexit controls
  2019-01-22 17:00 ` Sean Christopherson
@ 2019-01-23  0:49   ` Changbin Du
  0 siblings, 0 replies; 3+ messages in thread
From: Changbin Du @ 2019-01-23  0:49 UTC (permalink / raw)
  To: Sean Christopherson
  Cc: Changbin Du, pbonzini, rkrcmar, tglx, mingo, x86, kvm, linux-kernel

On Tue, Jan 22, 2019 at 09:00:45AM -0800, Sean Christopherson wrote:
> On Tue, Jan 22, 2019 at 11:29:52PM +0800, Changbin Du wrote:
> > The commit c73da3f ("KVM: VMX: Properly handle dynamic VM Entry/Exit
> > controls") has a typo that cause invalid vmexit controls. The
> > VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL is against _vmentry_control.
> > 
> > KVM: entry failed, hardware error 0x7
> > EAX=00000000 EBX=00000000 ECX=00000000 EDX=000206c2
> > ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000
> > EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
> > ES =0000 00000000 0000ffff 00009300
> > CS =f000 ffff0000 0000ffff 00009b00
> > SS =0000 00000000 0000ffff 00009300
> > DS =0000 00000000 0000ffff 00009300
> > FS =0000 00000000 0000ffff 00009300
> > GS =0000 00000000 0000ffff 00009300
> > LDT=0000 00000000 0000ffff 00008200
> > TR =0000 00000000 0000ffff 00008b00
> > GDT= 00000000 0000ffff
> > IDT= 00000000 0000ffff
> > CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000
> > DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000
> > DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400
> > EFER=0000000000000000
> > 
> > Fixes: c73da3f ("KVM: VMX: Properly handle dynamic VM Entry/Exit controls")
> > Signed-off-by: Changbin Du <changbin.du@gmail.com>
> 
> Patch already submitted[1].
> 
> Paolo/Radim, the VM-Exit fix needs to be queued asap.  The fix for the
> objtool warning[2] should also go into v5.0.
> 
echo. This bug breaks kvm on some old machines!

> [1] https://patchwork.kernel.org/patch/10763351/
> [2] https://patchwork.kernel.org/patch/10765309/
> 
> 
> 
> > ---
> >  arch/x86/kvm/vmx/vmx.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> > index f6915f10e584..0762fcab8fc9 100644
> > --- a/arch/x86/kvm/vmx/vmx.c
> > +++ b/arch/x86/kvm/vmx/vmx.c
> > @@ -2344,7 +2344,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
> >  		case 37: /* AAT100 */
> >  		case 44: /* BC86,AAY89,BD102 */
> >  		case 46: /* BA97 */
> > -			_vmexit_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
> > +			_vmentry_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
> >  			_vmexit_control &= ~VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL;
> >  			pr_warn_once("kvm: VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL "
> >  					"does not work properly. Using workaround\n");
> > -- 
> > 2.19.1
> > 

-- 
Cheers,
Changbin Du

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

end of thread, other threads:[~2019-01-23  0:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 15:29 [PATCH] KVM: VMX: Fix vm entry failure caused by invalid vmexit controls Changbin Du
2019-01-22 17:00 ` Sean Christopherson
2019-01-23  0:49   ` Changbin Du

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).