From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "seanjc@google.com" <seanjc@google.com>
Cc: "davidskidmore@google.com" <davidskidmore@google.com>,
"Li, Xiaoyao" <xiaoyao.li@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"srutherford@google.com" <srutherford@google.com>,
"pankaj.gupta@amd.com" <pankaj.gupta@amd.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"Yamahata, Isaku" <isaku.yamahata@intel.com>,
"Wang, Wei W" <wei.w.wang@intel.com>
Subject: Re: [ANNOUNCE] PUCK Notes - 2024.04.03 - TDX Upstreaming Strategy
Date: Mon, 8 Apr 2024 23:46:19 +0000 [thread overview]
Message-ID: <957b26d18ba7db611ed6582366066667267d10b8.camel@intel.com> (raw)
In-Reply-To: <ZhRxWxRLbnrqwQYw@google.com>
On Mon, 2024-04-08 at 15:36 -0700, Sean Christopherson wrote:
> > Currently the values for the directly settable CPUID leafs come via a TDX
> > specific init VM userspace API.
>
> Is guest.MAXPHYADDR one of those? If so, use that.
No it is not configurable. I'm looking into make it configurable, but it is not
likely to happen before we were hoping to get basic support upstream. An
alternative would be to have the KVM API peak at the value, and then discard it
(not pass the leaf value to the TDX module). Not ideal. Or have a dedicated GPAW
field and expose the concept to userspace like Xiaoyao was talking about.
>
> > So should we look at making the TDX side follow a
> > KVM_GET_SUPPORTED_CPUID/KVM_SET_CPUID pattern for feature enablement? Or am
> > I
> > misreading general guidance out of this specific suggestion around GPAW?
>
> No? Where I was going with that, is _if_ vCPUs can be created (in KVM) before
> the GPAW is set (in the TDX module), then using vCPU0's guest.MAXPHYADDR to
> compute the desired GPAW may be the least awful solution, all things
> considered.
Sorry, I was trying to uplevel the conversation to be about the general concept
of matching TD configuration to CPUID bits. Let me try to articulate the problem
a little better.
Today, KVM’s KVM_GET_SUPPORTED_CPUID is a way to specify which features are
virtualizable by KVM. Communicating this via CPUID leaf values works for the
most part, because CPUID is already designed to communicate which features are
supported. But TDX has a different language to communicate which features are
supported. That is special fields that are passed when creating a VM: XFAM
(matching XCR0 features) and ATTRIBUTES (TDX specific flags for MSR based
features like PKS, etc). So compared to KVM_GET_SUPPORTED_CPUID/KVM_SET_CPUID,
the TDX module instead accepts only a few CPUID bits to be set directly by the
VMM, and sets other CPUID leafs to match the configured features via XFAM and
ATTRIBUTES.
There are also some bits/features that have fixed values. Which leafs are fixed
and what the values are isn't something provided by any current TDX module API.
Instead they are only known via documentation, which is subject to change. The
queryable information is limited to communicating which bits are directly
configurable.
So the current interface won't allow us to perfectly match the
KVM_GET_SUPPORTED_CPUID/KVM_SET_CPUID. Even excluding the vm-scoped vs vcpu-
scoped differences. However, we could try to match the general design a little
better.
Here we were discussing making gpaw configurable via a dedicated named field,
but the suggestion is to instead include it in CPUID bits. The current API takes
ATTRIBUTES as a dedicated field too. But there actually are CPUID bits for some
of those features. Those CPUID bits are controlled instead via the associated
ATTRIBUTES. So we could expose such features via CPUID as well. Userspace would
for example, pass the PKS CPUID bit in, and KVM would see it and configure PKS
via the ATTRIBUTES bit.
So what I was looking to understand is, what is the enthusiasm for generally
continuing to use CPUID has the main method for specifying which features should
be enabled/virtualized, if we can't match the existing
KVM_GET_SUPPORTED_CPUID/KVM_SET_CPUID APIs. Is the hope just to make userspace's
code more unified between TDX and normal VMs?
next prev parent reply other threads:[~2024-04-08 23:46 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 16:58 Sean Christopherson
2024-04-07 3:15 ` Xiaoyao Li
2024-04-08 16:20 ` Sean Christopherson
2024-04-08 17:42 ` Edgecombe, Rick P
2024-04-08 18:51 ` Sean Christopherson
2024-04-08 21:56 ` Edgecombe, Rick P
2024-04-08 22:36 ` Sean Christopherson
2024-04-08 23:46 ` Edgecombe, Rick P [this message]
2024-04-09 1:37 ` Sean Christopherson
2024-04-09 14:46 ` Edgecombe, Rick P
2024-04-09 15:23 ` Sean Christopherson
2024-04-09 15:49 ` Edgecombe, Rick P
2024-04-09 16:13 ` Xiaoyao Li
2024-04-09 16:18 ` Xiaoyao Li
2024-04-10 1:05 ` Huang, Kai
2024-04-09 16:26 ` Sean Christopherson
2024-04-11 1:13 ` Edgecombe, Rick P
2024-04-11 14:22 ` Sean Christopherson
2024-04-11 15:16 ` Xiaoyao Li
2024-04-11 15:26 ` Sean Christopherson
2024-04-11 15:41 ` Xiaoyao Li
2024-04-11 18:52 ` Edgecombe, Rick P
2024-04-12 8:40 ` Xiaoyao Li
2024-04-12 17:39 ` Isaku Yamahata
2024-04-12 20:05 ` Edgecombe, Rick P
2024-04-15 21:04 ` Isaku Yamahata
2024-04-10 1:12 ` Isaku Yamahata
2024-04-10 14:03 ` Huang, Kai
2024-04-11 1:03 ` Isaku Yamahata
2024-04-11 3:46 ` Isaku Yamahata
2024-04-11 13:39 ` Huang, Kai
2024-04-09 2:57 ` Xiaoyao Li
2024-04-09 14:01 ` Sean Christopherson
2024-04-09 14:15 ` Xiaoyao Li
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=957b26d18ba7db611ed6582366066667267d10b8.camel@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=davidskidmore@google.com \
--cc=isaku.yamahata@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pankaj.gupta@amd.com \
--cc=seanjc@google.com \
--cc=srutherford@google.com \
--cc=wei.w.wang@intel.com \
--cc=xiaoyao.li@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
all inboxes | Powered by JetHome®