From: "Huang, Kai" <kai.huang@intel.com>
To: "kirill.shutemov@linux.intel.com" <kirill.shutemov@linux.intel.com>
Cc: "Cui, Dexuan" <decui@microsoft.com>,
"bp@alien8.de" <bp@alien8.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"jpiotrowski@linux.microsoft.com"
<jpiotrowski@linux.microsoft.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"thomas.lendacky@amd.com" <thomas.lendacky@amd.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCHv2] x86/mm: Fix memory encryption features advertisement
Date: Tue, 16 Jan 2024 21:16:58 +0000 [thread overview]
Message-ID: <a95e410a9b5b9662c415774aa254d85324c0258d.camel@intel.com> (raw)
In-Reply-To: <20240116105844.cjnwpzuywukfv5rs@box.shutemov.name>
On Tue, 2024-01-16 at 13:58 +0300, kirill.shutemov@linux.intel.com wrote:
> On Tue, Jan 16, 2024 at 10:36:10AM +0000, Huang, Kai wrote:
> > On Thu, 2024-01-11 at 14:12 +0300, Kirill A. Shutemov wrote:
> > > When memory encryption is enabled, the kernel prints the encryption
> > > flavor that the system supports.
> > >
> > > The check assumes that everything is AMD SME/SEV if it doesn't have
> > > the TDX CPU feature set.
> > >
> > > Hyper-V vTOM sets cc_vendor to CC_VENDOR_INTEL when it runs as L2 guest
> > > on top of TDX, but not X86_FEATURE_TDX_GUEST. Hyper-V only needs memory
> > > encryption enabled for I/O without the rest of CoCo enabling.
> > >
> > > To avoid confusion, check the cc_vendor directly.
> > >
> > > Possible alternative is to completely removing the print statement.
> > > For a regular TDX guest, the kernel already prints a message indicating
> > > that it is booting on TDX. Similarly, AMD and Hyper-V can also display
> > > a message during their enumeration process.
> > >
> > > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> > > Cc: Dexuan Cui <decui@microsoft.com>
> > > Cc: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com>
> >
> > Seems this fix is for userspace running in hyperv environment being able to use
> > some easy grep to get which coco vendor it is running on?
>
> Making decision in userspace by grepping dmesg is bad idea and nobody
> should do this. It can easily give false result: dmesg is not ABI, format
> can change and ring buffer has finite size, the message can be overridden.
>
> If we need a way for userspace to discover which CoCo environment it runs
> on, we need proper ABI for that. Maybe sysfs file or something.
Yeah agreed. :-)
prev parent reply other threads:[~2024-01-16 21:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-11 11:12 [PATCHv2] x86/mm: Fix memory encryption features advertisement Kirill A. Shutemov
2024-01-11 14:19 ` Kuppuswamy Sathyanarayanan
2024-01-11 15:14 ` Jeremi Piotrowski
2024-01-11 20:46 ` Kuppuswamy Sathyanarayanan
2024-01-11 20:41 ` Tom Lendacky
2024-01-16 10:36 ` Huang, Kai
2024-01-16 10:58 ` kirill.shutemov
2024-01-16 21: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=a95e410a9b5b9662c415774aa254d85324c0258d.camel@intel.com \
--to=kai.huang@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=hpa@zytor.com \
--cc=jpiotrowski@linux.microsoft.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=x86@kernel.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).