Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1700898
| From | Paolo Bonzini <pbonzini@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] KVM: nVMX: INVPCID support |
| Date | 2017-08-01 13:40 +0200 |
| Message-ID | <u9DGO-3pR-11@gated-at.bofh.it> (permalink) |
| References | <u7R1x-6CD-25@gated-at.bofh.it> <u7VHP-15C-1@gated-at.bofh.it> <u9CUp-2Qq-5@gated-at.bofh.it> <u9Dnt-3jr-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 01/08/2017 13:18, David Hildenbrand wrote:
>
>>> Can't we rewrite that a little bit, avoiding that "best" handling
>>> (introducing guest_cpuid_disable_invpcid() and guest_cpuid_has_invpcid())
>>>
>>> bool invpcid_enabled = guest_cpuid_has_pcid(vcpu) &&
>>> guest_cpuid_has_invpcid();
>>>
>>> if (!invpcid_enabled) {
>>> secondary_exec_ctl &= ~SECONDARY_EXEC_ENABLE_INVPCID;
>>> /* make sure there is no no INVPCID without PCID */
>>> guest_cpuid_disable_invpcid(vcpu);
>>> }
>>
>> I don't know... if you need a comment, it means the different structure
>> of the code doesn't spare many doubts from the reader. And the code
>> doesn't become much simpler since you have to handle "nested" anyway.
>> What I tried to do was to mimic as much as possible the rdtscp case, but
>> it cannot be exactly the same due to the interaction between PCID and
>> INVPCID.
>
> It's more about the handling of best here, which can be avoided quite
> easily as I showed (by encapsulating how cpuids are looked up/modified).
Yeah, I don't like either option. :) Luckily there is a second maintainer!
Paolo
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] KVM: nVMX: INVPCID support Paolo Bonzini <pbonzini@redhat.com> - 2017-08-01 12:50 +0200
Re: [PATCH] KVM: nVMX: INVPCID support David Hildenbrand <david@redhat.com> - 2017-08-01 13:20 +0200
Re: [PATCH] KVM: nVMX: INVPCID support Paolo Bonzini <pbonzini@redhat.com> - 2017-08-01 13:40 +0200
Re: [PATCH] KVM: nVMX: INVPCID support Radim Krčmář <rkrcmar@redhat.com> - 2017-08-01 19:40 +0200
Re: [PATCH] KVM: nVMX: INVPCID support Paolo Bonzini <pbonzini@redhat.com> - 2017-08-02 09:40 +0200
Re: [PATCH] KVM: nVMX: INVPCID support David Hildenbrand <david@redhat.com> - 2017-08-02 11:00 +0200
csiph-web