Mention branches and keyring.
[releases.git] / x86 / include / asm / coco.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_COCO_H
3 #define _ASM_X86_COCO_H
4
5 #include <asm/asm.h>
6 #include <asm/types.h>
7
8 enum cc_vendor {
9         CC_VENDOR_NONE,
10         CC_VENDOR_AMD,
11         CC_VENDOR_HYPERV,
12         CC_VENDOR_INTEL,
13 };
14
15 extern enum cc_vendor cc_vendor;
16
17 #ifdef CONFIG_ARCH_HAS_CC_PLATFORM
18 extern u64 cc_mask;
19
20 static inline void cc_set_mask(u64 mask)
21 {
22         RIP_REL_REF(cc_mask) = mask;
23 }
24
25 u64 cc_mkenc(u64 val);
26 u64 cc_mkdec(u64 val);
27 void cc_random_init(void);
28 #else
29 static const u64 cc_mask = 0;
30
31 static inline u64 cc_mkenc(u64 val)
32 {
33         return val;
34 }
35
36 static inline u64 cc_mkdec(u64 val)
37 {
38         return val;
39 }
40 static inline void cc_random_init(void) { }
41 #endif
42
43 #endif /* _ASM_X86_COCO_H */