File tree Expand file tree Collapse file tree 2 files changed +24
-12
lines changed Expand file tree Collapse file tree 2 files changed +24
-12
lines changed Original file line number Diff line number Diff line change 13
13
#include <asm/coco.h>
14
14
#include <asm/processor.h>
15
15
16
- static enum cc_vendor vendor __ro_after_init ;
16
+ enum cc_vendor cc_vendor __ro_after_init ;
17
17
static u64 cc_mask __ro_after_init ;
18
18
19
19
static bool intel_cc_platform_has (enum cc_attr attr )
@@ -83,7 +83,7 @@ static bool hyperv_cc_platform_has(enum cc_attr attr)
83
83
84
84
bool cc_platform_has (enum cc_attr attr )
85
85
{
86
- switch (vendor ) {
86
+ switch (cc_vendor ) {
87
87
case CC_VENDOR_AMD :
88
88
return amd_cc_platform_has (attr );
89
89
case CC_VENDOR_INTEL :
@@ -105,7 +105,7 @@ u64 cc_mkenc(u64 val)
105
105
* - for AMD, bit *set* means the page is encrypted
106
106
* - for Intel *clear* means encrypted.
107
107
*/
108
- switch (vendor ) {
108
+ switch (cc_vendor ) {
109
109
case CC_VENDOR_AMD :
110
110
return val | cc_mask ;
111
111
case CC_VENDOR_INTEL :
@@ -118,7 +118,7 @@ u64 cc_mkenc(u64 val)
118
118
u64 cc_mkdec (u64 val )
119
119
{
120
120
/* See comment in cc_mkenc() */
121
- switch (vendor ) {
121
+ switch (cc_vendor ) {
122
122
case CC_VENDOR_AMD :
123
123
return val & ~cc_mask ;
124
124
case CC_VENDOR_INTEL :
@@ -129,11 +129,6 @@ u64 cc_mkdec(u64 val)
129
129
}
130
130
EXPORT_SYMBOL_GPL (cc_mkdec );
131
131
132
- __init void cc_set_vendor (enum cc_vendor v )
133
- {
134
- vendor = v ;
135
- }
136
-
137
132
__init void cc_set_mask (u64 mask )
138
133
{
139
134
cc_mask = mask ;
Original file line number Diff line number Diff line change @@ -11,13 +11,30 @@ enum cc_vendor {
11
11
CC_VENDOR_INTEL ,
12
12
};
13
13
14
- void cc_set_vendor (enum cc_vendor v );
15
- void cc_set_mask (u64 mask );
16
-
17
14
#ifdef CONFIG_ARCH_HAS_CC_PLATFORM
15
+ extern enum cc_vendor cc_vendor ;
16
+
17
+ static inline enum cc_vendor cc_get_vendor (void )
18
+ {
19
+ return cc_vendor ;
20
+ }
21
+
22
+ static inline void cc_set_vendor (enum cc_vendor vendor )
23
+ {
24
+ cc_vendor = vendor ;
25
+ }
26
+
27
+ void cc_set_mask (u64 mask );
18
28
u64 cc_mkenc (u64 val );
19
29
u64 cc_mkdec (u64 val );
20
30
#else
31
+ static inline enum cc_vendor cc_get_vendor (void )
32
+ {
33
+ return CC_VENDOR_NONE ;
34
+ }
35
+
36
+ static inline void cc_set_vendor (enum cc_vendor vendor ) { }
37
+
21
38
static inline u64 cc_mkenc (u64 val )
22
39
{
23
40
return val ;
You can’t perform that action at this time.
0 commit comments