Commit 07aa1e78 authored by Michael Ellerman's avatar Michael Ellerman
Browse files

Merge branch 'topic/mem-encrypt' into next

This branch has some cross-arch patches that are a prequisite for the
SVM work. They're in a topic branch in case any of the other arch
maintainers want to merge them to resolve conflicts.
parents bc605cd7 5cbdaeef
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -925,6 +925,9 @@ config LOCK_EVENT_COUNTS
	  the chance of application behavior change because of timing
	  the chance of application behavior change because of timing
	  differences. The counts are reported via debugfs.
	  differences. The counts are reported via debugfs.


config ARCH_HAS_MEM_ENCRYPT
	bool

source "kernel/gcov/Kconfig"
source "kernel/gcov/Kconfig"


source "scripts/gcc-plugins/Kconfig"
source "scripts/gcc-plugins/Kconfig"
+1 −3
Original line number Original line Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
# SPDX-License-Identifier: GPL-2.0
config ARCH_HAS_MEM_ENCRYPT
        def_bool y

config MMU
config MMU
	def_bool y
	def_bool y


@@ -68,6 +65,7 @@ config S390
	select ARCH_HAS_GCOV_PROFILE_ALL
	select ARCH_HAS_GCOV_PROFILE_ALL
	select ARCH_HAS_GIGANTIC_PAGE
	select ARCH_HAS_GIGANTIC_PAGE
	select ARCH_HAS_KCOV
	select ARCH_HAS_KCOV
	select ARCH_HAS_MEM_ENCRYPT
	select ARCH_HAS_PTE_SPECIAL
	select ARCH_HAS_PTE_SPECIAL
	select ARCH_HAS_SET_MEMORY
	select ARCH_HAS_SET_MEMORY
	select ARCH_HAS_STRICT_KERNEL_RWX
	select ARCH_HAS_STRICT_KERNEL_RWX
+1 −4
Original line number Original line Diff line number Diff line
@@ -4,10 +4,7 @@


#ifndef __ASSEMBLY__
#ifndef __ASSEMBLY__


#define sme_me_mask	0ULL
static inline bool mem_encrypt_active(void) { return false; }

static inline bool sme_active(void) { return false; }
extern bool sev_active(void);


int set_memory_encrypted(unsigned long addr, int numpages);
int set_memory_encrypted(unsigned long addr, int numpages);
int set_memory_decrypted(unsigned long addr, int numpages);
int set_memory_decrypted(unsigned long addr, int numpages);
+1 −6
Original line number Original line Diff line number Diff line
@@ -156,14 +156,9 @@ int set_memory_decrypted(unsigned long addr, int numpages)
}
}


/* are we a protected virtualization guest? */
/* are we a protected virtualization guest? */
bool sev_active(void)
{
	return is_prot_virt_guest();
}

bool force_dma_unencrypted(struct device *dev)
bool force_dma_unencrypted(struct device *dev)
{
{
	return sev_active();
	return is_prot_virt_guest();
}
}


/* protected virtualization */
/* protected virtualization */
+1 −3
Original line number Original line Diff line number Diff line
@@ -68,6 +68,7 @@ config X86
	select ARCH_HAS_FORTIFY_SOURCE
	select ARCH_HAS_FORTIFY_SOURCE
	select ARCH_HAS_GCOV_PROFILE_ALL
	select ARCH_HAS_GCOV_PROFILE_ALL
	select ARCH_HAS_KCOV			if X86_64
	select ARCH_HAS_KCOV			if X86_64
	select ARCH_HAS_MEM_ENCRYPT
	select ARCH_HAS_MEMBARRIER_SYNC_CORE
	select ARCH_HAS_MEMBARRIER_SYNC_CORE
	select ARCH_HAS_PMEM_API		if X86_64
	select ARCH_HAS_PMEM_API		if X86_64
	select ARCH_HAS_PTE_DEVMAP		if X86_64
	select ARCH_HAS_PTE_DEVMAP		if X86_64
@@ -1518,9 +1519,6 @@ config X86_CPA_STATISTICS
	  helps to determine the effectiveness of preserving large and huge
	  helps to determine the effectiveness of preserving large and huge
	  page mappings when mapping protections are changed.
	  page mappings when mapping protections are changed.


config ARCH_HAS_MEM_ENCRYPT
	def_bool y

config AMD_MEM_ENCRYPT
config AMD_MEM_ENCRYPT
	bool "AMD Secure Memory Encryption (SME) support"
	bool "AMD Secure Memory Encryption (SME) support"
	depends on X86_64 && CPU_SUP_AMD
	depends on X86_64 && CPU_SUP_AMD
Loading