diff options
| -rw-r--r-- | recipes-extended/xen/files/0001-arm-silence-gcc14-warning-error-on-irq-bounds-check.patch | 68 | ||||
| -rw-r--r-- | recipes-extended/xen/xen_4.18.bb | 1 |
2 files changed, 69 insertions, 0 deletions
diff --git a/recipes-extended/xen/files/0001-arm-silence-gcc14-warning-error-on-irq-bounds-check.patch b/recipes-extended/xen/files/0001-arm-silence-gcc14-warning-error-on-irq-bounds-check.patch new file mode 100644 index 00000000..a3dbbbb4 --- /dev/null +++ b/recipes-extended/xen/files/0001-arm-silence-gcc14-warning-error-on-irq-bounds-check.patch | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | From 2258853a19b2d0b1fafd901cddf69f730c38d450 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
| 3 | Date: Fri, 31 May 2024 14:50:33 +0000 | ||
| 4 | Subject: [PATCH] arm: silence gcc14 warning (error) on irq bounds check | ||
| 5 | |||
| 6 | While we wait for upstream to update to gcc14, we add a quick | ||
| 7 | check to avoid gcc14 not being able to confirm that IRQ is | ||
| 8 | greater than 0 and hence throws a warning, which leads to an | ||
| 9 | error. | ||
| 10 | |||
| 11 | | In function '__irq_to_desc', | ||
| 12 | | inlined from 'route_irq_to_guest' at arch/arm/irq.c:467:12: | ||
| 13 | | arch/arm/irq.c:65:16: error: array subscript -2 is below array bounds of 'irq_desc_t[32]' {aka 'struct irq_desc[32]'} [-Werror=array-bounds=] | ||
| 14 | | 65 | return &this_cpu(local_irq_desc)[irq]; | ||
| 15 | | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 16 | |||
| 17 | Upstream-Status: Pending [the xen folks understand the code and the right fix .. I don't] | ||
| 18 | |||
| 19 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
| 20 | --- | ||
| 21 | xen/arch/arm/irq.c | 19 ++++++++++++------- | ||
| 22 | 1 file changed, 12 insertions(+), 7 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c | ||
| 25 | index ae69fb4aeb..dcac86bd84 100644 | ||
| 26 | --- a/xen/arch/arm/irq.c | ||
| 27 | +++ b/xen/arch/arm/irq.c | ||
| 28 | @@ -58,8 +58,13 @@ hw_irq_controller no_irq_type = { | ||
| 29 | static irq_desc_t irq_desc[NR_IRQS]; | ||
| 30 | static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc); | ||
| 31 | |||
| 32 | + | ||
| 33 | struct irq_desc *__irq_to_desc(int irq) | ||
| 34 | { | ||
| 35 | + /* silence gcc14 warning */ | ||
| 36 | + if ( irq < 0 ) | ||
| 37 | + return &this_cpu(local_irq_desc)[0]; | ||
| 38 | + | ||
| 39 | if ( irq < NR_LOCAL_IRQS ) | ||
| 40 | return &this_cpu(local_irq_desc)[irq]; | ||
| 41 | |||
| 42 | @@ -723,16 +728,16 @@ int platform_get_irq(const struct dt_device_node *device, int index) | ||
| 43 | |||
| 44 | int platform_get_irq_byname(const struct dt_device_node *np, const char *name) | ||
| 45 | { | ||
| 46 | - int index; | ||
| 47 | + int index; | ||
| 48 | |||
| 49 | - if ( unlikely(!name) ) | ||
| 50 | - return -EINVAL; | ||
| 51 | + if ( unlikely(!name) ) | ||
| 52 | + return -EINVAL; | ||
| 53 | |||
| 54 | - index = dt_property_match_string(np, "interrupt-names", name); | ||
| 55 | - if ( index < 0 ) | ||
| 56 | - return index; | ||
| 57 | + index = dt_property_match_string(np, "interrupt-names", name); | ||
| 58 | + if ( index < 0 ) | ||
| 59 | + return index; | ||
| 60 | |||
| 61 | - return platform_get_irq(np, index); | ||
| 62 | + return platform_get_irq(np, index); | ||
| 63 | } | ||
| 64 | |||
| 65 | /* | ||
| 66 | -- | ||
| 67 | 2.39.2 | ||
| 68 | |||
diff --git a/recipes-extended/xen/xen_4.18.bb b/recipes-extended/xen/xen_4.18.bb index 4f235bd3..d0b19013 100644 --- a/recipes-extended/xen/xen_4.18.bb +++ b/recipes-extended/xen/xen_4.18.bb | |||
| @@ -7,6 +7,7 @@ XEN_BRANCH ?= "stable-4.18" | |||
| 7 | SRC_URI = " \ | 7 | SRC_URI = " \ |
| 8 | git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ | 8 | git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ |
| 9 | file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \ | 9 | file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \ |
| 10 | file://0001-arm-silence-gcc14-warning-error-on-irq-bounds-check.patch \ | ||
| 10 | " | 11 | " |
| 11 | 12 | ||
| 12 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" | 13 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" |
