x86/coco: Replace cc_attr_flags with a bool
PATCH 1/1 x86/coco: Replace cc_attr_flags with a bool
The cc_attr_flags structure contains only the host_sev_snp bit. Replace the structure with a bool.
No functional change.
--- arch/x86/coco/core.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
arch/x86/coco/core.c +4 -7
@@ -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 ;
Borislav Petkov
maintainerQuoted 2 lines · Thorsten Blum
The
cc_attr_flagsstructure contains only thehost_sev_snpbit. Replace the structure with a bool.
Nope, do some git archeology before you send patches.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteQuoted 5 lines · Borislav Petkov
Quoted 2 lines · Thorsten Blum
The
cc_attr_flagsstructure contains only thehost_sev_snpbit. 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.
Borislav Petkov
maintainerQuoted 3 lines · Thorsten Blum
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_snphas remained the only member ofcc_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.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette