[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 06/32] intel_iommu: fix bug to read DMAR_RTADDR_REG
From: |
Michael S. Tsirkin |
Subject: |
[PULL v3 06/32] intel_iommu: fix bug to read DMAR_RTADDR_REG |
Date: |
Sun, 5 Jan 2020 07:57:45 -0500 |
From: Yi Sun <address@hidden>
Should directly read DMAR_RTADDR_REG but not using 's->root'.
Because 's->root' is modified in 'vtd_root_table_setup()' so
that the first 12 bits are omitted. This causes the guest
iommu debugfs cannot show pasid tables.
Signed-off-by: Yi Sun <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
---
hw/i386/intel_iommu.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 43c94b993b..ee06993675 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2610,16 +2610,15 @@ static uint64_t vtd_mem_read(void *opaque, hwaddr addr,
unsigned size)
switch (addr) {
/* Root Table Address Register, 64-bit */
case DMAR_RTADDR_REG:
+ val = vtd_get_quad_raw(s, DMAR_RTADDR_REG);
if (size == 4) {
- val = s->root & ((1ULL << 32) - 1);
- } else {
- val = s->root;
+ val = val & ((1ULL << 32) - 1);
}
break;
case DMAR_RTADDR_REG_HI:
assert(size == 4);
- val = s->root >> 32;
+ val = vtd_get_quad_raw(s, DMAR_RTADDR_REG) >> 32;
break;
/* Invalidation Queue Address Register, 64-bit */
--
MST
- [PULL v3 00/32] virtio, pci, pc: fixes, features, Michael S. Tsirkin, 2020/01/05
- [PULL v3 01/32] virtio: add ability to delete vq through a pointer, Michael S. Tsirkin, 2020/01/05
- [PULL v3 02/32] virtio: make virtio_delete_queue idempotent, Michael S. Tsirkin, 2020/01/05
- [PULL v3 03/32] virtio-balloon: fix memory leak while attach virtio-balloon device, Michael S. Tsirkin, 2020/01/05
- [PULL v3 04/32] virtio-serial-bus: fix memory leak while attach virtio-serial-bus, Michael S. Tsirkin, 2020/01/05
- [PULL v3 05/32] virtio-input: convert to new virtio_delete_queue, Michael S. Tsirkin, 2020/01/05
- [PULL v3 06/32] intel_iommu: fix bug to read DMAR_RTADDR_REG,
Michael S. Tsirkin <=
- [PULL v3 07/32] virtio: update queue size on guest write, Michael S. Tsirkin, 2020/01/05
- [PULL v3 08/32] virtio-pci: disable vring processing when bus-mastering is disabled, Michael S. Tsirkin, 2020/01/05
- [PULL v3 09/32] Implement backend program convention command for vhost-user-blk, Michael S. Tsirkin, 2020/01/05
- [PULL v3 10/32] virtio: don't enable notifications during polling, Michael S. Tsirkin, 2020/01/05
- [PULL v3 11/32] numa: Extend CLI to provide initiator information for numa nodes, Michael S. Tsirkin, 2020/01/05
- [PULL v3 12/32] numa: Extend CLI to provide memory latency and bandwidth information, Michael S. Tsirkin, 2020/01/05
- [PULL v3 13/32] numa: Extend CLI to provide memory side cache information, Michael S. Tsirkin, 2020/01/05
- [PULL v3 15/32] hmat acpi: Build System Locality Latency and Bandwidth Information Structure(s), Michael S. Tsirkin, 2020/01/05
- [PULL v3 14/32] hmat acpi: Build Memory Proximity Domain Attributes Structure(s), Michael S. Tsirkin, 2020/01/05
- [PULL v3 16/32] hmat acpi: Build Memory Side Cache Information Structure(s), Michael S. Tsirkin, 2020/01/05