All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/4] optee-os: Extend clang pragma fixes to core_mmu_v7.c for 3.18
@ 2022-09-22  0:54 Khem Raj
  2022-09-22  0:54 ` [PATCH v2 2/4] trusted-services: Pin to use gcc Khem Raj
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Khem Raj @ 2022-09-22  0:54 UTC (permalink / raw)
  To: meta-arm; +Cc: Khem Raj

3.18 builds are failing since the section stuff is also done in
core_mmu_v7.c therefore extend the patch to include this file as well

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Rebased

 ...-Define-section-attributes-for-clang.patch | 120 +++++++++---------
 1 file changed, 59 insertions(+), 61 deletions(-)

diff --git a/meta-arm/recipes-security/optee/optee-os/0001-core-Define-section-attributes-for-clang.patch b/meta-arm/recipes-security/optee/optee-os/0001-core-Define-section-attributes-for-clang.patch
index d30fa5a..a69d777 100644
--- a/meta-arm/recipes-security/optee/optee-os/0001-core-Define-section-attributes-for-clang.patch
+++ b/meta-arm/recipes-security/optee/optee-os/0001-core-Define-section-attributes-for-clang.patch
@@ -1,4 +1,4 @@
-From 4ff172196d399217992110a47312c626954a844c Mon Sep 17 00:00:00 2001
+From f189457b79989543f65b8a4e8729eff2cdf9a758 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 13 Aug 2022 19:24:55 -0700
 Subject: [PATCH] core: Define section attributes for clang
@@ -30,20 +30,16 @@ going and match the functionality with gcc.
 
 Upstream-Status: Pending
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
 ---
  core/arch/arm/kernel/thread.c    | 19 +++++++++++++++--
  core/arch/arm/mm/core_mmu_lpae.c | 35 ++++++++++++++++++++++++++++----
- core/arch/arm/mm/core_mmu_v7.c   | 27 +++++++++++++++++++++---
  core/arch/arm/mm/pgt_cache.c     | 12 ++++++++++-
  core/kernel/thread.c             | 13 +++++++++++-
- 5 files changed, 95 insertions(+), 11 deletions(-)
+ 4 files changed, 71 insertions(+), 8 deletions(-)
 
-diff --git a/core/arch/arm/kernel/thread.c b/core/arch/arm/kernel/thread.c
-index f083b159..432983c8 100644
 --- a/core/arch/arm/kernel/thread.c
 +++ b/core/arch/arm/kernel/thread.c
-@@ -44,15 +44,30 @@ static size_t thread_user_kcode_size __nex_bss;
+@@ -44,16 +44,31 @@ static size_t thread_user_kcode_size __n
  #if defined(CFG_CORE_UNMAP_CORE_AT_EL0) && \
  	defined(CFG_CORE_WORKAROUND_SPECTRE_BP_SEC) && defined(ARM64)
  long thread_user_kdata_sp_offset __nex_bss;
@@ -66,18 +62,17 @@ index f083b159..432983c8 100644
 -	__section(".nex_nozi.kdata_page");
 +	__section(".nex_nozi.kdata_page")
  #endif
-+#endif
+ #endif
 +    ;
 +#endif
 +
 +/* reset BSS section to default ( .bss ) */
 +#ifdef __clang__
 +#pragma clang section bss=""
- #endif
++#endif
  
  #ifdef ARM32
-diff --git a/core/arch/arm/mm/core_mmu_lpae.c b/core/arch/arm/mm/core_mmu_lpae.c
-index 3f08eec6..e6dc9261 100644
+ uint32_t __nostackcheck thread_get_exceptions(void)
 --- a/core/arch/arm/mm/core_mmu_lpae.c
 +++ b/core/arch/arm/mm/core_mmu_lpae.c
 @@ -233,19 +233,46 @@ typedef uint16_t l1_idx_t;
@@ -131,53 +126,6 @@ index 3f08eec6..e6dc9261 100644
  /*
   * TAs page table entry inside a level 1 page table.
   *
-diff --git a/core/arch/arm/mm/core_mmu_v7.c b/core/arch/arm/mm/core_mmu_v7.c
-index cd85bd22..ee78e6ee 100644
---- a/core/arch/arm/mm/core_mmu_v7.c
-+++ b/core/arch/arm/mm/core_mmu_v7.c
-@@ -204,16 +204,37 @@ typedef uint32_t l1_xlat_tbl_t[NUM_L1_ENTRIES];
- typedef uint32_t l2_xlat_tbl_t[NUM_L2_ENTRIES];
- typedef uint32_t ul1_xlat_tbl_t[NUM_UL1_ENTRIES];
- 
-+#ifdef __clang__
-+#pragma clang section bss=".nozi.mmu.l1"
-+#endif
- static l1_xlat_tbl_t main_mmu_l1_ttb
--		__aligned(L1_ALIGNMENT) __section(".nozi.mmu.l1");
-+		__aligned(L1_ALIGNMENT)
-+#ifndef __clang__
-+	__section(".nozi.mmu.l1")
-+#endif
-+;
- 
- /* L2 MMU tables */
-+#ifdef __clang__
-+#pragma clang section bss=".nozi.mmu.l2"
-+#endif
- static l2_xlat_tbl_t main_mmu_l2_ttb[MAX_XLAT_TABLES]
--		__aligned(L2_ALIGNMENT) __section(".nozi.mmu.l2");
-+		__aligned(L2_ALIGNMENT)
-+#ifndef __clang__
-+	__section(".nozi.mmu.l2")
-+#endif
-+;
- 
- /* MMU L1 table for TAs, one for each thread */
-+#ifdef __clang__
-+#pragma clang section bss=".nozi.mmu.ul1"
-+#endif
- static ul1_xlat_tbl_t main_mmu_ul1_ttb[CFG_NUM_THREADS]
--		__aligned(UL1_ALIGNMENT) __section(".nozi.mmu.ul1");
-+		__aligned(UL1_ALIGNMENT)
-+#ifndef __clang__
-+	__section(".nozi.mmu.ul1")
-+#endif
-+;
- 
- struct mmu_partition {
- 	l1_xlat_tbl_t *l1_table;
-diff --git a/core/arch/arm/mm/pgt_cache.c b/core/arch/arm/mm/pgt_cache.c
-index dee1d207..382cae1c 100644
 --- a/core/arch/arm/mm/pgt_cache.c
 +++ b/core/arch/arm/mm/pgt_cache.c
 @@ -104,8 +104,18 @@ void pgt_init(void)
@@ -200,11 +148,9 @@ index dee1d207..382cae1c 100644
  	size_t n;
  
  	for (n = 0; n < ARRAY_SIZE(pgt_tables); n++) {
-diff --git a/core/kernel/thread.c b/core/kernel/thread.c
-index 18d34e6a..086129e2 100644
 --- a/core/kernel/thread.c
 +++ b/core/kernel/thread.c
-@@ -37,13 +37,24 @@ struct thread_core_local thread_core_local[CFG_TEE_CORE_NB_CORE] __nex_bss;
+@@ -37,13 +37,24 @@ struct thread_core_local thread_core_loc
  	name[stack_num][sizeof(name[stack_num]) / sizeof(uint32_t) - 1]
  #endif
  
@@ -230,3 +176,55 @@ index 18d34e6a..086129e2 100644
  #define GET_STACK(stack) ((vaddr_t)(stack) + STACK_SIZE(stack))
  
  DECLARE_STACK(stack_tmp, CFG_TEE_CORE_NB_CORE,
+--- a/core/arch/arm/mm/core_mmu_v7.c
++++ b/core/arch/arm/mm/core_mmu_v7.c
+@@ -204,16 +204,46 @@ typedef uint32_t l1_xlat_tbl_t[NUM_L1_EN
+ typedef uint32_t l2_xlat_tbl_t[NUM_L2_ENTRIES];
+ typedef uint32_t ul1_xlat_tbl_t[NUM_UL1_ENTRIES];
+ 
++#ifdef __clang__
++#pragma clang section bss=".nozi.mmu.l1"
++#endif
+ static l1_xlat_tbl_t main_mmu_l1_ttb
+-		__aligned(L1_ALIGNMENT) __section(".nozi.mmu.l1");
++		__aligned(L1_ALIGNMENT)
++#ifndef __clang__
++       __section(".nozi.mmu.l1")
++#endif
++;
++#ifdef __clang__
++#pragma clang section bss=""
++#endif
+ 
+ /* L2 MMU tables */
++#ifdef __clang__
++#pragma clang section bss=".nozi.mmu.l2"
++#endif
+ static l2_xlat_tbl_t main_mmu_l2_ttb[MAX_XLAT_TABLES]
+-		__aligned(L2_ALIGNMENT) __section(".nozi.mmu.l2");
++		__aligned(L2_ALIGNMENT)
++#ifndef __clang__
++       __section(".nozi.mmu.l2")
++#endif
++;
++#ifdef __clang__
++#pragma clang section bss=""
++#endif
+ 
+ /* MMU L1 table for TAs, one for each thread */
++#ifdef __clang__
++#pragma clang section bss=".nozi.mmu.ul1"
++#endif
+ static ul1_xlat_tbl_t main_mmu_ul1_ttb[CFG_NUM_THREADS]
+-		__aligned(UL1_ALIGNMENT) __section(".nozi.mmu.ul1");
++		__aligned(UL1_ALIGNMENT)
++#ifndef __clang__
++       __section(".nozi.mmu.ul1")
++#endif
++;
++#ifdef __clang__
++#pragma clang section bss=""
++#endif
+ 
+ struct mmu_partition {
+ 	l1_xlat_tbl_t *l1_table;
-- 
2.37.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/4] trusted-services: Pin to use gcc
  2022-09-22  0:54 [PATCH v2 1/4] optee-os: Extend clang pragma fixes to core_mmu_v7.c for 3.18 Khem Raj
@ 2022-09-22  0:54 ` Khem Raj
  2022-09-22  0:54 ` [PATCH v2 3/4] linux-yocto: Add bbappend for 5.19 Khem Raj
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2022-09-22  0:54 UTC (permalink / raw)
  To: meta-arm; +Cc: Khem Raj

These recipes are not buildable with clang in its current state

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Rebased

 meta-arm/recipes-security/trusted-services/trusted-services.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta-arm/recipes-security/trusted-services/trusted-services.inc b/meta-arm/recipes-security/trusted-services/trusted-services.inc
index 80c0849..a8f49a5 100644
--- a/meta-arm/recipes-security/trusted-services/trusted-services.inc
+++ b/meta-arm/recipes-security/trusted-services/trusted-services.inc
@@ -50,3 +50,5 @@ EXTRA_OECMAKE += "${@oe.utils.conditional('TS_ENV', 'opteesp', \
 EXTRA_OECMAKE += "-Dlibts_DIR=${STAGING_DIR_HOST}${TS_INSTALL}/lib/cmake/ \
                   -DNEWLIB_INSTALL_DIR=${STAGING_DIR_HOST}${TS_INSTALL}/newlib_install \
                  "
+# Newlib does not compile with clang
+TOOLCHAIN = "gcc"
-- 
2.37.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/4] linux-yocto: Add bbappend for 5.19
  2022-09-22  0:54 [PATCH v2 1/4] optee-os: Extend clang pragma fixes to core_mmu_v7.c for 3.18 Khem Raj
  2022-09-22  0:54 ` [PATCH v2 2/4] trusted-services: Pin to use gcc Khem Raj
