[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 7 Jul 2016 13:21:21 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Wanpeng Li <kernellwp@...il.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Pan Xinhui <xinhui.pan@...ux.vnet.ibm.com>,
linux-s390 <linux-s390@...r.kernel.org>,
Davidlohr Bueso <dave@...olabs.net>, mpe@...erman.id.au,
boqun.feng@...il.com, will.deacon@....com,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Waiman Long <waiman.long@....com>,
virtualization@...ts.linux-foundation.org,
Ingo Molnar <mingo@...hat.com>,
Paul Mackerras <paulus@...ba.org>, benh@...nel.crashing.org,
schwidefsky@...ibm.com, Paul McKenney <paulmck@...ux.vnet.ibm.com>,
linuxppc-dev@...ts.ozlabs.org, kvm <kvm@...r.kernel.org>
Subject: Re: [PATCH v2 0/4] implement vcpu preempted check
On Thu, Jul 07, 2016 at 11:42:15AM +0200, Peter Zijlstra wrote:
> +static void update_steal_time_preempt(struct kvm_vcpu *vcpu)
> +{
> + struct kvm_steal_time *st;
> +
> + if (!(vcpu->arch.st.msr_val & KVM_MSR_ENABLED))
> + return;
> +
> + if (unlikely(kvm_read_guest_cached(vcpu->kvm, &vcpu->arch.st.stime,
> + &vcpu->arch.st.steal, sizeof(struct kvm_steal_time))))
> + return;
> +
> + st = &vcpu->arch.st.steal;
> +
> + st->pad[KVM_ST_PAD_PREEMPT] = 1; /* we've stopped running */
So maybe have this be:
... = kvm_vcpu_running();
That avoids marking the vcpu preempted when we do hlt and such.
> + kvm_write_guest_cached(vcpu->kvm, &vcpu->arch.st.stime,
> + st, sizeof(struct kvm_steal_time));
> +}
Powered by blists - more mailing lists