[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/12] s390: PCI: fix IOMMU region init
From: |
Christian Borntraeger |
Subject: |
[PULL 02/12] s390: PCI: fix IOMMU region init |
Date: |
Mon, 30 Sep 2019 15:19:45 +0200 |
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>
---
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 963a41c7f532..2d2f4a7c419c 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -695,10 +695,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.21.0
- [PULL 00/12] s390x qemu updates 20190930, Christian Borntraeger, 2019/09/30
- [PULL 01/12] MAINTAINERS: Update S390 PCI Maintainer, Christian Borntraeger, 2019/09/30
- [PULL 08/12] kvm: extract kvm_log_clear_one_slot, Christian Borntraeger, 2019/09/30
- [PULL 02/12] s390: PCI: fix IOMMU region init,
Christian Borntraeger <=
- [PULL 03/12] s390x: sclp: refactor invalid command check, Christian Borntraeger, 2019/09/30
- [PULL 07/12] configure: Remove s390 (31-bit mode) from the list of supported CPUs, Christian Borntraeger, 2019/09/30
- [PULL 09/12] kvm: clear dirty bitmaps from all overlapping memslots, Christian Borntraeger, 2019/09/30
- [PULL 05/12] s390x: sclp: fix error handling for oversize control blocks, Christian Borntraeger, 2019/09/30
- [PULL 12/12] s390/kvm: split kvm mem slots at 4TB, Christian Borntraeger, 2019/09/30
- [PULL 11/12] s390: do not call memory_region_allocate_system_memory() multiple times, Christian Borntraeger, 2019/09/30
- [PULL 06/12] s390x: sclp: Report insufficient SCCB length, Christian Borntraeger, 2019/09/30
- [PULL 04/12] s390x: sclp: boundary check, Christian Borntraeger, 2019/09/30
- [PULL 10/12] kvm: split too big memory section on several memslots, Christian Borntraeger, 2019/09/30