Commit e82f2069 authored by Wei Liu's avatar Wei Liu
Browse files

Merge remote-tracking branch 'tip/x86/cc' into hyperv-next

parents 7117dcca e9d1d2bb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1234,6 +1234,9 @@ config RELR
config ARCH_HAS_MEM_ENCRYPT
	bool

config ARCH_HAS_CC_PLATFORM
	bool

config HAVE_SPARSE_SYSCALL_NR
       bool
       help
+0 −5
Original line number Diff line number Diff line
@@ -10,11 +10,6 @@

#include <asm/svm.h>

static inline bool mem_encrypt_active(void)
{
	return is_secure_guest();
}

static inline bool force_dma_unencrypted(struct device *dev)
{
	return is_secure_guest();
+1 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@ config PPC_SVM
	select SWIOTLB
	select ARCH_HAS_MEM_ENCRYPT
	select ARCH_HAS_FORCE_DMA_UNENCRYPTED
	select ARCH_HAS_CC_PLATFORM
	help
	 There are certain POWER platforms which support secure guests using
	 the Protected Execution Facility, with the help of an Ultravisor
+2 −0
Original line number Diff line number Diff line
@@ -31,3 +31,5 @@ obj-$(CONFIG_FA_DUMP) += rtas-fadump.o

obj-$(CONFIG_SUSPEND)		+= suspend.o
obj-$(CONFIG_PPC_VAS)		+= vas.o

obj-$(CONFIG_ARCH_HAS_CC_PLATFORM)	+= cc_platform.o
+26 −0
Original line number Diff line number Diff line
// 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);
Loading