Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: ccp - Add a header for multiple drivers to use `__psp_pa`

The TEE subdriver for CCP, the amdtee driver and the i2c-designware-amdpsp
drivers all include `psp-sev.h` even though they don't use SEV
functionality.

Move the definition of `__psp_pa` into a common header to be included
by all of these drivers.

Reviewed-by: Jan Dabros <jsd@semihalf.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> # For the drivers/i2c/busses/i2c-designware-amdpsp.c
Acked-by: Sumit Garg <sumit.garg@linaro.org> # For TEE subsystem bits
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Sean Christopherson <seanjc@google.com> # KVM
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Mario Limonciello and committed by
Herbert Xu
ae7d45fb a7ca7bbd

+20 -12
+1
arch/x86/kvm/svm/sev.c
··· 12 12 #include <linux/kvm_host.h> 13 13 #include <linux/kernel.h> 14 14 #include <linux/highmem.h> 15 + #include <linux/psp.h> 15 16 #include <linux/psp-sev.h> 16 17 #include <linux/pagemap.h> 17 18 #include <linux/swap.h>
+1
drivers/crypto/ccp/sev-dev.c
··· 24 24 #include <linux/cpufeature.h> 25 25 #include <linux/fs.h> 26 26 #include <linux/fs_struct.h> 27 + #include <linux/psp.h> 27 28 28 29 #include <asm/smp.h> 29 30 #include <asm/cacheflush.h>
+1 -1
drivers/crypto/ccp/tee-dev.c
··· 13 13 #include <linux/delay.h> 14 14 #include <linux/slab.h> 15 15 #include <linux/gfp.h> 16 - #include <linux/psp-sev.h> 16 + #include <linux/psp.h> 17 17 #include <linux/psp-tee.h> 18 18 19 19 #include "psp-dev.h"
+1 -1
drivers/i2c/busses/i2c-designware-amdpsp.c
··· 4 4 #include <linux/bits.h> 5 5 #include <linux/i2c.h> 6 6 #include <linux/io-64-nonatomic-lo-hi.h> 7 - #include <linux/psp-sev.h> 7 + #include <linux/psp.h> 8 8 #include <linux/types.h> 9 9 #include <linux/workqueue.h> 10 10
+1 -1
drivers/tee/amdtee/call.c
··· 8 8 #include <linux/tee_drv.h> 9 9 #include <linux/psp-tee.h> 10 10 #include <linux/slab.h> 11 - #include <linux/psp-sev.h> 11 + #include <linux/psp.h> 12 12 #include "amdtee_if.h" 13 13 #include "amdtee_private.h" 14 14
+1 -1
drivers/tee/amdtee/shm_pool.c
··· 5 5 6 6 #include <linux/slab.h> 7 7 #include <linux/tee_drv.h> 8 - #include <linux/psp-sev.h> 8 + #include <linux/psp.h> 9 9 #include "amdtee_private.h" 10 10 11 11 static int pool_op_alloc(struct tee_shm_pool *pool, struct tee_shm *shm,
-8
include/linux/psp-sev.h
··· 14 14 15 15 #include <uapi/linux/psp-sev.h> 16 16 17 - #ifdef CONFIG_X86 18 - #include <linux/mem_encrypt.h> 19 - 20 - #define __psp_pa(x) __sme_pa(x) 21 - #else 22 - #define __psp_pa(x) __pa(x) 23 - #endif 24 - 25 17 #define SEV_FW_BLOB_MAX_SIZE 0x4000 /* 16KB */ 26 18 27 19 /**
+14
include/linux/psp.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + 3 + #ifndef __PSP_H 4 + #define __PSP_H 5 + 6 + #ifdef CONFIG_X86 7 + #include <linux/mem_encrypt.h> 8 + 9 + #define __psp_pa(x) __sme_pa(x) 10 + #else 11 + #define __psp_pa(x) __pa(x) 12 + #endif 13 + 14 + #endif /* __PSP_H */