* [PATCH] KVM: nVMX: Fix L2 fails to boot due to VM entry with invalid control field
@ 2017-02-15 11:10 Wanpeng Li
2017-02-15 11:33 ` David Hildenbrand
0 siblings, 1 reply; 3+ messages in thread
From: Wanpeng Li @ 2017-02-15 11:10 UTC (permalink / raw)
To: linux-kernel, kvm
Cc: Paolo Bonzini, Radim Krčmář, Jim Mattson, Wanpeng Li
From: Wanpeng Li <wanpeng.li@hotmail.com>
When I run kvm-unit-tests/vmx.flat in L1, The L2 fails to boot due to VM
entry with invalid control field.
KVM: entry failed, hardware error 0x7
EAX=00000000 EBX=00000000 ECX=00000000 EDX=000306c3
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
nested_get_vmcs12_pages() fails to set VIRTUAL_APIC_PAGE_ADDR field in
vmcs02 even if acquires a virtual apic page. This patch fixes it by
setting VIRTUAL_APIC_PAGE_ADDR field in vmcs02 once acquires a virtual
apic page.
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
arch/x86/kvm/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 204d6e6..650f3433 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -9685,7 +9685,7 @@ static void nested_get_vmcs12_pages(struct kvm_vcpu *vcpu,
* control. But such a configuration is useless, so
* let's keep the code simple.
*/
- if (!vmx->nested.virtual_apic_page) {
+ if (vmx->nested.virtual_apic_page) {
hpa = page_to_phys(vmx->nested.virtual_apic_page);
vmcs_write64(VIRTUAL_APIC_PAGE_ADDR, hpa);
}
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] KVM: nVMX: Fix L2 fails to boot due to VM entry with invalid control field
2017-02-15 11:10 [PATCH] KVM: nVMX: Fix L2 fails to boot due to VM entry with invalid control field Wanpeng Li
@ 2017-02-15 11:33 ` David Hildenbrand
2017-02-15 11:35 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: David Hildenbrand @ 2017-02-15 11:33 UTC (permalink / raw)
To: Wanpeng Li, linux-kernel, kvm
Cc: Paolo Bonzini, Radim Krčmář, Jim Mattson, Wanpeng Li
Am 15.02.2017 um 12:10 schrieb Wanpeng Li:
> From: Wanpeng Li <wanpeng.li@hotmail.com>
>
> When I run kvm-unit-tests/vmx.flat in L1, The L2 fails to boot due to VM
> entry with invalid control field.
>
> KVM: entry failed, hardware error 0x7
> EAX=00000000 EBX=00000000 ECX=00000000 EDX=000306c3
> 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
>
> nested_get_vmcs12_pages() fails to set VIRTUAL_APIC_PAGE_ADDR field in
> vmcs02 even if acquires a virtual apic page. This patch fixes it by
> setting VIRTUAL_APIC_PAGE_ADDR field in vmcs02 once acquires a virtual
> apic page.
>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
> arch/x86/kvm/vmx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 204d6e6..650f3433 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -9685,7 +9685,7 @@ static void nested_get_vmcs12_pages(struct kvm_vcpu *vcpu,
> * control. But such a configuration is useless, so
> * let's keep the code simple.
> */
> - if (!vmx->nested.virtual_apic_page) {
> + if (vmx->nested.virtual_apic_page) {
> hpa = page_to_phys(vmx->nested.virtual_apic_page);
> vmcs_write64(VIRTUAL_APIC_PAGE_ADDR, hpa);
> }
>
On which branch is this?
--
Thanks,
David
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] KVM: nVMX: Fix L2 fails to boot due to VM entry with invalid control field
2017-02-15 11:33 ` David Hildenbrand
@ 2017-02-15 11:35 ` Paolo Bonzini
0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2017-02-15 11:35 UTC (permalink / raw)
To: David Hildenbrand, Wanpeng Li, linux-kernel, kvm
Cc: Radim Krčmář, Jim Mattson, Wanpeng Li
On 15/02/2017 12:33, David Hildenbrand wrote:
> Am 15.02.2017 um 12:10 schrieb Wanpeng Li:
>> From: Wanpeng Li <wanpeng.li@hotmail.com>
>>
>> When I run kvm-unit-tests/vmx.flat in L1, The L2 fails to boot due to VM
>> entry with invalid control field.
>>
>> KVM: entry failed, hardware error 0x7
>> EAX=00000000 EBX=00000000 ECX=00000000 EDX=000306c3
>> 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
>>
>> nested_get_vmcs12_pages() fails to set VIRTUAL_APIC_PAGE_ADDR field in
>> vmcs02 even if acquires a virtual apic page. This patch fixes it by
>> setting VIRTUAL_APIC_PAGE_ADDR field in vmcs02 once acquires a virtual
>> apic page.
>>
>> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
>> ---
>> arch/x86/kvm/vmx.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>> index 204d6e6..650f3433 100644
>> --- a/arch/x86/kvm/vmx.c
>> +++ b/arch/x86/kvm/vmx.c
>> @@ -9685,7 +9685,7 @@ static void nested_get_vmcs12_pages(struct kvm_vcpu *vcpu,
>> * control. But such a configuration is useless, so
>> * let's keep the code simple.
>> */
>> - if (!vmx->nested.virtual_apic_page) {
>> + if (vmx->nested.virtual_apic_page) {
>> hpa = page_to_phys(vmx->nested.virtual_apic_page);
>> vmcs_write64(VIRTUAL_APIC_PAGE_ADDR, hpa);
>> }
>>
>
> On which branch is this?
It's kvm/queue, which has a WIP (and mostly untested) version of Jim's
nVMX checkpointing patches.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-15 11:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-15 11:10 [PATCH] KVM: nVMX: Fix L2 fails to boot due to VM entry with invalid control field Wanpeng Li
2017-02-15 11:33 ` David Hildenbrand
2017-02-15 11:35 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®