Skip to contentSkip to conversation

arm: include: secure: Don't include asm\global_data.h in .S file

PATCH Superseded Siew Chin Lim 3 participants 3 messages Feb 19, 2021 – Feb 22, 2021 Arm (32-bit)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: include: secure: Don't include asm\global_data.h in .S file

Commit "common: Drop asm/global_data.h from common header" added asm\global_data.h into secure.h. However, secure.h will be included by psci.S. Adding asm\global_data.h has caused compilation failure in pcsi.S. Update secure.h to only include asm\global_data.h in non-assembly section.

---
 arch/arm/include/asm/secure.h | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
arch/arm/include/asm/secure.h +12 -11
index 64e5582c1f..63a21f89ce 100644
@@ -2,7 +2,9 @@
 #define __ASM_SECURE_H
 
 #include <config.h>
+#ifndef __ASSEMBLY__
 #include <asm/global_data.h>
+#endif
 
 #define __secure __attribute__ ((section ("._secure.text")))
 #define __secure_data __attribute__ ((section ("._secure.data")))
@@ -27,17 +29,6 @@ typedef struct secure_svc_tbl {
 				.id = _id, \
 				.func = _fn }
 
-#else
-
-#ifdef CONFIG_ARMV8_PSCI
-#define SECURE_SVC_TBL_OFFSET		16
-#else
-#define SECURE_SVC_TBL_OFFSET		8
-
-#endif
-
-#endif /* __ASSEMBLY__ */
-
 #if defined(CONFIG_ARMV7_SECURE_BASE) || defined(CONFIG_ARMV8_SECURE_BASE)
 /*
  * Warning, horror ahead.
@@ -58,4 +49,14 @@ typedef struct secure_svc_tbl {
 #define secure_ram_addr(_fn)	(_fn)
 #endif
 
+#else /* __ASSEMBLY__ */
+
+#ifdef CONFIG_ARMV8_PSCI
+#define SECURE_SVC_TBL_OFFSET		16
+#else
+#define SECURE_SVC_TBL_OFFSET		8
+#endif
+
+#endif /* __ASSEMBLY__ */
+
 #endif
Signature · 1 line
2.13.0
#1 lore raw

PATCH 1/1 arm: include: secure: Don't include asm\global_data.h in .S file

Hi Siew,

Quoted 3 lines · Siew Chin Lim

Commit "common: Drop asm/global_data.h from common header" added asm\global_data.h into secure.h. However, secure.h will be included

asm/global_data.h

Quoted 8 lines

by psci.S. Adding asm\global_data.h has caused compilation failure in pcsi.S. Update secure.h to only include asm\global_data.h in non-assembly section.

---
 arch/arm/include/asm/secure.h | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

Which board shows this failure?

Quoted 49 lines
arch/arm/include/asm/secure.h +12 -12
index 64e5582c1f..63a21f89ce 100644
@@ -2,7 +2,9 @@
 #define __ASM_SECURE_H
 
 #include <config.h>
+#ifndef __ASSEMBLY__
 #include <asm/global_data.h>
+#endif
 
 #define __secure __attribute__ ((section ("._secure.text")))
 #define __secure_data __attribute__ ((section ("._secure.data")))
@@ -27,17 +29,6 @@ typedef struct secure_svc_tbl {
                                .id = _id, \
                                .func = _fn }
 
-#else
-
-#ifdef CONFIG_ARMV8_PSCI
-#define SECURE_SVC_TBL_OFFSET          16
-#else
-#define SECURE_SVC_TBL_OFFSET          8
-
-#endif
-
-#endif /* __ASSEMBLY__ */
-
 #if defined(CONFIG_ARMV7_SECURE_BASE) || defined(CONFIG_ARMV8_SECURE_BASE)
 /*
  * Warning, horror ahead.
@@ -58,4 +49,14 @@ typedef struct secure_svc_tbl {
 #define secure_ram_addr(_fn)   (_fn)
 #endif
 
+#else /* __ASSEMBLY__ */
+
+#ifdef CONFIG_ARMV8_PSCI
+#define SECURE_SVC_TBL_OFFSET          16
+#else
+#define SECURE_SVC_TBL_OFFSET          8
+#endif
+
+#endif /* __ASSEMBLY__ */
+
 #endif
