Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1507291
| From | Paolo Bonzini <pbonzini@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 5/5] x86, kvm: support vcpu preempted check |
| Date | 2016-10-24 17:20 +0200 |
| Message-ID | <svPcB-SB-11@gated-at.bofh.it> (permalink) |
| References | <stSxX-5F5-5@gated-at.bofh.it> <stSxX-5F5-9@gated-at.bofh.it> <su2QG-4lW-33@gated-at.bofh.it> <svOJz-qi-31@gated-at.bofh.it> <svPcB-SB-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 24/10/2016 17:14, Radim Krčmář wrote:
> 2016-10-24 16:39+0200, Paolo Bonzini:
>> 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.
>
> I agree. kvm_write_guest_cached() always writes from offset 0, so we'd
> want a new function that allows to specify a starting offset.
Yeah, let's leave it for a follow-up then!
Thanks,
Paolo
> Using cached vcpu->arch.st.steal to avoid the read wouldn't be as good.
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 5/5] x86, kvm: support vcpu preempted check Pan Xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-10-19 08:30 +0200
Re: [PATCH v4 5/5] x86, kvm: support vcpu preempted check Radim Krčmář <rkrcmar@redhat.com> - 2016-10-19 19:30 +0200
Re: [PATCH v4 5/5] x86, kvm: support vcpu preempted check Pan Xinhui <xinhui@linux.vnet.ibm.com> - 2016-10-19 20:50 +0200
Re: [PATCH v4 5/5] x86, kvm: support vcpu preempted check Paolo Bonzini <pbonzini@redhat.com> - 2016-10-24 16:50 +0200
Re: [PATCH v4 5/5] x86, kvm: support vcpu preempted check Radim Krčmář <rkrcmar@redhat.com> - 2016-10-24 17:20 +0200
Re: [PATCH v4 5/5] x86, kvm: support vcpu preempted check Paolo Bonzini <pbonzini@redhat.com> - 2016-10-24 17:20 +0200
Re: [PATCH v4 5/5] x86, kvm: support vcpu preempted check Pan Xinhui <xinhui@linux.vnet.ibm.com> - 2016-10-25 03:30 +0200
csiph-web