-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
powerpc/pseries/svm: Add a powerpc version of cc_platform_has()
Introduce a powerpc version of the cc_platform_has() function. This will be used to replace the powerpc mem_encrypt_active() implementation, so the implementation will initially only support the CC_ATTR_MEM_ENCRYPT attribute. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lkml.kernel.org/r/20210928191009.32551-5-bp@alien8.de
- Loading branch information
Tom Lendacky
authored and
Borislav Petkov
committed
Oct 4, 2021
1 parent
aa5a461
commit bfebd37
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
/* | ||
* Confidential Computing Platform Capability checks | ||
* | ||
* Copyright (C) 2021 Advanced Micro Devices, Inc. | ||
* | ||
* Author: Tom Lendacky <thomas.lendacky@amd.com> | ||
*/ | ||
|
||
#include <linux/export.h> | ||
#include <linux/cc_platform.h> | ||
|
||
#include <asm/machdep.h> | ||
#include <asm/svm.h> | ||
|
||
bool cc_platform_has(enum cc_attr attr) | ||
{ | ||
switch (attr) { | ||
case CC_ATTR_MEM_ENCRYPT: | ||
return is_secure_guest(); | ||
|
||
default: | ||
return false; | ||
} | ||
} | ||
EXPORT_SYMBOL_GPL(cc_platform_has); |