* [PATCH v2] KVM: nVMX: Fix nested bus lock VM exit
@ 2021-09-14 9:50 Chenyi Qiang
2021-09-20 14:52 ` Sean Christopherson
2021-09-22 2:00 ` Xiaoyao Li
0 siblings, 2 replies; 4+ messages in thread
From: Chenyi Qiang @ 2021-09-14 9:50 UTC (permalink / raw)
To: Paolo Bonzini, Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li,
Jim Mattson, Joerg Roedel, Xiaoyao Li
Cc: Chenyi Qiang, kvm, linux-kernel
Nested bus lock VM exits are not supported yet. If L2 triggers bus lock
VM exit, it will be directed to L1 VMM, which would cause unexpected
behavior. Therefore, handle L2's bus lock VM exits in L0 directly.
Fixes: fe6b6bc802b4 ("KVM: VMX: Enable bus lock VM exit")
Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
---
Change log
v1->v2
- Because nested bus lock VM exit is not supported and how nested
support would operate is uncertain. Add a brief comment to state that this
feature is never exposed to L1 at present. (Sean)
- v1: https://lore.kernel.org/lkml/20210827085110.6763-1-chenyi.qiang@intel.com/
---
arch/x86/kvm/vmx/nested.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index bc6327950657..5646cc1e8d4c 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -5873,6 +5873,12 @@ static bool nested_vmx_l0_wants_exit(struct kvm_vcpu *vcpu,
case EXIT_REASON_VMFUNC:
/* VM functions are emulated through L2->L0 vmexits. */
return true;
+ case EXIT_REASON_BUS_LOCK:
+ /*
+ * At present, bus lock VM exit is never exposed to L1.
+ * Handle L2's bus locks in L0 directly.
+ */
+ return true;
default:
break;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] KVM: nVMX: Fix nested bus lock VM exit
2021-09-14 9:50 [PATCH v2] KVM: nVMX: Fix nested bus lock VM exit Chenyi Qiang
@ 2021-09-20 14:52 ` Sean Christopherson
2021-09-22 9:57 ` Paolo Bonzini
2021-09-22 2:00 ` Xiaoyao Li
1 sibling, 1 reply; 4+ messages in thread
From: Sean Christopherson @ 2021-09-20 14:52 UTC (permalink / raw)
To: Chenyi Qiang
Cc: Paolo Bonzini, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson,
Joerg Roedel, Xiaoyao Li, kvm, linux-kernel
On Tue, Sep 14, 2021, Chenyi Qiang wrote:
> Nested bus lock VM exits are not supported yet. If L2 triggers bus lock
> VM exit, it will be directed to L1 VMM, which would cause unexpected
> behavior. Therefore, handle L2's bus lock VM exits in L0 directly.
>
> Fixes: fe6b6bc802b4 ("KVM: VMX: Enable bus lock VM exit")
Cc: stable@vger.kernel.org
> Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
>
> ---
Reviewed-by: Sean Christopherson <seanjc@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] KVM: nVMX: Fix nested bus lock VM exit
2021-09-14 9:50 [PATCH v2] KVM: nVMX: Fix nested bus lock VM exit Chenyi Qiang
2021-09-20 14:52 ` Sean Christopherson
@ 2021-09-22 2:00 ` Xiaoyao Li
1 sibling, 0 replies; 4+ messages in thread
From: Xiaoyao Li @ 2021-09-22 2:00 UTC (permalink / raw)
To: Chenyi Qiang, Paolo Bonzini, Sean Christopherson,
Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel
Cc: kvm, linux-kernel
On 9/14/2021 5:50 PM, Chenyi Qiang wrote:
> Nested bus lock VM exits are not supported yet. If L2 triggers bus lock
> VM exit, it will be directed to L1 VMM, which would cause unexpected
> behavior. Therefore, handle L2's bus lock VM exits in L0 directly.
>
> Fixes: fe6b6bc802b4 ("KVM: VMX: Enable bus lock VM exit")
> Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
> ---
> Change log
> v1->v2
> - Because nested bus lock VM exit is not supported and how nested
> support would operate is uncertain. Add a brief comment to state that this
> feature is never exposed to L1 at present. (Sean)
> - v1: https://lore.kernel.org/lkml/20210827085110.6763-1-chenyi.qiang@intel.com/
> ---
> arch/x86/kvm/vmx/nested.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index bc6327950657..5646cc1e8d4c 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -5873,6 +5873,12 @@ static bool nested_vmx_l0_wants_exit(struct kvm_vcpu *vcpu,
> case EXIT_REASON_VMFUNC:
> /* VM functions are emulated through L2->L0 vmexits. */
> return true;
> + case EXIT_REASON_BUS_LOCK:
> + /*
> + * At present, bus lock VM exit is never exposed to L1.
> + * Handle L2's bus locks in L0 directly.
> + */
> + return true;
> default:
> break;
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] KVM: nVMX: Fix nested bus lock VM exit
2021-09-20 14:52 ` Sean Christopherson
@ 2021-09-22 9:57 ` Paolo Bonzini
0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2021-09-22 9:57 UTC (permalink / raw)
To: Sean Christopherson, Chenyi Qiang
Cc: Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel,
Xiaoyao Li, kvm, linux-kernel
On 20/09/21 16:52, Sean Christopherson wrote:
> On Tue, Sep 14, 2021, Chenyi Qiang wrote:
>> Nested bus lock VM exits are not supported yet. If L2 triggers bus lock
>> VM exit, it will be directed to L1 VMM, which would cause unexpected
>> behavior. Therefore, handle L2's bus lock VM exits in L0 directly.
>>
>> Fixes: fe6b6bc802b4 ("KVM: VMX: Enable bus lock VM exit")
>
> Cc: stable@vger.kernel.org
>
>> Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
>>
>> ---
>
> Reviewed-by: Sean Christopherson <seanjc@google.com>
>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-09-22 9:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 9:50 [PATCH v2] KVM: nVMX: Fix nested bus lock VM exit Chenyi Qiang
2021-09-20 14:52 ` Sean Christopherson
2021-09-22 9:57 ` Paolo Bonzini
2021-09-22 2:00 ` Xiaoyao Li
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.