--
Quoted 2 lines

2.13.0

Regards,
Simon

#2 lore raw

PATCH 1/1 arm: include: secure: Don't include asm\global_data.h in .S file

Hi Simon,

Quoted 15 lines

-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Saturday, February 20, 2021 7:55 PM
To: Lim, Elly Siew Chin <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Marek Vasut <[email protected]>; Tan, Ley Foon <[email protected]>; See, Chin Liang <[email protected]>; Simon Goldschmidt <[email protected]>; Chee, Tien Fong <[email protected]>; Westergreen, Dalon <[email protected]>; Gan, Yau Wai <[email protected]>
Subject: Re: [PATCH] arm: include: secure: Don't include asm\global_data.h in .S file

Hi Siew,

Quoted 7 lines
Quoted 3 lines · Siew Chin Lim

Commit "common: Drop asm/global_data.h from common header" added asm\global_data.h into secure.h. However, secure.h will be included

asm/global_data.h

Noted. I will update the comment.

Quoted 5 lines
Quoted 5 lines

by psci.S. Adding asm\global_data.h has caused compilation failure in pcsi.S. Update secure.h to only include asm\global_data.h in non-assembly section.

Quoted 7 lines
Quoted 4 lines
---
 arch/arm/include/asm/secure.h | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

Which board shows this failure?

Intel socfpga board with non-ATF flow. We need to enable CONFIG_ARMV8_PSCI at our downstream patch for non-ATF flow PSCI support. With this CONFIG_ARMV8_PSCI, it will compile psci.S, psci.S include secure.h, and secure.h have been updated to include "asm/global_data.h". The compilation fails with the following errors.

./arch/arm/include/asm/types.h: Assembler messages:
./arch/arm/include/asm/types.h:6: Error: unknown mnemonic typedef' -- typedef unsigned short umode_t' ./arch/arm/include/asm/types.h:20: Error: unknown mnemonic typedef' -- typedef unsigned long long phys_addr_t' ./arch/arm/include/asm/types.h:21: Error: unknown mnemonic typedef' -- typedef unsigned long long phys_size_t' ./arch/arm/include/asm/types.h:38: Error: unknown mnemonic typedef' -- typedef unsigned long long dma_addr_t' include/linux/posix_types.h:36: Error: unknown mnemonic typedef' -- typedef struct{'
...< truncated>...

Thanks,
Siew Chin

Quoted 55 lines
Quoted 50 lines
(quoted diff) +0 -0

b/arch/arm/include/asm/secure.h index 64e5582c1f..63a21f89ce 100644

arch/arm/include/asm/secure.h +2 -0
@@ -2,7 +2,9 @@
 #define __ASM_SECURE_H
 
 #include <config.h>
+#ifndef __ASSEMBLY__
 #include <asm/global_data.h>
+#endif
 
 #define __secure __attribute__ ((section ("._secure.text")))  #define

__secure_data __attribute__ ((section ("._secure.data"))) @@ -27,17

+29,6 @@ typedef struct secure_svc_tbl {
                                .id = _id, \
                                .func = _fn }
arch/arm/include/asm/secure.h +0 -11
-#else
-
-#ifdef CONFIG_ARMV8_PSCI
-#define SECURE_SVC_TBL_OFFSET          16
-#else
-#define SECURE_SVC_TBL_OFFSET          8
-
-#endif
-
-#endif /* __ASSEMBLY__ */
-
 #if defined(CONFIG_ARMV7_SECURE_BASE) ||

defined(CONFIG_ARMV8_SECURE_BASE)
/*
* Warning, horror ahead.

arch/arm/include/asm/secure.h +10 -1
@@ -58,4 +49,14 @@ typedef struct secure_svc_tbl {
 #define secure_ram_addr(_fn)   (_fn)
 #endif
 
+#else /* __ASSEMBLY__ */
+
+#ifdef CONFIG_ARMV8_PSCI
+#define SECURE_SVC_TBL_OFFSET          16
+#else
+#define SECURE_SVC_TBL_OFFSET          8
+#endif
+
+#endif /* __ASSEMBLY__ */
+
 #endif
--
Quoted 2 lines

2.13.0

Regards,
Simon