[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 11/34] intel_iommu: fix several incorrect endianes
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 11/34] intel_iommu: fix several incorrect endianess and bit fields |
Date: |
Fri, 11 Nov 2016 20:10:38 +0200 |
From: Peter Xu <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/i386/intel_iommu.h | 9 ++++-----
hw/i386/intel_iommu.c | 2 +-
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h
index 1989c1e..405c9d1 100644
--- a/include/hw/i386/intel_iommu.h
+++ b/include/hw/i386/intel_iommu.h
@@ -123,7 +123,6 @@ enum {
union VTD_IR_TableEntry {
struct {
#ifdef HOST_WORDS_BIGENDIAN
- uint32_t dest_id:32; /* Destination ID */
uint32_t __reserved_1:8; /* Reserved 1 */
uint32_t vector:8; /* Interrupt Vector */
uint32_t irte_mode:1; /* IRTE Mode */
@@ -147,9 +146,9 @@ union VTD_IR_TableEntry {
uint32_t irte_mode:1; /* IRTE Mode */
uint32_t vector:8; /* Interrupt Vector */
uint32_t __reserved_1:8; /* Reserved 1 */
- uint32_t dest_id:32; /* Destination ID */
#endif
- uint16_t source_id:16; /* Source-ID */
+ uint32_t dest_id; /* Destination ID */
+ uint16_t source_id; /* Source-ID */
#ifdef HOST_WORDS_BIGENDIAN
uint64_t __reserved_2:44; /* Reserved 2 */
uint64_t sid_vtype:2; /* Source-ID Validation Type */
@@ -220,7 +219,7 @@ struct VTD_MSIMessage {
uint32_t dest:8;
uint32_t __addr_head:12; /* 0xfee */
#endif
- uint32_t __addr_hi:32;
+ uint32_t __addr_hi;
} QEMU_PACKED;
uint64_t msi_addr;
};
@@ -239,7 +238,7 @@ struct VTD_MSIMessage {
uint16_t level:1;
uint16_t trigger_mode:1;
#endif
- uint16_t __resved1:16;
+ uint16_t __resved1;
} QEMU_PACKED;
uint32_t msi_data;
};
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 5a12ae7..20c4d2c 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2180,7 +2180,7 @@ static int vtd_interrupt_remap_msi(IntelIOMMUState *iommu,
}
addr.data = origin->address & VTD_MSI_ADDR_LO_MASK;
- if (le16_to_cpu(addr.addr.__head) != 0xfee) {
+ if (addr.addr.__head != 0xfee) {
VTD_DPRINTF(GENERAL, "error: MSI addr low 32 bits invalid: "
"0x%"PRIx32, addr.data);
return -VTD_FR_IR_REQ_RSVD;
--
MST
- [Qemu-devel] [PULL v2 00/34] virtio, vhost, pc, pci: tests, documentation, fixes and cleanups, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 01/34] tests/vhost-user-bridge: remove false comment, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 02/34] tests/vhost-user-bridge: remove unnecessary dispatcher_remove, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 03/34] tests/vhost-user-bridge: indicate peer disconnected, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 04/34] tests/vhost-user-bridge: do not accept more than one connection, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 05/34] contrib: add libvhost-user, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 06/34] tests/vhost-user-bridge: use contrib/libvhost-user, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 08/34] virtio: rename virtqueue_discard to virtqueue_unpop, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 07/34] intel_iommu: fixing source id during IOTLB hash key calculation, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 11/34] intel_iommu: fix several incorrect endianess and bit fields,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 09/34] virtio: make virtqueue_alloc_element static, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 12/34] intel_iommu: fix incorrect assert, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 10/34] virtio-crypto: tag as not hotpluggable and migration, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 13/34] acpi: fix DMAR device scope for IOAPIC, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 15/34] virtio-net: mark VIRTIO_NET_F_GSO as legacy, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 14/34] virtio: allow per-device-class legacy features, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 16/34] vhost: migration blocker only if shared log is used, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 17/34] qdev: hotplug: drop HotplugHandler.post_plug callback, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 18/34] nvdimm acpi: drop the lock of fit buffer, Michael S. Tsirkin, 2016/11/11
- [Qemu-devel] [PULL v2 19/34] pc: memhp: move nvdimm hotplug out of memory hotplug, Michael S. Tsirkin, 2016/11/11