[XEN][PATCH] xen/arm: restrict cpu_up_send_sgi() to arm32

Grygorii Strashko posted 1 patch 2 days, 19 hours ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250911081213.1323594-1-grygorii._5Fstrashko@epam.com
xen/arch/arm/smpboot.c | 2 ++
1 file changed, 2 insertions(+)
[XEN][PATCH] xen/arm: restrict cpu_up_send_sgi() to arm32
Posted by Grygorii Strashko 2 days, 19 hours ago
From: Grygorii Strashko <grygorii_strashko@epam.com>

Restrict cpu_up_send_sgi() function to arm32 code as it's used by arm32
platforms only and unreachable on arm64 (Misra rule 2.1).

Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
---
Logically cpu_up_send_sgi() should be moved in arm32, but source is
"GPL-2.0-or-later" while possible destination is "GPL-2.0-only", so put it
under ifdef for now.

 xen/arch/arm/smpboot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 7f3cfa812edb..45f3be323687 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -464,6 +464,7 @@ static void set_smp_up_cpu(unsigned long mpidr)
 
 }
 
+#ifdef CONFIG_ARM_32
 int __init cpu_up_send_sgi(int cpu)
 {
     /* We don't know the GIC ID of the CPU until it has woken up, so just
@@ -473,6 +474,7 @@ int __init cpu_up_send_sgi(int cpu)
 
     return 0;
 }
+#endif
 
 /* Bring up a remote CPU */
 int __cpu_up(unsigned int cpu)
-- 
2.34.1
Re: [XEN][PATCH] xen/arm: restrict cpu_up_send_sgi() to arm32
Posted by Julien Grall 1 day, 5 hours ago
Hi Grygorii,

On 11/09/2025 09:12, Grygorii Strashko wrote:
> From: Grygorii Strashko <grygorii_strashko@epam.com>
> 
> Restrict cpu_up_send_sgi() function to arm32 code as it's used by arm32
> platforms only and unreachable on arm64 (Misra rule 2.1).
> 
> Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
 > ---> Logically cpu_up_send_sgi() should be moved in arm32, but source is
> "GPL-2.0-or-later" while possible destination is "GPL-2.0-only", so put it
> under ifdef for now.

:(. I don't know if we will ever solve this license mess... Looking at 
the list of platform using cpu_up_send_sgi(), all the platforms are 10+ 
years old and to be honest except maybe the rcar2 development platforms. 
I doubt there are anyone using them.

So I would be tempted to get rid of them and mandate PSCI when booting 
on Xen.

Bertrand, Michal, Stefano any thoughts?

Meanwhile for this patch:

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall
Re: [XEN][PATCH] xen/arm: restrict cpu_up_send_sgi() to arm32
Posted by Stefano Stabellini 1 day, 5 hours ago
On Fri, 12 Sep 2025, Julien Grall wrote:
> Hi Grygorii,
> 
> On 11/09/2025 09:12, Grygorii Strashko wrote:
> > From: Grygorii Strashko <grygorii_strashko@epam.com>
> > 
> > Restrict cpu_up_send_sgi() function to arm32 code as it's used by arm32
> > platforms only and unreachable on arm64 (Misra rule 2.1).
> > 
> > Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
> > ---> Logically cpu_up_send_sgi() should be moved in arm32, but source is
> > "GPL-2.0-or-later" while possible destination is "GPL-2.0-only", so put it
> > under ifdef for now.
> 
> :(. I don't know if we will ever solve this license mess... Looking at the
> list of platform using cpu_up_send_sgi(), all the platforms are 10+ years old
> and to be honest except maybe the rcar2 development platforms. I doubt there
> are anyone using them.
> 
> So I would be tempted to get rid of them and mandate PSCI when booting on Xen.
> 
> Bertrand, Michal, Stefano any thoughts?

I am OK with that.


> Meanwhile for this patch:
> 
> Acked-by: Julien Grall <jgrall@amazon.com>