Skip to content

Commit 2012532

Browse files
jgunthorpewilldeacon
authored andcommitted
arm64: Add missing includes for mem_encrypt
Doing: #include <linux/mem_encrypt.h> Causes a bunch of compiler failures due to missing implicit includes that don't happen on x86: ../arch/arm64/include/asm/rsi_cmds.h:117:2: error: call to undeclared library function 'memcpy' with type 'void *(void *, const void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 117 | memcpy(&regs.a1, challenge, size); ../arch/arm64/include/asm/mem_encrypt.h:19:49: warning: declaration of 'struct device' will not be visible outside of this function [-Wvisibility] 19 | static inline bool force_dma_unencrypted(struct device *dev) ../arch/arm64/include/asm/rsi_cmds.h:44:38: error: call to undeclared function 'virt_to_phys'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 44 | arm_smccc_smc(SMC_RSI_REALM_CONFIG, virt_to_phys(cfg), Add the missing includes to the arch/arm headers to avoid this. Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/0-v1-47aadfbd64cd+25795-arm_memenc_h_jgg@nvidia.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 0af2f6b commit 2012532

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

arch/arm64/include/asm/mem_encrypt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include <asm/rsi.h>
66

7+
struct device;
8+
79
struct arm64_mem_crypt_ops {
810
int (*encrypt)(unsigned long addr, int numpages);
911
int (*decrypt)(unsigned long addr, int numpages);

arch/arm64/include/asm/rsi_cmds.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#define __ASM_RSI_CMDS_H
88

99
#include <linux/arm-smccc.h>
10+
#include <linux/string.h>
11+
#include <asm/memory.h>
1012

1113
#include <asm/rsi_smc.h>
1214

0 commit comments

Comments
 (0)