linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Huang, Kai" <kai.huang@intel.com>
To: "thomas.lendacky@amd.com" <thomas.lendacky@amd.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>
Cc: "Christopherson, Sean J" <sean.j.christopherson@intel.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v2] KVM: x86: use CPUID to locate host page table reserved bits
Date: Wed, 11 Dec 2019 23:16:41 +0000	[thread overview]
Message-ID: <86bb95b84a0006fbce49201d5c37f997714884ed.camel@intel.com> (raw)
In-Reply-To: <4faef0e9-72aa-9328-9110-fc67b2580f91@amd.com>

On Wed, 2019-12-11 at 14:48 -0600, Tom Lendacky wrote:
> On 12/11/19 3:07 AM, Paolo Bonzini wrote:
> > On 11/12/19 01:11, Huang, Kai wrote:
> > > > kvm_get_shadow_phys_bits() must be conservative in that:
> > > > 
> > > > 1) if a bit is reserved it _can_ return a value higher than its index
> > > > 
> > > > 2) if a bit is used by the processor (for physical address or anything
> > > > else) it _must_ return a value higher than its index.
> > > > 
> > > > In the SEV case we're not obeying (2), because the function returns 43
> > > > when the C bit is bit 47.  The patch fixes that.
> > > Could we guarantee that C-bit is always below bits reported by CPUID?
> > 
> > That's a question for AMD. :)  The C bit can move (and probably will,
> > otherwise they wouldn't have bothered adding it to CPUID) in future
> > generations of the processor.
> 
> Right, there's no way to guarantee that it is always below bits reported
> by CPUID. As Paolo stated, the position is reported by CPUID so that it
> can easily move and be accounted for programmatically.

Then I don't think this patch could fix the issue Paolo discribed?

Thanks,
-Kai


      reply	other threads:[~2019-12-11 23:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 15:40 [PATCH v2] KVM: x86: use CPUID to locate host page table reserved bits Paolo Bonzini
2019-12-04 15:48 ` Sean Christopherson
2019-12-10  9:19   ` Paolo Bonzini
2019-12-10 15:37     ` Sean Christopherson
2019-12-04 15:57 ` Tom Lendacky
2019-12-10  3:53   ` Huang, Kai
2019-12-10  9:18     ` Paolo Bonzini
2019-12-10  9:17   ` Paolo Bonzini
2019-12-11  0:11     ` Huang, Kai
2019-12-11  9:07       ` Paolo Bonzini
2019-12-11 20:48         ` Tom Lendacky
2019-12-11 23:16           ` Huang, Kai [this message]

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=86bb95b84a0006fbce49201d5c37f997714884ed.camel@intel.com \
    --to=kai.huang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=thomas.lendacky@amd.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;
as well as URLs for NNTP newsgroup(s).