mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 17:02:17 +00:00
RIP_REL_REF() has no effect on code residing in arch/x86/boot/startup, as it is built with -fPIC. So remove any occurrences from the SME startup code. Note the SME is the only caller of cc_set_mask() that requires this, so drop it from there as well. Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: Dionna Amalie Glaze <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Kees Cook <[email protected]> Cc: Kevin Loughlin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Tom Lendacky <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
51 lines
769 B
C
51 lines
769 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_X86_COCO_H
|
|
#define _ASM_X86_COCO_H
|
|
|
|
#include <asm/asm.h>
|
|
#include <asm/types.h>
|
|
|
|
enum cc_vendor {
|
|
CC_VENDOR_NONE,
|
|
CC_VENDOR_AMD,
|
|
CC_VENDOR_INTEL,
|
|
};
|
|
|
|
#ifdef CONFIG_ARCH_HAS_CC_PLATFORM
|
|
extern enum cc_vendor cc_vendor;
|
|
extern u64 cc_mask;
|
|
|
|
static inline u64 cc_get_mask(void)
|
|
{
|
|
return cc_mask;
|
|
}
|
|
|
|
static inline void cc_set_mask(u64 mask)
|
|
{
|
|
cc_mask = mask;
|
|
}
|
|
|
|
u64 cc_mkenc(u64 val);
|
|
u64 cc_mkdec(u64 val);
|
|
void cc_random_init(void);
|
|
#else
|
|
#define cc_vendor (CC_VENDOR_NONE)
|
|
static inline u64 cc_get_mask(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline u64 cc_mkenc(u64 val)
|
|
{
|
|
return val;
|
|
}
|
|
|
|
static inline u64 cc_mkdec(u64 val)
|
|
{
|
|
return val;
|
|
}
|
|
static inline void cc_random_init(void) { }
|
|
#endif
|
|
|
|
#endif /* _ASM_X86_COCO_H */
|