Re: [patch 2/5] x86/kvm: Handle task_work on VMENTER/EXIT

2019-08-02 Thread Andy Lutomirski
> On Aug 2, 2019, at 3:22 PM, Thomas Gleixner wrote: > >> On Fri, 2 Aug 2019, Paolo Bonzini wrote: >>> On 01/08/19 23:47, Thomas Gleixner wrote: >>> Right you are about cond_resched() being called, but for SRCU this does not >>> matter unless there is some way to do a synchronize operation on

Re: [patch 2/5] x86/kvm: Handle task_work on VMENTER/EXIT

2019-08-02 Thread Thomas Gleixner
On Fri, 2 Aug 2019, Paolo Bonzini wrote: > On 01/08/19 23:47, Thomas Gleixner wrote: > > Right you are about cond_resched() being called, but for SRCU this does not > > matter unless there is some way to do a synchronize operation on that SRCU > > entity. It might have some other performance side

Re: [patch 2/5] x86/kvm: Handle task_work on VMENTER/EXIT

2019-08-02 Thread Paolo Bonzini
On 01/08/19 23:47, Thomas Gleixner wrote: > Right you are about cond_resched() being called, but for SRCU this does not > matter unless there is some way to do a synchronize operation on that SRCU > entity. It might have some other performance side effect though. I would use srcu_read_unlock/lock

Re: [patch 2/5] x86/kvm: Handle task_work on VMENTER/EXIT

2019-08-02 Thread Oleg Nesterov
On 08/01, Thomas Gleixner wrote: > > On Thu, 1 Aug 2019, Oleg Nesterov wrote: > > On 08/01, Thomas Gleixner wrote: > > > > > > @@ -8172,6 +8174,10 @@ static int vcpu_run(struct kvm_vcpu *vcp > > > ++vcpu->stat.signal_exits; > > > break; > > > } > > > +

Re: [patch 2/5] x86/kvm: Handle task_work on VMENTER/EXIT

2019-08-01 Thread Thomas Gleixner
On Thu, 1 Aug 2019, Thomas Gleixner wrote: > On Thu, 1 Aug 2019, Sean Christopherson wrote: > > On Thu, Aug 01, 2019 at 08:34:53PM +0200, Thomas Gleixner wrote: > > > On Thu, 1 Aug 2019, Oleg Nesterov wrote: > > > > On 08/01, Thomas Gleixner wrote: > > > > > > > > > > @@ -8172,6 +8174,10 @@

Re: [patch 2/5] x86/kvm: Handle task_work on VMENTER/EXIT

2019-08-01 Thread Thomas Gleixner
On Thu, 1 Aug 2019, Sean Christopherson wrote: > On Thu, Aug 01, 2019 at 08:34:53PM +0200, Thomas Gleixner wrote: > > On Thu, 1 Aug 2019, Oleg Nesterov wrote: > > > On 08/01, Thomas Gleixner wrote: > > > > > > > > @@ -8172,6 +8174,10 @@ static int vcpu_run(struct kvm_vcpu *vcp > > > >

Re: [patch 2/5] x86/kvm: Handle task_work on VMENTER/EXIT

2019-08-01 Thread Peter Zijlstra
On Thu, Aug 01, 2019 at 02:35:50PM -0700, Sean Christopherson wrote: > On Thu, Aug 01, 2019 at 08:34:53PM +0200, Thomas Gleixner wrote: > > On Thu, 1 Aug 2019, Oleg Nesterov wrote: > > > On 08/01, Thomas Gleixner wrote: > > > > > > > > @@ -8172,6 +8174,10 @@ static int vcpu_run(struct kvm_vcpu

Re: [patch 2/5] x86/kvm: Handle task_work on VMENTER/EXIT

2019-08-01 Thread Sean Christopherson
On Thu, Aug 01, 2019 at 08:34:53PM +0200, Thomas Gleixner wrote: > On Thu, 1 Aug 2019, Oleg Nesterov wrote: > > On 08/01, Thomas Gleixner wrote: > > > > > > @@ -8172,6 +8174,10 @@ static int vcpu_run(struct kvm_vcpu *vcp > > > ++vcpu->stat.signal_exits; > > >

Re: [patch 2/5] x86/kvm: Handle task_work on VMENTER/EXIT

2019-08-01 Thread Thomas Gleixner
On Thu, 1 Aug 2019, Oleg Nesterov wrote: > On 08/01, Thomas Gleixner wrote: > > > > @@ -8172,6 +8174,10 @@ static int vcpu_run(struct kvm_vcpu *vcp > > ++vcpu->stat.signal_exits; > > break; > > } > > + > > + if (notify_resume_pending())

Re: [patch 2/5] x86/kvm: Handle task_work on VMENTER/EXIT

2019-08-01 Thread Oleg Nesterov
On 08/01, Thomas Gleixner wrote: > > @@ -8172,6 +8174,10 @@ static int vcpu_run(struct kvm_vcpu *vcp > ++vcpu->stat.signal_exits; > break; > } > + > + if (notify_resume_pending()) > +

[patch 2/5] x86/kvm: Handle task_work on VMENTER/EXIT

2019-08-01 Thread Thomas Gleixner
TIF_NOTITY_RESUME is evaluated on return to user space along with other TIF flags. >From the kernels point of view a VMENTER is more or less equivalent to return to user space which means that at least a subset of TIF flags needs to be evaluated and handled. Currently KVM handles only