Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rick Edgecombe <rick.p.edgecombe@intel.com>,
	Kai Huang <kai.huang@intel.com>, Yan Zhao <yan.y.zhao@intel.com>,
	Binbin Wu <binbin.wu@linux.intel.com>
Subject: Re: [PATCH v3 3/3] KVM: VMX: Drop TDX_SHARED_BIT_PWL_{4,5} and dedup related code
Date: Wed, 9 Sep 2026 22:18:39 +0800	[thread overview]
Message-ID: <b456aa1a-43b9-4755-a13f-91ac0f4cb82d@intel.com> (raw)
In-Reply-To: <20260902230932.2760127-4-seanjc@google.com>

On 9/3/2026 7:09 AM, Sean Christopherson wrote:
> Fold the GPA => GFN conversion and bitshift logic for identifying the S-bit
> given the EPT root level into tdx_set_mirror_root_level() to dedup the math
> and drop TDX_SHARED_BIT_PWL_{4,5} in the process.  In addition to deduping
> a small amount of code, using the level to compute the S-bit position more
> or less eliminates the risk of the mirror_root_level and gfn_direct_bits
> getting out of sync.
> 
> Opportunistically switch the sanity check in tdx_load_mmu_pgd() to check
> the mirror root level, not the S-Bit location, now that it's all but
> impossible for the two things to get out of sync.
> 
> For all intents and purposes, no functional change intended.
> 
> Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>

      reply	other threads:[~2026-09-09 14:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 23:09 [PATCH v3 0/3] KVM: VMX: Explicitly track TDX VMs' root level Sean Christopherson
2026-09-02 23:09 ` [PATCH v3 1/3] KVM: x86/mmu: Use KVM's max TDP level to determine need for 32-bit TDP root Sean Christopherson
2026-09-09 14:08   ` Xiaoyao Li
2026-09-02 23:09 ` [PATCH v3 2/3] KVM: VMX: Explicitly track TDX VMs' root level instead of guessing it from CPUID Sean Christopherson
2026-09-09 14:16   ` Xiaoyao Li
2026-09-02 23:09 ` [PATCH v3 3/3] KVM: VMX: Drop TDX_SHARED_BIT_PWL_{4,5} and dedup related code Sean Christopherson
2026-09-09 14:18   ` Xiaoyao Li [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=b456aa1a-43b9-4755-a13f-91ac0f4cb82d@intel.com \
    --to=xiaoyao.li@intel.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=kai.huang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=yan.y.zhao@intel.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