From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "seanjc@google.com" <seanjc@google.com>
Cc: "dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"binbin.wu@linux.intel.com" <binbin.wu@linux.intel.com>,
"kas@kernel.org" <kas@kernel.org>,
"Li, Xiaoyao" <xiaoyao.li@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Zhao, Yan Y" <yan.y.zhao@intel.com>,
"Huang, Kai" <kai.huang@intel.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH] KVM: VMX: Explicitly track TDX VMs' root level instead of guessing it from CPUID
Date: Wed, 19 Aug 2026 14:35:44 +0000 [thread overview]
Message-ID: <bd8f77eb6605f771fafbcef55a47211ecbb70e19.camel@intel.com> (raw)
In-Reply-To: <aoT_6cnARCAYTrYG@google.com>
On Tue, 2026-08-18 at 17:59 -0700, Sean Christopherson wrote:
> > Wait, no, this knowledge embeds in kvm_mmu_set_mirror_root_level() anyway.
> > So I'd think to just have the below.
>
> I started with that, but I didn't like bleeding that level of detail into the
> MMU. Or rather, I didn't like baking in the assumption that there is exactly
> one "direct bits", that the one bit is a pivot between normal and mirror root,
> and that the pivot bit is the most significant bit of the effective GPA space.
>
> On the other hand, the MMU already knows about mirror roots, and needs to know
> that mirror roots can have predetermined levels, so explicitly storing that
> level doesn't add new assumptions.
Yea.
And with the log as is, the exact reasoning to add a mirror_root_level is not
clear. To me at least. So if we want to keep it, some extra justification would
help. But for a bug fix, I'd think to keep it simple and then do
mirror_root_level as a separate change.
>
> > If comparing gfn_direct_bits to gfn_direct_bits doesn't make sense, then
> > let's just drop the KVM_BUG_ON().
>
> Why? Defense in depth is often useful.
It's fair. And especially TDX code is tucked away enough away that leaning
towards more checks is probably good.
next prev parent reply other threads:[~2026-08-19 14:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 22:45 [PATCH] KVM: VMX: Explicitly track TDX VMs' root level instead of guessing it from CPUID Sean Christopherson
2026-08-19 0:53 ` Edgecombe, Rick P
2026-08-19 0:59 ` Sean Christopherson
2026-08-19 14:35 ` Edgecombe, Rick P [this message]
2026-08-19 15:56 ` Sean Christopherson
2026-08-19 17:35 ` Edgecombe, Rick P
2026-08-19 18:45 ` Sean Christopherson
2026-08-19 18:56 ` Edgecombe, Rick P
2026-08-19 19:41 ` Sean Christopherson
2026-08-19 22:36 ` Edgecombe, Rick P
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=bd8f77eb6605f771fafbcef55a47211ecbb70e19.camel@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=binbin.wu@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=kai.huang@intel.com \
--cc=kas@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=x86@kernel.org \
--cc=xiaoyao.li@intel.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