lkml.org 
[lkml]   [2024]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH, RESEND] x86/sev: Fix SEV check in sev_map_percpu_data()
On Thu, Feb 01, 2024 at 12:38:09PM -0700, Nathan Chancellor wrote:
> Perhaps another solution would be to just
>
> #define cc_vendor (CC_VENDOR_NONE)
>
> if CONFIG_ARCH_HAS_CC_PLATFORM is not set, since it can never be changed
> from the default in arch/x86/coco/core.c.

I think this approach is cleaner.

Could you post a proper patch?

>
> diff --git a/arch/x86/include/asm/coco.h b/arch/x86/include/asm/coco.h
> index 6ae2d16a7613..f3909894f82f 100644
> --- a/arch/x86/include/asm/coco.h
> +++ b/arch/x86/include/asm/coco.h
> @@ -10,13 +10,13 @@ enum cc_vendor {
> CC_VENDOR_INTEL,
> };
>
> -extern enum cc_vendor cc_vendor;
> -
> #ifdef CONFIG_ARCH_HAS_CC_PLATFORM
> +extern enum cc_vendor cc_vendor;
> void cc_set_mask(u64 mask);
> u64 cc_mkenc(u64 val);
> u64 cc_mkdec(u64 val);
> #else
> +#define cc_vendor (CC_VENDOR_NONE)
> static inline u64 cc_mkenc(u64 val)
> {
> return val;
>
> Cheers,
> Nathan
>

--
Kiryl Shutsemau / Kirill A. Shutemov

\
 
 \ /
  Last update: 2024-05-27 14:46    [W:1.147 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site