[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] tools: Fix ifdef for aarch64 that should include also arm



commit 619fe8a261bf9dd2660df38bebccd43316e4167a
Author:     Luca Fancellu <luca.fancellu@xxxxxxx>
AuthorDate: Thu Jun 8 14:59:12 2023 +0100
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Tue Jul 4 20:10:20 2023 +0100

    tools: Fix ifdef for aarch64 that should include also arm
    
    Commit 56a7aaa16bfe introduced some SVE related code that is protected by
    '#if defined(__aarch64__)', the issue is that this doesn't take into
    consideration when the toolstack is compiled for an arm32 Dom0 running on
    an arm64 platform, it should be able to create SVE enabled guests but with
    the current code it's not.
    
    So fix the issue by compiling the code when the toolstack is compiled for
    both arm32 and arm64.
    
    Fixes: 56a7aaa16bfe ("tools: add physinfo arch_capabilities handling for 
Arm")
    Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
    Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Acked-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
---
 tools/include/xen-tools/arm-arch-capabilities.h | 2 +-
 tools/python/xen/lowlevel/xc/xc.c               | 2 +-
 tools/xl/xl_info.c                              | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/include/xen-tools/arm-arch-capabilities.h 
b/tools/include/xen-tools/arm-arch-capabilities.h
index 3849e89792..4aa4c6c34a 100644
--- a/tools/include/xen-tools/arm-arch-capabilities.h
+++ b/tools/include/xen-tools/arm-arch-capabilities.h
@@ -14,7 +14,7 @@
 static inline
 unsigned int arch_capabilities_arm_sve(unsigned int arch_capabilities)
 {
-#if defined(__aarch64__)
+#if defined(__arm__) || defined(__aarch64__)
     unsigned int sve_vl = MASK_EXTR(arch_capabilities,
                                     XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
 
diff --git a/tools/python/xen/lowlevel/xc/xc.c 
b/tools/python/xen/lowlevel/xc/xc.c
index 491e88977f..e14e223ec9 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -911,7 +911,7 @@ static PyObject *pyxc_physinfo(XcObject *self)
                            "hw_caps",          cpu_cap,
                            "virt_caps",        virt_caps);
 
-#if defined(__aarch64__)
+#if defined(__arm__) || defined(__aarch64__)
     if ( objret ) {
         unsigned int sve_vl_bits;
         PyObject *py_arm_sve_vl;
diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index ddc42f96b9..72e87eac46 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -226,7 +226,7 @@ static void output_physinfo(void)
         );
 
     /* Print arm SVE vector length only on ARM platforms */
-#if defined(__aarch64__)
+#if defined(__arm__) || defined(__aarch64__)
     maybe_printf("arm_sve_vector_length  : %u\n",
          arch_capabilities_arm_sve(info.arch_capabilities)
         );
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.