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

[xen master] x86: fix UP build with gcc14



commit a2de7dc4d845738e734b10fce6550c89c6b1092c
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Sep 4 16:09:28 2024 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Sep 4 16:09:28 2024 +0200

    x86: fix UP build with gcc14
    
    The complaint is:
    
    In file included from ././include/xen/config.h:17,
                     from <command-line>:
    arch/x86/smpboot.c: In function â??link_thread_siblings.constpropâ??:
    ./include/asm-generic/percpu.h:16:51: error: array subscript [0, 0] is 
outside array bounds of â??long unsigned int[1]â?? [-Werror=array-bounds=]
       16 |     (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
    ./include/xen/compiler.h:140:29: note: in definition of macro 
â??RELOC_HIDEâ??
      140 |     (typeof(ptr)) (__ptr + (off)); })
          |                             ^~~
    arch/x86/smpboot.c:238:27: note: in expansion of macro â??per_cpuâ??
      238 |     cpumask_set_cpu(cpu2, per_cpu(cpu_sibling_mask, cpu1));
          |                           ^~~~~~~
    In file included from ./arch/x86/include/generated/asm/percpu.h:1,
                     from ./include/xen/percpu.h:30,
                     from ./arch/x86/include/asm/cpuid.h:9,
                     from ./arch/x86/include/asm/cpufeature.h:11,
                     from ./arch/x86/include/asm/system.h:6,
                     from ./include/xen/list.h:11,
                     from ./include/xen/mm.h:68,
                     from arch/x86/smpboot.c:12:
    ./include/asm-generic/percpu.h:12:22: note: while referencing 
â??__per_cpu_offsetâ??
       12 | extern unsigned long __per_cpu_offset[NR_CPUS];
          |                      ^~~~~~~~~~~~~~~~
    
    Which I consider bogus in the first place ("array subscript [0, 0]" vs a
    1-element array). Yet taking the experience from 99f942f3d410 ("Arm64:
    adjust __irq_to_desc() to fix build with gcc14") I guessed that
    switching function parameters to unsigned int (which they should have
    been anyway) might help. And voilà ...
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/smpboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 8aa621533f..0a89f22a39 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -226,7 +226,7 @@ static int booting_cpu;
 /* CPUs for which sibling maps can be computed. */
 static cpumask_t cpu_sibling_setup_map;
 
-static void link_thread_siblings(int cpu1, int cpu2)
+static void link_thread_siblings(unsigned int cpu1, unsigned int cpu2)
 {
     cpumask_set_cpu(cpu1, per_cpu(cpu_sibling_mask, cpu2));
     cpumask_set_cpu(cpu2, per_cpu(cpu_sibling_mask, cpu1));
--
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®.