@ 2022-09-22  0:54 ` Khem Raj
  2022-09-23  0:40   ` Jon Mason
  2022-09-22  0:54 ` [PATCH v2 4/4] ffa-debugfs-mod: Exclude from world builds Khem Raj
  2022-09-23 15:31 ` [PATCH v2 1/4] optee-os: Extend clang pragma fixes to core_mmu_v7.c for 3.18 Jon Mason
  3 siblings, 1 reply; 7+ messages in thread
From: Khem Raj @ 2022-09-22  0:54 UTC (permalink / raw)
  To: meta-arm; +Cc: Khem Raj

Enable tee and arm-ffa driver on qemuarm/qemuarm64 by default

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Rebased

 meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend

diff --git a/meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend b/meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend
new file mode 100644
index 0000000..7dec2f5
--- /dev/null
+++ b/meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend
@@ -0,0 +1,9 @@
+# enable arm_ffa regardless on 5.19
+SRC_URI:append:qemuarm = " \
+    file://tee.cfg \
+    file://arm-ffa-transport.cfg \
+"
+SRC_URI:append:qemuarm64 = " \
+    file://tee.cfg \
+    file://arm-ffa-transport.cfg \
+"
-- 
2.37.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 4/4] ffa-debugfs-mod: Exclude from world builds
  2022-09-22  0:54 [PATCH v2 1/4] optee-os: Extend clang pragma fixes to core_mmu_v7.c for 3.18 Khem Raj
  2022-09-22  0:54 ` [PATCH v2 2/4] trusted-services: Pin to use gcc Khem Raj
  2022-09-22  0:54 ` [PATCH v2 3/4] linux-yocto: Add bbappend for 5.19 Khem Raj
