[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 38/55] s390: PCI: fix IOMMU region init
From: |
Michael Roth |
Subject: |
[PATCH 38/55] s390: PCI: fix IOMMU region init |
Date: |
Tue, 5 Nov 2019 14:52:26 -0600 |
From: Matthew Rosato <address@hidden>
The fix in dbe9cf606c shrinks the IOMMU memory region to a size
that seems reasonable on the surface, however is actually too
small as it is based against a 0-mapped address space. This
causes breakage with small guests as they can overrun the IOMMU window.
Let's go back to the prior method of initializing iommu for now.
Fixes: dbe9cf606c ("s390x/pci: Set the iommu region size mpcifc request")
Cc: address@hidden
Reviewed-by: Pierre Morel <address@hidden>
Reported-by: Boris Fiuczynski <address@hidden>
Tested-by: Boris Fiuczynski <address@hidden>
Reported-by: Stefan Zimmerman <address@hidden>
Signed-off-by: Matthew Rosato <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Christian Borntraeger <address@hidden>
(cherry picked from commit 7df1dac5f1c85312474df9cb3a8fcae72303da62)
Signed-off-by: Michael Roth <address@hidden>
---
hw/s390x/s390-pci-bus.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index 2c6e084e2c..9a935f22b5 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -694,10 +694,15 @@ static const MemoryRegionOps s390_msi_ctrl_ops = {
void s390_pci_iommu_enable(S390PCIIOMMU *iommu)
{
+ /*
+ * The iommu region is initialized against a 0-mapped address space,
+ * so the smallest IOMMU region we can define runs from 0 to the end
+ * of the PCI address space.
+ */
char *name = g_strdup_printf("iommu-s390-%04x", iommu->pbdev->uid);
memory_region_init_iommu(&iommu->iommu_mr, sizeof(iommu->iommu_mr),
TYPE_S390_IOMMU_MEMORY_REGION, OBJECT(&iommu->mr),
- name, iommu->pal - iommu->pba + 1);
+ name, iommu->pal + 1);
iommu->enabled = true;
memory_region_add_subregion(&iommu->mr, 0,
MEMORY_REGION(&iommu->iommu_mr));
g_free(name);
--
2.17.1
- [PATCH 28/55] curl: Handle success in multi_check_completion, (continued)
- [PATCH 28/55] curl: Handle success in multi_check_completion, Michael Roth, 2019/11/05
- [PATCH 32/55] qcow2: Fix corruption bug in qcow2_detect_metadata_preallocation(), Michael Roth, 2019/11/05
- [PATCH 36/55] make-release: pull in edk2 submodules so we can build it from tarballs, Michael Roth, 2019/11/05
- [PATCH 27/55] curl: Report only ready sockets, Michael Roth, 2019/11/05
- [PATCH 30/55] block/qcow2: Fix corruption introduced by commit 8ac0f15f335, Michael Roth, 2019/11/05
- [PATCH 29/55] blockjob: update nodes head while removing all bdrv, Michael Roth, 2019/11/05
- [PATCH 02/55] Revert "ide/ahci: Check for -ECANCELED in aio callbacks", Michael Roth, 2019/11/05
- [PATCH 22/55] block/nfs: tear down aio before nfs_close, Michael Roth, 2019/11/05
- [PATCH 31/55] coroutine: Add qemu_co_mutex_assert_locked(), Michael Roth, 2019/11/05
- [PATCH 33/55] block/backup: fix max_transfer handling for copy_range, Michael Roth, 2019/11/05
- [PATCH 38/55] s390: PCI: fix IOMMU region init,
Michael Roth <=
- [PATCH 35/55] hw/arm/boot.c: Set NSACR.{CP11, CP10} for NS kernel boots, Michael Roth, 2019/11/05
- [PATCH 34/55] block/backup: fix backup_cow_with_offload for last cluster, Michael Roth, 2019/11/05
- [PATCH 39/55] block/snapshot: Restrict set of snapshot nodes, Michael Roth, 2019/11/05
- [PATCH 03/55] s390x/tcg: Fix VERIM with 32/64 bit elements, Michael Roth, 2019/11/05
- [PATCH 43/55] qcow2: Limit total allocation range to INT_MAX, Michael Roth, 2019/11/05
- [PATCH 44/55] iotests: Test large write request to qcow2 file, Michael Roth, 2019/11/05
- [PATCH 47/55] virtio: new post_load hook, Michael Roth, 2019/11/05
- [PATCH 07/55] xen-bus: check whether the frontend is active during device reset..., Michael Roth, 2019/11/05
- [PATCH 48/55] virtio-net: prevent offloads reset on migration, Michael Roth, 2019/11/05
- [PATCH 42/55] hw/core/loader: Fix possible crash in rom_copy(), Michael Roth, 2019/11/05