Commit da86eb96 authored by Borislav Petkov (AMD)'s avatar Borislav Petkov (AMD)

x86/coco: Get rid of accessor functions

cc_vendor is __ro_after_init and thus can be used directly.

No functional changes.
Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230508121957.32341-1-bp@alien8.de
parent f710ac54
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <asm/coco.h> #include <asm/coco.h>
#include <asm/processor.h> #include <asm/processor.h>
enum cc_vendor cc_vendor __ro_after_init; enum cc_vendor cc_vendor __ro_after_init = CC_VENDOR_NONE;
static u64 cc_mask __ro_after_init; static u64 cc_mask __ro_after_init;
static bool noinstr intel_cc_platform_has(enum cc_attr attr) static bool noinstr intel_cc_platform_has(enum cc_attr attr)
......
...@@ -852,7 +852,7 @@ void __init tdx_early_init(void) ...@@ -852,7 +852,7 @@ void __init tdx_early_init(void)
setup_force_cpu_cap(X86_FEATURE_TDX_GUEST); setup_force_cpu_cap(X86_FEATURE_TDX_GUEST);
cc_set_vendor(CC_VENDOR_INTEL); cc_vendor = CC_VENDOR_INTEL;
tdx_parse_tdinfo(&cc_mask); tdx_parse_tdinfo(&cc_mask);
cc_set_mask(cc_mask); cc_set_mask(cc_mask);
......
...@@ -364,7 +364,7 @@ void __init hv_vtom_init(void) ...@@ -364,7 +364,7 @@ void __init hv_vtom_init(void)
* Set it here to indicate a vTOM VM. * Set it here to indicate a vTOM VM.
*/ */
sev_status = MSR_AMD64_SNP_VTOM; sev_status = MSR_AMD64_SNP_VTOM;
cc_set_vendor(CC_VENDOR_AMD); cc_vendor = CC_VENDOR_AMD;
cc_set_mask(ms_hyperv.shared_gpa_boundary); cc_set_mask(ms_hyperv.shared_gpa_boundary);
physical_mask &= ms_hyperv.shared_gpa_boundary - 1; physical_mask &= ms_hyperv.shared_gpa_boundary - 1;
......
...@@ -10,30 +10,13 @@ enum cc_vendor { ...@@ -10,30 +10,13 @@ enum cc_vendor {
CC_VENDOR_INTEL, CC_VENDOR_INTEL,
}; };
#ifdef CONFIG_ARCH_HAS_CC_PLATFORM
extern enum cc_vendor cc_vendor; extern enum cc_vendor cc_vendor;
static inline enum cc_vendor cc_get_vendor(void) #ifdef CONFIG_ARCH_HAS_CC_PLATFORM
{
return cc_vendor;
}
static inline void cc_set_vendor(enum cc_vendor vendor)
{
cc_vendor = vendor;
}
void cc_set_mask(u64 mask); void cc_set_mask(u64 mask);
u64 cc_mkenc(u64 val); u64 cc_mkenc(u64 val);
u64 cc_mkdec(u64 val); u64 cc_mkdec(u64 val);
#else #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) static inline u64 cc_mkenc(u64 val)
{ {
return val; return val;
......
...@@ -612,7 +612,7 @@ void __init sme_enable(struct boot_params *bp) ...@@ -612,7 +612,7 @@ void __init sme_enable(struct boot_params *bp)
out: out:
if (sme_me_mask) { if (sme_me_mask) {
physical_mask &= ~sme_me_mask; physical_mask &= ~sme_me_mask;
cc_set_vendor(CC_VENDOR_AMD); cc_vendor = CC_VENDOR_AMD;
cc_set_mask(sme_me_mask); cc_set_mask(sme_me_mask);
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment