All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <blum@kernel.org>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Cc: Thorsten Blum <blum@kernel.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] x86/coco: Replace cc_attr_flags with a bool
Date: Wed,  2 Sep 2026 02:06:33 +0200	[thread overview]
Message-ID: <20260902000634.118808-2-blum@kernel.org> (raw)

The cc_attr_flags structure contains only the host_sev_snp bit. Replace
the structure with a bool.

No functional change.

Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 arch/x86/coco/core.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/x86/coco/core.c b/arch/x86/coco/core.c
index 418ec77bbe3a..8c1842a29f44 100644
--- a/arch/x86/coco/core.c
+++ b/arch/x86/coco/core.c
@@ -22,10 +22,7 @@ SYM_PIC_ALIAS(cc_vendor);
 u64 cc_mask __ro_after_init;
 SYM_PIC_ALIAS(cc_mask);
 
-static struct cc_attr_flags {
-	__u64 host_sev_snp	: 1,
-	      __resv		: 63;
-} cc_flags;
+static bool cc_host_sev_snp;
 
 static bool noinstr intel_cc_platform_has(enum cc_attr attr)
 {
@@ -103,7 +100,7 @@ static bool noinstr amd_cc_platform_has(enum cc_attr attr)
 		return sev_status & MSR_AMD64_SNP_SECURE_TSC;
 
 	case CC_ATTR_HOST_SEV_SNP:
-		return cc_flags.host_sev_snp;
+		return cc_host_sev_snp;
 
 	case CC_ATTR_SNP_SECURE_AVIC:
 		return sev_status & MSR_AMD64_SNP_SECURE_AVIC;
@@ -169,7 +166,7 @@ static void amd_cc_platform_clear(enum cc_attr attr)
 {
 	switch (attr) {
 	case CC_ATTR_HOST_SEV_SNP:
-		cc_flags.host_sev_snp = 0;
+		cc_host_sev_snp = false;
 		break;
 	default:
 		break;
@@ -191,7 +188,7 @@ static void amd_cc_platform_set(enum cc_attr attr)
 {
 	switch (attr) {
 	case CC_ATTR_HOST_SEV_SNP:
-		cc_flags.host_sev_snp = 1;
+		cc_host_sev_snp = true;
 		break;
 	default:
 		break;

             reply	other threads:[~2026-09-02  0:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02  0:06 Thorsten Blum [this message]
2026-09-02  0:57 ` [PATCH] x86/coco: Replace cc_attr_flags with a bool Borislav Petkov
2026-09-02  9:53   ` Thorsten Blum
2026-09-02 15:37     ` Borislav Petkov

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=20260902000634.118808-2-blum@kernel.org \
    --to=blum@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.