[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c00e636e-ea06-6bbb-6a67-39804ee8ba75@redhat.com>
Date: Mon, 24 Oct 2016 16:39:39 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Radim Krčmář <rkrcmar@...hat.com>,
Pan Xinhui <xinhui.pan@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
virtualization@...ts.linux-foundation.org,
linux-s390@...r.kernel.org, xen-devel-request@...ts.xenproject.org,
kvm@...r.kernel.org, benh@...nel.crashing.org, paulus@...ba.org,
mpe@...erman.id.au, mingo@...hat.com, peterz@...radead.org,
paulmck@...ux.vnet.ibm.com, will.deacon@....com,
kernellwp@...il.com, jgross@...e.com, bsingharora@...il.com,
boqun.feng@...il.com, borntraeger@...ibm.com
Subject: Re: [PATCH v4 5/5] x86, kvm: support vcpu preempted check
On 19/10/2016 19:24, Radim Krčmář wrote:
>> > + if (vcpu->arch.st.msr_val & KVM_MSR_ENABLED)
>> > + if (kvm_read_guest_cached(vcpu->kvm, &vcpu->arch.st.stime,
>> > + &vcpu->arch.st.steal,
>> > + sizeof(struct kvm_steal_time)) == 0) {
>> > + vcpu->arch.st.steal.preempted = 1;
>> > + kvm_write_guest_cached(vcpu->kvm, &vcpu->arch.st.stime,
>> > + &vcpu->arch.st.steal,
>> > + sizeof(struct kvm_steal_time));
>> > + }
> Please name this block of code. Something like
> kvm_steal_time_set_preempted(vcpu);
While at it:
1) the kvm_read_guest_cached is not necessary. You can rig the call to
kvm_write_guest_cached so that it only writes vcpu->arch.st.steal.preempted.
2) split the patch in host and guest sides.
Paolo
Powered by blists - more mailing lists