@ 2022-09-22  0:54 ` Khem Raj
  2022-09-23 15:31 ` [PATCH v2 1/4] optee-os: Extend clang pragma fixes to core_mmu_v7.c for 3.18 Jon Mason
  3 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2022-09-22  0:54 UTC (permalink / raw)
  To: meta-arm; +Cc: Khem Raj

It installs arm_ffa_user.h and so does arm-ffa-user recipe, lets not
build ffa-debugfs-mod in world builds since it does not appear as much
in other package dependencies as arm-ffa-user

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Rebased

 meta-arm/recipes-kernel/ffa-debugfs/ffa-debugfs-mod_2.1.0.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta-arm/recipes-kernel/ffa-debugfs/ffa-debugfs-mod_2.1.0.bb b/meta-arm/recipes-kernel/ffa-debugfs/ffa-debugfs-mod_2.1.0.bb
index 1b265a5..2b5dd64 100644
--- a/meta-arm/recipes-kernel/ffa-debugfs/ffa-debugfs-mod_2.1.0.bb
+++ b/meta-arm/recipes-kernel/ffa-debugfs/ffa-debugfs-mod_2.1.0.bb
@@ -37,3 +37,5 @@ python remove_kernel_dependency() {
   key = "RDEPENDS:kernel-module-arm-ffa-user-" + d.getVar("KERNEL_VERSION")
   d.delVar(key)
 }
