]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/intc: avoid byte swap fiddling in gicv3 its path
authorAlex Bennée <alex.bennee@linaro.org>
Wed, 21 Jan 2026 10:59:32 +0000 (10:59 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 22 Jan 2026 11:25:26 +0000 (11:25 +0000)
This allows us to keep the MSI data in plain host order all the way
from the MemoryRegionOps write method to the final KVM_SIGNAL_MSI
ioctl. This fixes a theoretical bug on big-endian hosts because we
were using different size byte swaps which would have truncated the data.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260121105932.135676-5-alex.bennee@linaro.org
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/intc/arm_gicv3_its_common.c
hw/intc/arm_gicv3_its_kvm.c

index 9fc51ad1e0b774f9789bbdcd81baba79483ddf45..60a5abd8d3eead5d8d981b413e2fbcaa56345121 100644 (file)
@@ -81,7 +81,7 @@ static MemTxResult gicv3_its_trans_write(void *opaque, hwaddr offset,
     if (offset == 0x0040 && ((size == 2) || (size == 4))) {
         GICv3ITSState *s = ARM_GICV3_ITS_COMMON(opaque);
         GICv3ITSCommonClass *c = ARM_GICV3_ITS_COMMON_GET_CLASS(s);
-        int ret = c->send_msi(s, le64_to_cpu(value), attrs.requester_id);
+        int ret = c->send_msi(s, value, attrs.requester_id);
 
         if (ret <= 0) {
             qemu_log_mask(LOG_GUEST_ERROR,
index ae12d41eee17bb8992705be7e31a79892a8a888b..a8d6d4fb540a96350069ec0bf7452b33de43f8d7 100644 (file)
@@ -58,7 +58,7 @@ static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint16_t devid)
 
     msi.address_lo = extract64(s->gits_translater_gpa, 0, 32);
     msi.address_hi = extract64(s->gits_translater_gpa, 32, 32);
-    msi.data = le32_to_cpu(value);
+    msi.data = value;
     msi.flags = KVM_MSI_VALID_DEVID;
     msi.devid = devid;
     memset(msi.pad, 0, sizeof(msi.pad));