x86/sme: Replace occurrences of sme_active() with cc_platform_has()
authorTom Lendacky <thomas.lendacky@amd.com>
Wed, 8 Sep 2021 22:58:36 +0000 (17:58 -0500)
committerBorislav Petkov <bp@suse.de>
Mon, 4 Oct 2021 09:46:46 +0000 (11:46 +0200)
commit32cb4d02fb02cae2e0696c1ce92d8195574faf59
tree8e33210b05f9a0d2da8384b5494fa46c634d0b05
parentbfebd37e99dece9c83a373cf9f35def440fdd5df
x86/sme: Replace occurrences of sme_active() with cc_platform_has()

Replace uses of sme_active() with the more generic cc_platform_has()
using CC_ATTR_HOST_MEM_ENCRYPT. If future support is added for other
memory encryption technologies, the use of CC_ATTR_HOST_MEM_ENCRYPT
can be updated, as required.

This also replaces two usages of sev_active() that are really geared
towards detecting if SME is active.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210928191009.32551-6-bp@alien8.de
arch/x86/include/asm/kexec.h
arch/x86/include/asm/mem_encrypt.h
arch/x86/kernel/machine_kexec_64.c
arch/x86/kernel/pci-swiotlb.c
arch/x86/kernel/relocate_kernel_64.S
arch/x86/mm/ioremap.c
arch/x86/mm/mem_encrypt.c
arch/x86/mm/mem_encrypt_identity.c
arch/x86/realmode/init.c
drivers/iommu/amd/init.c