linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <seanjc@google.com>,
	Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com,
	joro@8bytes.org, bgardon@google.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm: x86/mmu: Use cpuid to determine max gfn
Date: Fri, 4 Dec 2020 09:48:58 +0100	[thread overview]
Message-ID: <9f527b7b-96de-6657-aa48-8de401f5083e@redhat.com> (raw)
In-Reply-To: <X8mGSoB6KCiFsJdC@google.com>

On 04/12/20 01:43, Sean Christopherson wrote:
> On Thu, Dec 03, 2020, Rick Edgecombe wrote:
>> In the TDP MMU, use shadow_phys_bits to dermine the maximum possible GFN
>> mapped in the guest for zapping operations. boot_cpu_data.x86_phys_bits
>> may be reduced in the case of HW features that steal HPA bits for other
>> purposes. However, this doesn't necessarily reduce GPA space that can be
>> accessed via TDP. So zap based on a maximum gfn calculated with MAXPHYADDR
>> retrieved from CPUID. This is already stored in shadow_phys_bits, so use
>> it instead of x86_phys_bits.
>>
>> Fixes: faaf05b00aec ("kvm: x86/mmu: Support zapping SPTEs in the TDP MMU")
>> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
> 
> Dang, in hindsight it'd be nice if KVM_CAP_SMALLER_MAXPHYADDR allowed explicitly
> setting the max MAXPHYADDR for an entire VM instead of being a simple toggle.
> E.g. TDX and SEV-ES likely could also make use of "what's this VM's max GPA?".
> 
> Reviewed-by: Sean Christopherson <seanjc@google.com>
> 

Queued, thanks.

Paolo


      reply	other threads:[~2020-12-04  8:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 23:11 [PATCH] kvm: x86/mmu: Use cpuid to determine max gfn Rick Edgecombe
2020-12-04  0:43 ` Sean Christopherson
2020-12-04  8:48   ` Paolo Bonzini [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=9f527b7b-96de-6657-aa48-8de401f5083e@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bgardon@google.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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).