From: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com>
To: Borislav Petkov <bp@alien8.de>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, linux-coco@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/coco, x86/sev: Use cpu_feature_enabled() to detect SEV guest flavor
Date: Tue, 5 Dec 2023 18:27:50 +0100 [thread overview]
Message-ID: <ae9e37c2-3f50-4098-9b0e-771d10262c6b@linux.microsoft.com> (raw)
In-Reply-To: <20231205160035.GEZW9JI8eKENXBo6EO@fat_crate.local>
On 05/12/2023 17:00, Borislav Petkov wrote:
> On Tue, Dec 05, 2023 at 06:14:37PM +0300, Kirill A. Shutemov wrote:
>> My point is that if you need to check for SEV you need to check SEV, not
>> CC_ATTR. CC_ATTRs only make sense in generic code that deals with multiple
>> CoCo environments.
>
> That makes more sense.
So given this series, what is the canonical way to expose sub-features of
TDX/SNP going forward? X86_FEATURE_xxx for every one that needs to be queried
in TDX/SNP specific code?
I see that in [1] X86_FEATURE_SNP_SECURE_TSC is being proposed. How about the
CC_ATTR_TDX_MODULE_CALLS (perhaps better called TDX_TDCALL or something) that
I'm proposing in the other thread [2]? VTOM? SVSM?
We can also export amd_cc_platform_has() and intel_cc_platform_has() for such cases.
But we really need is to agree which to use when (X86_FEATURE vs CC_ATTR).
[1]: https://lore.kernel.org/lkml/20231128125959.1810039-10-nikunj@amd.com/
[2]: https://lore.kernel.org/lkml/20231122170106.270266-2-jpiotrowski@linux.microsoft.com/
Jeremi
>
> So that commit already says "If future support is added for other
> memory encryption technologies, the use of CC_ATTR_GUEST_MEM_ENCRYPT
> can be updated, as required."
>
> And what this test needs to do is to check:
>
> if (guest type >= SEV)
>
> meaning SEV and -ES and -SNP.
>
> I'm wondering if we should export amd_cc_platform_has() for such
> cases...
>
> The logic being, we're calling a SEV-specific function so using
> cc_platform_has() in there is the wrong layer.
>
> Tom?
>
next prev parent reply other threads:[~2023-12-05 17:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-05 14:37 [PATCH] x86/coco, x86/sev: Use cpu_feature_enabled() to detect SEV guest flavor Kirill A. Shutemov
2023-12-05 14:46 ` Borislav Petkov
2023-12-05 15:00 ` Kirill A. Shutemov
2023-12-05 15:06 ` Borislav Petkov
2023-12-05 15:14 ` Kirill A. Shutemov
2023-12-05 16:00 ` Borislav Petkov
2023-12-05 17:16 ` Kirill A. Shutemov
2023-12-05 17:24 ` Borislav Petkov
2023-12-05 18:08 ` Kirill A. Shutemov
2023-12-05 18:52 ` Borislav Petkov
2023-12-05 20:33 ` Borislav Petkov
2024-01-02 12:22 ` Kirill A. Shutemov
2024-01-02 12:30 ` Borislav Petkov
2023-12-05 17:27 ` Jeremi Piotrowski [this message]
2023-12-05 17:12 ` kernel test robot
2023-12-05 19:24 ` kernel test robot
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=ae9e37c2-3f50-4098-9b0e-771d10262c6b@linux.microsoft.com \
--to=jpiotrowski@linux.microsoft.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.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 NNTP newsgroup(s).