mirror of https://gitlab.com/qemu-project/qemu
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
335be5bc44
In extioi_setirq() we try to operate on a bit array stored as an
array of uint32_t using the set_bit() and clear_bit() functions
by casting the pointer to 'unsigned long *'.
This has two problems:
* the alignment of 'uint32_t' is less than that of 'unsigned long'
so we pass an insufficiently aligned pointer, which is
undefined behaviour
* on big-endian hosts the 64-bit 'unsigned long' will have
its two halves the wrong way around, and we will produce
incorrect results
The undefined behaviour is shown by the clang undefined-behaviour
sanitizer when running the loongarch64-virt functional test:
/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/include/qemu/bitops.h:41:5: runtime error: store to misaligned address 0x555559745d9c for type 'unsigned long', which requires 8 byte alignment
0x555559745d9c: note: pointer points here
ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
#0 0x555556fb81c4 in set_bit /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/include/qemu/bitops.h:41:9
#1 0x555556fb81c4 in extioi_setirq /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/clang/../../hw/intc/loongarch_extioi.c:65:9
#2 0x555556fb6e90 in pch_pic_irq_handler /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/clang/../../hw/intc/loongarch_pch_pic.c:75:5
#3 0x555556710265 in serial_ioport_write /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/clang/../../hw/char/serial.c
Fix these problems by using set_bit32() and clear_bit32(),
which work with bit arrays stored as an array of uint32_t.
Cc: qemu-stable@nongnu.org
Fixes:
|
2 weeks ago | |
---|---|---|
.. | ||
Kconfig | 4 months ago | |
allwinner-a10-pic.c | 3 months ago | |
apic.c | 9 months ago | |
apic_common.c | 3 months ago | |
arm_gic.c | 3 months ago | |
arm_gic_common.c | 7 months ago | |
arm_gic_kvm.c | 1 month ago | |
arm_gicv2m.c | 4 years ago | |
arm_gicv3.c | 7 months ago | |
arm_gicv3_common.c | 7 months ago | |
arm_gicv3_cpuif.c | 2 months ago | |
arm_gicv3_cpuif_common.c | 3 years ago | |
arm_gicv3_dist.c | 7 months ago | |
arm_gicv3_its.c | 7 months ago | |
arm_gicv3_its_common.c | 7 months ago | |
arm_gicv3_its_kvm.c | 7 months ago | |
arm_gicv3_kvm.c | 7 months ago | |
arm_gicv3_redist.c | 7 months ago | |
armv7m_nvic.c | 3 months ago | |
aspeed_intc.c | 3 months ago | |
aspeed_vic.c | 3 months ago | |
bcm2835_ic.c | 3 months ago | |
bcm2836_control.c | 3 months ago | |
exynos4210_combiner.c | 3 months ago | |
exynos4210_gic.c | 3 years ago | |
gic_internal.h | 6 months ago | |
gicv3_internal.h | 7 months ago | |
goldfish_pic.c | 3 months ago | |
grlib_irqmp.c | 3 months ago | |
heathrow_pic.c | 3 months ago | |
i8259.c | 3 months ago | |
i8259_common.c | 6 months ago | |
imx_avic.c | 3 months ago | |
imx_gpcv2.c | 3 months ago | |
intc.c | ||
ioapic-stub.c | 7 months ago | |
ioapic.c | 3 months ago | |
ioapic_common.c | 6 months ago | |
ioapic_internal.h | 2 years ago | |
kvm_irqcount.c | 2 years ago | |
loongarch_extioi.c | 2 weeks ago | |
loongarch_ipi.c | 4 months ago | |
loongarch_pch_msi.c | 2 years ago | |
loongarch_pch_pic.c | 3 months ago | |
loongson_ipi.c | 3 months ago | |
loongson_ipi_common.c | 4 months ago | |
loongson_liointc.c | 1 year ago | |
m68k_irqc.c | 3 months ago | |
meson.build | 3 months ago | |
mips_gic.c | 1 year ago | |
omap_intc.c | 2 months ago | |
ompic.c | 11 months ago | |
openpic.c | 2 weeks ago | |
openpic_kvm.c | 3 months ago | |
pl190.c | 3 months ago | |
pnv_xive.c | 6 months ago | |
pnv_xive2.c | 1 month ago | |
pnv_xive2_regs.h | 4 months ago | |
pnv_xive_regs.h | 1 year ago | |
ppc-uic.c | 3 months ago | |
realview_gic.c | ||
riscv_aclint.c | 11 months ago | |
riscv_aplic.c | 1 month ago | |
riscv_imsic.c | 2 months ago | |
rx_icu.c | 11 months ago | |
s390_flic.c | 3 months ago | |
s390_flic_kvm.c | 3 months ago | |
sh_intc.c | 3 years ago | |
sifive_plic.c | 1 month ago | |
slavio_intctl.c | 3 months ago | |
spapr_xive.c | 6 months ago | |
spapr_xive_kvm.c | 1 month ago | |
trace-events | 6 months ago | |
trace.h | 4 years ago | |
vgic_common.h | ||
xics.c | 1 month ago | |
xics_kvm.c | 3 years ago | |
xics_pnv.c | 4 years ago | |
xics_spapr.c | 6 months ago | |
xilinx_intc.c | 2 years ago | |
xive.c | 1 month ago | |
xive2.c | 1 month ago | |
xlnx-pmu-iomod-intc.c | 3 months ago | |
xlnx-zynqmp-ipi.c | 3 months ago |