+# Conflicts installing arm_ffa_user.h with arm-ffa-user recipe, lets build only one during world builds
+EXCLUDE_FROM_WORLD = "1"
-- 
2.37.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 3/4] linux-yocto: Add bbappend for 5.19
  2022-09-22  0:54 ` [PATCH v2 3/4] linux-yocto: Add bbappend for 5.19 Khem Raj
@ 2022-09-23  0:40   ` Jon Mason
  2022-09-23  1:21     ` Khem Raj
  0 siblings, 1 reply; 7+ messages in thread
From: Jon Mason @ 2022-09-23  0:40 UTC (permalink / raw)
  To: Khem Raj; +Cc: meta-arm

On Wed, Sep 21, 2022 at 05:54:08PM -0700, Khem Raj wrote:
> Enable tee and arm-ffa driver on qemuarm/qemuarm64 by default

Per Anton's comment, I don't see why this is necessary for
qemuarm/qemuarm64 by default.  Can you explain a little more please?

Aside from this, the series looks fine.

Thanks,
Jon

> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> v2: Rebased
> 
>  meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend | 9 +++++++++
>  1 file changed, 9 insertions(+)
>  create mode 100644 meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend
> 
> diff --git a/meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend b/meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend
> new file mode 100644
> index 0000000..7dec2f5
> --- /dev/null
> +++ b/meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend
> @@ -0,0 +1,9 @@
> +# enable arm_ffa regardless on 5.19
> +SRC_URI:append:qemuarm = " \
> +    file://tee.cfg \
> +    file://arm-ffa-transport.cfg \
> +"
> +SRC_URI:append:qemuarm64 = " \
> +    file://tee.cfg \
> +    file://arm-ffa-transport.cfg \
> +"
> -- 
> 2.37.3
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 3/4] linux-yocto: Add bbappend for 5.19
  2022-09-23  0:40   ` Jon Mason
