Re: [RFC 2/2] KVM: VMX: Enable bus lock VM exit

2020-07-28 Thread Sean Christopherson
On Mon, Jul 27, 2020 at 12:38:53PM +0800, Xiaoyao Li wrote: > On 7/23/2020 9:21 AM, Sean Christopherson wrote: > >On Wed, Jul 01, 2020 at 04:49:49PM +0200, Vitaly Kuznetsov wrote: > >>Xiaoyao Li writes: > >>>So you want an exit to userspace for every bus lock and leave it all to > >>>userspace.

Re: [RFC 2/2] KVM: VMX: Enable bus lock VM exit

2020-07-26 Thread Xiaoyao Li
On 7/23/2020 9:21 AM, Sean Christopherson wrote: On Wed, Jul 01, 2020 at 04:49:49PM +0200, Vitaly Kuznetsov wrote: Xiaoyao Li writes: So you want an exit to userspace for every bus lock and leave it all to userspace. Yes, it's doable. In some cases we may not even want to have a VM exit:

Re: [RFC 2/2] KVM: VMX: Enable bus lock VM exit

2020-07-22 Thread Sean Christopherson
On Wed, Jul 01, 2020 at 04:49:49PM +0200, Vitaly Kuznetsov wrote: > Xiaoyao Li writes: > > So you want an exit to userspace for every bus lock and leave it all to > > userspace. Yes, it's doable. > > In some cases we may not even want to have a VM exit: think > e.g. real-time/partitioning case

Re: [RFC 2/2] KVM: VMX: Enable bus lock VM exit

2020-07-02 Thread Xiaoyao Li
On 7/1/2020 10:49 PM, Vitaly Kuznetsov wrote: Xiaoyao Li writes: On 7/1/2020 8:44 PM, Vitaly Kuznetsov wrote: Xiaoyao Li writes: On 7/1/2020 5:04 PM, Vitaly Kuznetsov wrote: Chenyi Qiang writes: [...] static const int kvm_vmx_max_exit_handlers = @@ -6830,6 +6838,13 @@ static

Re: [RFC 2/2] KVM: VMX: Enable bus lock VM exit

2020-07-01 Thread Vitaly Kuznetsov
Xiaoyao Li writes: > On 7/1/2020 8:44 PM, Vitaly Kuznetsov wrote: >> Xiaoyao Li writes: >> >>> On 7/1/2020 5:04 PM, Vitaly Kuznetsov wrote: Chenyi Qiang writes: >>> [...] >static const int kvm_vmx_max_exit_handlers = > @@ -6830,6 +6838,13 @@ static fastpath_t

Re: [RFC 2/2] KVM: VMX: Enable bus lock VM exit

2020-07-01 Thread Xiaoyao Li
On 7/1/2020 8:44 PM, Vitaly Kuznetsov wrote: Xiaoyao Li writes: On 7/1/2020 5:04 PM, Vitaly Kuznetsov wrote: Chenyi Qiang writes: [...] static const int kvm_vmx_max_exit_handlers = @@ -6830,6 +6838,13 @@ static fastpath_t vmx_vcpu_run(struct kvm_vcpu *vcpu) if

Re: [RFC 2/2] KVM: VMX: Enable bus lock VM exit

2020-07-01 Thread Vitaly Kuznetsov
Xiaoyao Li writes: > On 7/1/2020 5:04 PM, Vitaly Kuznetsov wrote: >> Chenyi Qiang writes: > [...] >>> static const int kvm_vmx_max_exit_handlers = >>> @@ -6830,6 +6838,13 @@ static fastpath_t vmx_vcpu_run(struct kvm_vcpu *vcpu) >>> if (unlikely(vmx->exit_reason.failed_vmentry)) >>>

Re: [RFC 2/2] KVM: VMX: Enable bus lock VM exit

2020-07-01 Thread Xiaoyao Li
On 7/1/2020 5:04 PM, Vitaly Kuznetsov wrote: Chenyi Qiang writes: [...] static const int kvm_vmx_max_exit_handlers = @@ -6830,6 +6838,13 @@ static fastpath_t vmx_vcpu_run(struct kvm_vcpu *vcpu) if (unlikely(vmx->exit_reason.failed_vmentry)) return EXIT_FASTPATH_NONE;

Re: [RFC 2/2] KVM: VMX: Enable bus lock VM exit

2020-07-01 Thread Vitaly Kuznetsov
Chenyi Qiang writes: > Virtual Machine can exploit bus locks to degrade the performance of > system. Bus lock can be caused by split locked access to writeback(WB) > memory or by using locks on uncacheable(UC) memory. The bus lock is > typically >1000 cycles slower than an atomic operation

[RFC 2/2] KVM: VMX: Enable bus lock VM exit

2020-06-28 Thread Chenyi Qiang
Virtual Machine can exploit bus locks to degrade the performance of system. Bus lock can be caused by split locked access to writeback(WB) memory or by using locks on uncacheable(UC) memory. The bus lock is typically >1000 cycles slower than an atomic operation within a cache line. It also