KVM: nVMX: do not leak PML full vmexit to L1
PATCH 1/1 KVM: nVMX: do not leak PML full vmexit to L1
The PML feature is not exposed to guests so we should not be forwarding the vmexit either.
This commit fixes BSOD 0x20001 (HYPERVISOR_ERROR) when running Hyper-V enabled Windows Server 2016 in L1 on hardware that supports PML.
--- arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kvm/vmx.c +3 -0
@@ -8198,6 +8198,9 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)return nested_cpu_has2 (vmcs12,SECONDARY_EXEC_XSAVES );case EXIT_REASON_PREEMPTION_TIMER :return false; +case EXIT_REASON_PML_FULL : +/* We don't expose PML support to L1. */ +return false;default :return true; }
Signature · 1 line
2.9.3
2017-03-31 10:19+0200, Ladi Prosek:
Quoted 9 lines
The PML feature is not exposed to guests so we should not be forwarding the vmexit either.
This commit fixes BSOD
0x20001(HYPERVISOR_ERROR) when running Hyper-V enabled Windows Server 2016 in L1 on hardware that supports PML.Fixes 843e4330573c ("KVM: VMX: Add PML support in VMX")Signed-off-by Ladi Prosek <[email protected]>---
Good catch,
Quoted 20 lines
arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kvm/vmx.c +3
-0@@ -8198,6 +8198,9 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)return nested_cpu_has2 (vmcs12,SECONDARY_EXEC_XSAVES );case EXIT_REASON_PREEMPTION_TIMER :return false; +case EXIT_REASON_PML_FULL : +/* We don't expose PML support to L1. */ +return false;default :return true; }Signature · 1 line
2.9.3
Quoted 18 lines · Ladi Prosek
The PML feature is not exposed to guests so we should not be forwarding the vmexit either.
This commit fixes BSOD
0x20001(HYPERVISOR_ERROR) when running Hyper-V enabled Windows Server 2016 in L1 on hardware that supports PML.Fixes 843e4330573c ("KVM: VMX: Add PML support in VMX")Signed-off-by Ladi Prosek <[email protected]>--- arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kvm/vmx.c +0
-0
arch/x86/kvm/vmx.c static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu) · line 8206
Quoted 9 lines
arch/x86/kvm/vmx.c +3
-0@@ -8198,6 +8198,9 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)return nested_cpu_has2 (vmcs12,SECONDARY_EXEC_XSAVES );case EXIT_REASON_PREEMPTION_TIMER :return false; +case EXIT_REASON_PML_FULL : +/* We don't expose PML support to L1. */ +return false;default :return true; }
Signature · 3 lines
Thanks, David
Quoted 2 lines · Ladi Prosek
The PML feature is not exposed to guests so we should not be forwarding the vmexit either.
I wonder if a whitelist of vmexits would make more sense, compared to defaulting to passing them through. But I don't know the history of this
Quoted 6 lines
This commit fixes BSOD
0x20001(HYPERVISOR_ERROR) when running Hyper-V enabled Windows Server 2016 in L1 on hardware that supports PML.Fixes 843e4330573c ("KVM: VMX: Add PML support in VMX")Signed-off-by Ladi Prosek <[email protected]>
Signature · 3 lines
Thanks, David
Paolo Bonzini
maintainerQuoted 5 lines · David Hildenbrand
Quoted 2 lines
The PML feature is not exposed to guests so we should not be forwarding the vmexit either.
I wonder if a whitelist of vmexits would make more sense, compared to defaulting to passing them through. But I don't know the history of this
I checked the other day and it's really 50-50 between "return true" and "return false" vmexits. Adding a WARNing would probably make even more sense. :)
Thanks,
Paolo
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · David Hildenbrand
Quoted 2 lines
The PML feature is not exposed to guests so we should not be forwarding the vmexit either.
Quoted 7 lines
Quoted 2 lines
I wonder if a whitelist of vmexits would make more sense, compared to defaulting to passing them through. But I don't know the history of this
I checked the other day and it's really 50-50 between "return true" and "return false" vmexits. Adding a WARNing would probably make even more sense. :)
Well, a whitelist will make sure that L1 really only sees what you want it to see. As an alternative, specify all of them explicitly (white+black list - should that currently already be done? haven't checked it), default to "false" and print a WARNing (unhandled exit code). But don't expose it to L1. (just what I have in mind).
Quoted 4 lines
Thanks,
Paolo
Signature · 3 lines
Thanks, David
Radim Krčmář
Applied2017-03-31 10:19+0200, Ladi Prosek:
Quoted 9 lines
The PML feature is not exposed to guests so we should not be forwarding the vmexit either.
This commit fixes BSOD
0x20001(HYPERVISOR_ERROR) when running Hyper-V enabled Windows Server 2016 in L1 on hardware that supports PML.Fixes 843e4330573c ("KVM: VMX: Add PML support in VMX")Signed-off-by Ladi Prosek <[email protected]>---
Applied to kvm/master, thanks.
Quoted 20 lines
arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kvm/vmx.c +3
-0@@ -8198,6 +8198,9 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)return nested_cpu_has2 (vmcs12,SECONDARY_EXEC_XSAVES );case EXIT_REASON_PREEMPTION_TIMER :return false; +case EXIT_REASON_PML_FULL : +/* We don't expose PML support to L1. */ +return false;default :return true; }Signature · 1 line
2.9.3
Paolo Bonzini
maintainerQuoted 18 lines · Ladi Prosek
The PML feature is not exposed to guests so we should not be forwarding the vmexit either.
This commit fixes BSOD
0x20001(HYPERVISOR_ERROR) when running Hyper-V enabled Windows Server 2016 in L1 on hardware that supports PML.Fixes 843e4330573c ("KVM: VMX: Add PML support in VMX")Signed-off-by Ladi Prosek <[email protected]>--- arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kvm/vmx.c +0
-0
arch/x86/kvm/vmx.c static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu) · line 8206
Quoted 9 lines
arch/x86/kvm/vmx.c +3
-0@@ -8198,6 +8198,9 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)return nested_cpu_has2 (vmcs12,SECONDARY_EXEC_XSAVES );case EXIT_REASON_PREEMPTION_TIMER :return false; +case EXIT_REASON_PML_FULL : +/* We don't expose PML support to L1. */ +return false;default :return true; }
This fell through the cracks, I'm queueing it now.
Paolo
2017-05-02 15:05+0200, Paolo Bonzini:
Quoted 22 lines · Ladi Prosek
Quoted 21 lines
The PML feature is not exposed to guests so we should not be forwarding the vmexit either.
This commit fixes BSOD
0x20001(HYPERVISOR_ERROR) when running Hyper-V enabled Windows Server 2016 in L1 on hardware that supports PML.Fixes 843e4330573c ("KVM: VMX: Add PML support in VMX")Signed-off-by Ladi Prosek <[email protected]>--- arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kvm/vmx.c +1
-0@@ -8198,6 +8198,9 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)return nested_cpu_has2 (vmcs12,SECONDARY_EXEC_XSAVES );case EXIT_REASON_PREEMPTION_TIMER :return false; +case EXIT_REASON_PML_FULL :
Quoted 8 lines
arch/x86/kvm/vmx.c static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu) · line 8206
Quoted 6 lines
arch/x86/kvm/vmx.c +2
-0+/* We don't expose PML support to L1. */ +return false;default :return true; }This fell through the cracks, I'm queueing it now.
It is in Linus' tree as ab007cc94ff9, we are just missing it in queue and next as they haven't merged yet.