@ 2022-09-23  1:21     ` Khem Raj
  0 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2022-09-23  1:21 UTC (permalink / raw)
  To: Jon Mason; +Cc: meta-arm

On Thu, Sep 22, 2022 at 8:40 PM Jon Mason <jdmason@kudzu.us> wrote:
>
> On Wed, Sep 21, 2022 at 05:54:08PM -0700, Khem Raj wrote:
> > Enable tee and arm-ffa driver on qemuarm/qemuarm64 by default
>
> Per Anton's comment, I don't see why this is necessary for
> qemuarm/qemuarm64 by default.  Can you explain a little more please?
>

since meta-arm has these kernel module recipes which fail in world
builds. We can also do it other way
where these modules are excluded from world builds and then we dont
need to enable them.

> Aside from this, the series looks fine.
>
> Thanks,
> Jon
>
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> > v2: Rebased
> >
> >  meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >  create mode 100644 meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend
> >
> > diff --git a/meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend b/meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend
> > new file mode 100644
> > index 0000000..7dec2f5
> > --- /dev/null
> > +++ b/meta-arm/recipes-kernel/linux/linux-yocto_5.19%.bbappend
> > @@ -0,0 +1,9 @@
> > +# enable arm_ffa regardless on 5.19
> > +SRC_URI:append:qemuarm = " \
> > +    file://tee.cfg \
> > +    file://arm-ffa-transport.cfg \
> > +"
> > +SRC_URI:append:qemuarm64 = " \
> > +    file://tee.cfg \
> > +    file://arm-ffa-transport.cfg \
> > +"
> > --
> > 2.37.3
> >
> >


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/4] optee-os: Extend clang pragma fixes to core_mmu_v7.c for 3.18
  2022-09-22  0:54 [PATCH v2 1/4] optee-os: Extend clang pragma fixes to core_mmu_v7.c for 3.18 Khem Raj
                   ` (2 preceding siblings ...)
  2022-09-22  0:54 ` [PATCH v2 4/4] ffa-debugfs-mod: Exclude from world builds Khem Raj
@ 2022-09-23 15:31 ` Jon Mason
  3 siblings, 0 replies; 7+ messages in thread
From: Jon Mason @ 2022-09-23 15:31 UTC (permalink / raw)
  To: meta-arm, Khem Raj

On Wed, 21 Sep 2022 17:54:06 -0700, Khem Raj wrote:
> 3.18 builds are failing since the section stuff is also done in
> core_mmu_v7.c therefore extend the patch to include this file as well

Applied, thanks!

[1/4] optee-os: Extend clang pragma fixes to core_mmu_v7.c for 3.18
      commit: 7d8b252405153ac0af5affedbe9423c993c0f483
[2/4] trusted-services: Pin to use gcc
      commit: 2c2ed8f727fa194754013dde9e8e566f2a1b7c43
[3/4] linux-yocto: Add bbappend for 5.19
      commit: 75ccc7847d8af5bfff4d6261a49530bb571d1a12
[4/4] ffa-debugfs-mod: Exclude from world builds
      commit: a0658a6682a537330f5619962504e675d7540f40

Best regards,
-- 
Jon Mason <jon.mason@arm.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-23 15:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22  0:54 [PATCH v2 1/4] optee-os: Extend clang pragma fixes to core_mmu_v7.c for 3.18 Khem Raj
2022-09-22  0:54 ` [PATCH v2 2/4] trusted-services: Pin to use gcc Khem Raj
2022-09-22  0:54 ` [PATCH v2 3/4] linux-yocto: Add bbappend for 5.19 Khem Raj
2022-09-23  0:40   ` Jon Mason
2022-09-23  1:21     ` Khem Raj
2022-09-22  0:54 ` [PATCH v2 4/4] ffa-debugfs-mod: Exclude from world builds Khem Raj
2022-09-23 15:31 ` [PATCH v2 1/4] optee-os: Extend clang pragma fixes to core_mmu_v7.c for 3.18 Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.