Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
87efe384
Commit
87efe384
authored
Mar 30, 2023
by
Thomas Gleixner
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'x86/cc' into x86/sev
Pick up the cc_vendor changes.
parents
812b0597
3d91c537
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
+24
-12
arch/x86/coco/core.c
arch/x86/coco/core.c
+4
-9
arch/x86/include/asm/coco.h
arch/x86/include/asm/coco.h
+20
-3
No files found.
arch/x86/coco/core.c
View file @
87efe384
...
...
@@ -13,7 +13,7 @@
#include <asm/coco.h>
#include <asm/processor.h>
static
enum
cc_vendor
vendor
__ro_after_init
;
enum
cc_vendor
cc_
vendor
__ro_after_init
;
static
u64
cc_mask
__ro_after_init
;
static
bool
intel_cc_platform_has
(
enum
cc_attr
attr
)
...
...
@@ -99,7 +99,7 @@ static bool amd_cc_platform_has(enum cc_attr attr)
bool
cc_platform_has
(
enum
cc_attr
attr
)
{
switch
(
vendor
)
{
switch
(
cc_
vendor
)
{
case
CC_VENDOR_AMD
:
return
amd_cc_platform_has
(
attr
);
case
CC_VENDOR_INTEL
:
...
...
@@ -119,7 +119,7 @@ u64 cc_mkenc(u64 val)
* - for AMD, bit *set* means the page is encrypted
* - for AMD with vTOM and for Intel, *clear* means encrypted
*/
switch
(
vendor
)
{
switch
(
cc_
vendor
)
{
case
CC_VENDOR_AMD
:
if
(
sev_status
&
MSR_AMD64_SNP_VTOM
)
return
val
&
~
cc_mask
;
...
...
@@ -135,7 +135,7 @@ u64 cc_mkenc(u64 val)
u64
cc_mkdec
(
u64
val
)
{
/* See comment in cc_mkenc() */
switch
(
vendor
)
{
switch
(
cc_
vendor
)
{
case
CC_VENDOR_AMD
:
if
(
sev_status
&
MSR_AMD64_SNP_VTOM
)
return
val
|
cc_mask
;
...
...
@@ -149,11 +149,6 @@ u64 cc_mkdec(u64 val)
}
EXPORT_SYMBOL_GPL
(
cc_mkdec
);
__init
void
cc_set_vendor
(
enum
cc_vendor
v
)
{
vendor
=
v
;
}
__init
void
cc_set_mask
(
u64
mask
)
{
cc_mask
=
mask
;
...
...
arch/x86/include/asm/coco.h
View file @
87efe384
...
...
@@ -10,13 +10,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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment