mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: nVMX: INVPCID support
Date: Tue, 1 Aug 2017 13:18:41 +0200	[thread overview]
Message-ID: <60a8347a-744d-47d3-e53b-3218f5c50623@redhat.com> (raw)
In-Reply-To: <42be1e05-b6e4-42db-5ed8-276d61c4334d@redhat.com>


>> 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).

But you are the maintainer, so feel free to stick to what you have. :)

> 
> Paolo
> 


-- 

Thanks,

David

  reply	other threads:[~2017-08-01 11:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27 13:20 Paolo Bonzini
2017-07-27 18:29 ` David Hildenbrand
2017-07-27 19:04   ` Paolo Bonzini
2017-08-01 10:48   ` Paolo Bonzini
2017-08-01 11:18     ` David Hildenbrand [this message]
2017-08-01 11:35       ` Paolo Bonzini
2017-08-01 17:37         ` Radim Krčmář
2017-08-02  7:38           ` Paolo Bonzini
2017-08-02  8:50             ` David Hildenbrand
  -- strict thread matches above, loose matches on Subject: below --
2017-07-27 12:42 Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60a8347a-744d-47d3-e53b-3218f5c50623@redhat.com \
    --to=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®