--- v3
+++ v4
@@ -6,11 +6,15 @@
Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
---
- arch/x86/kernel/cc_platform.c | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
+Change since v3:
+ * Change code style of checking GUEST_MEM attribute in the
+ hyperv_cc_platform_has().
+---
+ arch/x86/kernel/cc_platform.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
diff --git a/arch/x86/kernel/cc_platform.c b/arch/x86/kernel/cc_platform.c
-index 03bb2f343ddb..f3bb0431f5c5 100644
+index 03bb2f343ddb..27c06b32e7c4 100644
--- a/arch/x86/kernel/cc_platform.c
+++ b/arch/x86/kernel/cc_platform.c
@@ -11,6 +11,7 @@
@@ -21,17 +25,14 @@
#include <asm/processor.h>
static bool __maybe_unused intel_cc_platform_has(enum cc_attr attr)
-@@ -58,9 +59,23 @@ static bool amd_cc_platform_has(enum cc_attr attr)
+@@ -58,9 +59,20 @@ static bool amd_cc_platform_has(enum cc_attr attr)
#endif
}
+static bool hyperv_cc_platform_has(enum cc_attr attr)
+{
+#ifdef CONFIG_HYPERV
-+ if (attr == CC_ATTR_GUEST_MEM_ENCRYPT)
-+ return true;
-+ else
-+ return false;
++ return attr == CC_ATTR_GUEST_MEM_ENCRYPT;
+#else
+ return false;
+#endif