diff options
author | Borislav Petkov (AMD) <bp@alien8.de> | 2023-03-18 14:56:33 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2023-03-30 15:06:28 +0300 |
commit | 3d91c537296794d5d0773f61abbe7b63f2f132d8 (patch) | |
tree | d3e2184d0165db93c9a5b04dfd2911b222fcc5e5 /arch/x86/include/asm/coco.h | |
parent | e8d018dd0257f744ca50a729e3d042cf2ec9da65 (diff) | |
download | linux-3d91c537296794d5d0773f61abbe7b63f2f132d8.tar.xz |
x86/coco: Export cc_vendor
It will be used in different checks in future changes. Export it directly
and provide accessor functions and stubs so this can be used in general
code when CONFIG_ARCH_HAS_CC_PLATFORM is not set.
No functional changes.
[ tglx: Add accessor functions ]
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230318115634.9392-2-bp@alien8.de
Diffstat (limited to 'arch/x86/include/asm/coco.h')
-rw-r--r-- | arch/x86/include/asm/coco.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/arch/x86/include/asm/coco.h b/arch/x86/include/asm/coco.h index 3d98c3a60d34..91b9448ffe76 100644 --- a/arch/x86/include/asm/coco.h +++ b/arch/x86/include/asm/coco.h @@ -11,13 +11,30 @@ enum cc_vendor { CC_VENDOR_INTEL, }; -void cc_set_vendor(enum cc_vendor v); -void cc_set_mask(u64 mask); - #ifdef CONFIG_ARCH_HAS_CC_PLATFORM +extern enum cc_vendor cc_vendor; + +static inline enum cc_vendor cc_get_vendor(void) +{ + return cc_vendor; +} + +static inline void cc_set_vendor(enum cc_vendor vendor) +{ + cc_vendor = vendor; +} + +void cc_set_mask(u64 mask); u64 cc_mkenc(u64 val); u64 cc_mkdec(u64 val); #else +static inline enum cc_vendor cc_get_vendor(void) +{ + return CC_VENDOR_NONE; +} + +static inline void cc_set_vendor(enum cc_vendor vendor) { } + static inline u64 cc_mkenc(u64 val) { return val; |