mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/coco: Replace cc_attr_flags with a bool
@ 2026-09-02  0:06 Thorsten Blum
  2026-09-02  0:57 ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Blum @ 2026-09-02  0:06 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin
  Cc: Thorsten Blum, linux-kernel

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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86/coco: Replace cc_attr_flags with a bool
  2026-09-02  0:06 [PATCH] x86/coco: Replace cc_attr_flags with a bool Thorsten Blum
@ 2026-09-02  0:57 ` Borislav Petkov
  2026-09-02  9:53   ` Thorsten Blum
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2026-09-02  0:57 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, x86, H. Peter Anvin,
	linux-kernel

On Wed, Sep 02, 2026 at 02:06:33AM +0200, Thorsten Blum wrote:
> The cc_attr_flags structure contains only the host_sev_snp bit. Replace
> the structure with a bool.

Nope, do some git archeology before you send patches.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86/coco: Replace cc_attr_flags with a bool
  2026-09-02  0:57 ` Borislav Petkov
@ 2026-09-02  9:53   ` Thorsten Blum
  2026-09-02 15:37     ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Blum @ 2026-09-02  9:53 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, x86, H. Peter Anvin,
	linux-kernel

On Tue, Sep 01, 2026 at 05:57:03PM -0700, Borislav Petkov wrote:
> On Wed, Sep 02, 2026 at 02:06:33AM +0200, Thorsten Blum wrote:
> > The cc_attr_flags structure contains only the host_sev_snp bit. Replace
> > the structure with a bool.
> 
> Nope, do some git archeology before you send patches.

I did check before sending. My motivation for the cleanup was that in
the ~2.5 years since bc6f707fc0fe ("x86/cc: Add cc_platform_set/_clear()
helpers"), host_sev_snp has remained the only member of cc_flags.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86/coco: Replace cc_attr_flags with a bool
  2026-09-02  9:53   ` Thorsten Blum
@ 2026-09-02 15:37     ` Borislav Petkov
  0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2026-09-02 15:37 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, x86, H. Peter Anvin,
	linux-kernel

On Wed, Sep 02, 2026 at 11:53:59AM +0200, Thorsten Blum wrote:
> I did check before sending. My motivation for the cleanup was that in
> the ~2.5 years since bc6f707fc0fe ("x86/cc: Add cc_platform_set/_clear()
> helpers"), host_sev_snp has remained the only member of cc_flags.

And?

That is bothering you so much so that you would send a patch for it?

If you really wanna help, you'd be immensely more helpful if you tested
kernels and did some code review to help out maintainers. Because we're
drowning in patches but not drowning in reviewers...

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-02 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-02  0:06 [PATCH] x86/coco: Replace cc_attr_flags with a bool Thorsten Blum
2026-09-02  0:57 ` Borislav Petkov
2026-09-02  9:53   ` Thorsten Blum
2026-09-02 15:37     ` Borislav Petkov

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®