Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218903/?format=api
{ "id": 2218903, "url": "http://patchwork.ozlabs.org/api/patches/2218903/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260402022921.298818-4-kshk@linux.ibm.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260402022921.298818-4-kshk@linux.ibm.com>", "list_archive_url": null, "date": "2026-04-02T02:29:09", "name": "[03/15] s390x/pci: Move iommu_mr from S390PCIIOMMU to S390PCIBusDevice", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "01a882f380c6552e9a01ed4214b3bff3c2cea9e2", "submitter": { "id": 90249, "url": "http://patchwork.ozlabs.org/api/people/90249/?format=api", "name": "Konstantin Shkolnyy", "email": "kshk@linux.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260402022921.298818-4-kshk@linux.ibm.com/mbox/", "series": [ { "id": 498419, "url": "http://patchwork.ozlabs.org/api/series/498419/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=498419", "date": "2026-04-02T02:29:08", "name": "s390x/pci: Implement migration for emulated devices", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498419/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2218903/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218903/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=FnMFAhkF;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmQq53Lzzz1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 13:32:01 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w87pE-0004XZ-6O; Wed, 01 Apr 2026 22:30:28 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <kshk@linux.ibm.com>)\n id 1w87op-0004DJ-Ks; Wed, 01 Apr 2026 22:30:03 -0400", "from mx0a-001b2d01.pphosted.com ([148.163.156.1])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <kshk@linux.ibm.com>)\n id 1w87om-0001kY-Rq; Wed, 01 Apr 2026 22:30:03 -0400", "from pps.filterd (m0360083.ppops.net [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 631LvR46442944; Thu, 2 Apr 2026 02:29:56 GMT", "from ppma23.wdc07v.mail.ibm.com\n (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4d66g231p9-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 02 Apr 2026 02:29:56 +0000 (GMT)", "from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1])\n by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id\n 6320ucSm014339;\n Thu, 2 Apr 2026 02:29:55 GMT", "from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69])\n by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4d6ttkr8e9-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 02 Apr 2026 02:29:55 +0000", "from smtpav06.wdc07v.mail.ibm.com (smtpav06.wdc07v.mail.ibm.com\n [10.39.53.233])\n by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 6322Trxe21103300\n (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Thu, 2 Apr 2026 02:29:53 GMT", "from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id AF562580F6;\n Thu, 2 Apr 2026 02:29:53 +0000 (GMT)", "from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 26B34580F7;\n Thu, 2 Apr 2026 02:29:53 +0000 (GMT)", "from WIN-DU0DFC9G5VV.ibm.com (unknown [9.61.247.119])\n by smtpav06.wdc07v.mail.ibm.com (Postfix) with ESMTP;\n Thu, 2 Apr 2026 02:29:53 +0000 (GMT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc\n :content-transfer-encoding:date:from:in-reply-to:message-id\n :mime-version:references:subject:to; s=pp1; bh=ly2hzpXgYbTYrZj8D\n bO63eeObMuKcn/h4P7ZlxoyJuE=; b=FnMFAhkFiRBWRPi3SaLj44mEGQIYeTHZq\n ppb7PJSfQO4lkSNalwi/mtwx9BKXwRtWZc77s1UQHiX9n1+W9/v/JyHnwQAauMzt\n FInS+PSERee7g/VZA25yTz59ZfpryNQWckHgJDuLnFMVU5nZfYPucQaJ0SpMHfFA\n 9hiIrvrmb3ucgGqj5YEqpZuaGfoUBRlc9O/6BnvvqsBZMOP+Qwlq6/NfO9zcDsDU\n wsRcswFb2MIFy42/2M3YNBXf1djSGoMzH0NWl+8bbi8gS1RExyc3cQ8ROv+PJlrP\n e6NyH6v1IrBWV+aD3FZuby/4zMWdH0mC+ncByP1xILKaUXSIBsPsw==", "From": "Konstantin Shkolnyy <kshk@linux.ibm.com>", "To": "mjrosato@linux.ibm.com", "Cc": "alifm@linux.ibm.com, richard.henderson@linaro.org, iii@linux.ibm.com,\n david@kernel.org, cohuck@redhat.com, pasic@linux.ibm.com,\n borntraeger@linux.ibm.com, qemu-s390x@nongnu.org,\n qemu-devel@nongnu.org, Konstantin Shkolnyy <kshk@linux.ibm.com>", "Subject": "[PATCH 03/15] s390x/pci: Move iommu_mr from S390PCIIOMMU to\n S390PCIBusDevice", "Date": "Wed, 1 Apr 2026 21:29:09 -0500", "Message-Id": "<20260402022921.298818-4-kshk@linux.ibm.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20260402022921.298818-1-kshk@linux.ibm.com>", "References": "<20260402022921.298818-1-kshk@linux.ibm.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-TM-AS-GCONF": "00", "X-Authority-Analysis": "v=2.4 cv=Fdo6BZ+6 c=1 sm=1 tr=0 ts=69cdd4a4 cx=c_pps\n a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17\n a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22\n a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=n4sMxHAKvM-efvCv8lMA:9", "X-Proofpoint-ORIG-GUID": "6AC921ZdaLDSUyJ8E_ZwOZTUU9Ncf49K", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDAyMDAxOSBTYWx0ZWRfX6g+TaKFU3sH3\n LxqJCiZJTl7W5Qrsym8T0DeBIC9z17Hr8CyTu+eQUlB4ub6SipS7rD26V3nqTWYnVxTXXEyxiZH\n 1NjopxQgcOv2bc+l45JgUDX3fkrKRIYH0HpUZHMcpxNIFB0N0eNVL+lqOgyLpkRld50bzVemo9b\n L6hI8r7QAXxP8m7+a0jL14ELoK8MkMaMjKGbJSBJU3WdjhBgSiamuvbi40aKbXjCuZaFYjcq/iO\n 5lmir5JEgTBx2yaaEwdewU/6O2FCVf6i+9EmCeJsp8sZ4uPHVNIulB6Uas2CPTU3xJTqtob1G3Z\n ktRRmxJxqswAGdmaV4WFccv0bAK/22HHcCpuvvjVQGQR/aPpWkETYKjYb0z0x+TN2iG17tO8qcd\n 7TexKYcj1XDHnOq2kQdHSTRYXD8pv+2U0LLq0kS9AxpjnKLCMHvfyxDtwiG2v1FvYz7RFbtmiP7\n RGD7IK+LA8VbxhqwvmA==", "X-Proofpoint-GUID": "6AC921ZdaLDSUyJ8E_ZwOZTUU9Ncf49K", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-01_05,2026-04-01_02,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n impostorscore=0 clxscore=1011 bulkscore=0 suspectscore=0 priorityscore=1501\n adultscore=0 malwarescore=0 phishscore=0 spamscore=0 lowpriorityscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2604020019", "Received-SPF": "pass client-ip=148.163.156.1; envelope-from=kshk@linux.ibm.com;\n helo=mx0a-001b2d01.pphosted.com", "X-Spam_score_int": "-6", "X-Spam_score": "-0.7", "X-Spam_bar": "/", "X-Spam_report": "(-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\n RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "This field is only used when S390PCIBusDevice exists, so it can be moved\nthere to simplify S390PCIIOMMU which purpose is just to store the \"root\"\nAddressSpace.\n\nSigned-off-by: Konstantin Shkolnyy <kshk@linux.ibm.com>\n---\n hw/s390x/s390-pci-bus.c | 32 ++++++++++++++++++--------------\n hw/s390x/s390-pci-inst.c | 28 +++++++++++++++-------------\n include/hw/s390x/s390-pci-bus.h | 6 +++---\n include/hw/s390x/s390-pci-inst.h | 4 ++--\n 4 files changed, 38 insertions(+), 32 deletions(-)", "diff": "diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c\nindex 3665aba106..99d503e85e 100644\n--- a/hw/s390x/s390-pci-bus.c\n+++ b/hw/s390x/s390-pci-bus.c\n@@ -206,7 +206,7 @@ void s390_pci_sclp_deconfigure(SCCB *sccb)\n pci_dereg_irqs(pbdev);\n }\n if (pbdev->iommu->enabled) {\n- pci_dereg_ioat(pbdev->iommu);\n+ pci_dereg_ioat(pbdev);\n }\n pbdev->state = ZPCI_FS_STANDBY;\n rc = SCLP_RC_NORMAL_COMPLETION;\n@@ -538,7 +538,8 @@ uint16_t s390_guest_io_table_walk(uint64_t g_iota, hwaddr addr,\n static IOMMUTLBEntry s390_translate_iommu(IOMMUMemoryRegion *mr, hwaddr addr,\n IOMMUAccessFlags flag, int iommu_idx)\n {\n- S390PCIIOMMU *iommu = container_of(mr, S390PCIIOMMU, iommu_mr);\n+ S390PCIBusDevice *pbdev = container_of(mr, S390PCIBusDevice, iommu_mr);\n+ S390PCIIOMMU *iommu = pbdev->iommu;\n S390IOTLBEntry *entry;\n uint64_t iova = addr & TARGET_PAGE_MASK;\n uint16_t error = 0;\n@@ -592,12 +593,13 @@ err:\n return ret;\n }\n \n-static void s390_pci_ioat_replay(S390PCIIOMMU *iommu)\n+static void s390_pci_ioat_replay(S390PCIBusDevice *pbdev)\n {\n S390IOTLBEntry entry;\n uint16_t error = 0;\n uint32_t dma_avail;\n hwaddr curr, end;\n+ S390PCIIOMMU *iommu = pbdev->iommu;\n \n curr = iommu->pba;\n end = iommu->pal;\n@@ -622,7 +624,7 @@ static void s390_pci_ioat_replay(S390PCIIOMMU *iommu)\n \n if (entry.perm != IOMMU_NONE) {\n if (dma_avail > 0) {\n- dma_avail = s390_pci_update_iotlb(iommu, &entry);\n+ dma_avail = s390_pci_update_iotlb(pbdev, &entry);\n } else {\n error_report(\"DMA mappings exhausted: iommu remap failed\");\n return;\n@@ -635,9 +637,9 @@ static void s390_pci_ioat_replay(S390PCIIOMMU *iommu)\n static void s390_pci_iommu_replay(IOMMUMemoryRegion *mr,\n IOMMUNotifier *notifier)\n {\n- S390PCIIOMMU *iommu = container_of(mr, S390PCIIOMMU, iommu_mr);\n+ S390PCIBusDevice *pbdev = container_of(mr, S390PCIBusDevice, iommu_mr);\n \n- s390_pci_ioat_replay(iommu);\n+ s390_pci_ioat_replay(pbdev);\n }\n \n static S390PCIIOMMU *s390_pci_get_iommu(S390pciState *s, PCIBus *bus,\n@@ -759,19 +761,20 @@ static const MemoryRegionOps s390_msi_ctrl_ops = {\n .endianness = DEVICE_LITTLE_ENDIAN,\n };\n \n-void s390_pci_iommu_enable(S390PCIIOMMU *iommu)\n+void s390_pci_iommu_enable(S390PCIBusDevice *pbdev)\n {\n+ S390PCIIOMMU *iommu = pbdev->iommu;\n /*\n * The iommu region is initialized against a 0-mapped address space,\n * so the smallest IOMMU region we can define runs from 0 to the end\n * of the PCI address space.\n */\n char *name = g_strdup_printf(\"iommu-s390-%04x\", iommu->pbdev->uid);\n- memory_region_init_iommu(&iommu->iommu_mr, sizeof(iommu->iommu_mr),\n+ memory_region_init_iommu(&pbdev->iommu_mr, sizeof(pbdev->iommu_mr),\n TYPE_S390_IOMMU_MEMORY_REGION, OBJECT(&iommu->mr),\n name, iommu->pal + 1);\n iommu->enabled = true;\n- memory_region_add_subregion(&iommu->mr, 0, MEMORY_REGION(&iommu->iommu_mr));\n+ memory_region_add_subregion(&iommu->mr, 0, MEMORY_REGION(&pbdev->iommu_mr));\n g_free(name);\n }\n \n@@ -797,8 +800,9 @@ void s390_pci_iommu_direct_map_enable(S390PCIIOMMU *iommu)\n iommu->dm_mr);\n }\n \n-void s390_pci_iommu_disable(S390PCIIOMMU *iommu)\n+void s390_pci_iommu_disable(S390PCIBusDevice *pbdev)\n {\n+ S390PCIIOMMU *iommu = pbdev->iommu;\n iommu->enabled = false;\n g_hash_table_remove_all(iommu->iotlb);\n if (iommu->dm_mr) {\n@@ -808,8 +812,8 @@ void s390_pci_iommu_disable(S390PCIIOMMU *iommu)\n iommu->dm_mr = NULL;\n } else {\n memory_region_del_subregion(&iommu->mr,\n- MEMORY_REGION(&iommu->iommu_mr));\n- object_unparent(OBJECT(&iommu->iommu_mr));\n+ MEMORY_REGION(&pbdev->iommu_mr));\n+ object_unparent(OBJECT(&pbdev->iommu_mr));\n }\n }\n \n@@ -1408,7 +1412,7 @@ static void s390_pcihost_reset(DeviceState *dev)\n pci_dereg_irqs(pbdev);\n }\n if (pbdev->iommu->enabled) {\n- pci_dereg_ioat(pbdev->iommu);\n+ pci_dereg_ioat(pbdev);\n }\n pbdev->state = ZPCI_FS_STANDBY;\n s390_pci_perform_unplug(pbdev);\n@@ -1549,7 +1553,7 @@ static void s390_pci_device_reset(DeviceState *dev)\n pci_dereg_irqs(pbdev);\n }\n if (pbdev->iommu->enabled) {\n- pci_dereg_ioat(pbdev->iommu);\n+ pci_dereg_ioat(pbdev);\n }\n \n fmb_timer_free(pbdev);\ndiff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c\nindex 7c784b31f3..ed60e6100e 100644\n--- a/hw/s390x/s390-pci-inst.c\n+++ b/hw/s390x/s390-pci-inst.c\n@@ -613,9 +613,10 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra)\n return 0;\n }\n \n-uint32_t s390_pci_update_iotlb(S390PCIIOMMU *iommu,\n+uint32_t s390_pci_update_iotlb(S390PCIBusDevice *pbdev,\n S390IOTLBEntry *entry)\n {\n+ S390PCIIOMMU *iommu = pbdev->iommu;\n S390IOTLBEntry *cache = g_hash_table_lookup(iommu->iotlb, &entry->iova);\n IOMMUTLBEvent event = {\n .type = entry->perm ? IOMMU_NOTIFIER_MAP : IOMMU_NOTIFIER_UNMAP,\n@@ -645,7 +646,7 @@ uint32_t s390_pci_update_iotlb(S390PCIIOMMU *iommu,\n \n event.type = IOMMU_NOTIFIER_UNMAP;\n event.entry.perm = IOMMU_NONE;\n- memory_region_notify_iommu(&iommu->iommu_mr, 0, event);\n+ memory_region_notify_iommu(&pbdev->iommu_mr, 0, event);\n event.type = IOMMU_NOTIFIER_MAP;\n event.entry.perm = entry->perm;\n }\n@@ -663,13 +664,13 @@ uint32_t s390_pci_update_iotlb(S390PCIIOMMU *iommu,\n * All associated iotlb entries have already been cleared, trigger the\n * unmaps.\n */\n- memory_region_notify_iommu(&iommu->iommu_mr, 0, event);\n+ memory_region_notify_iommu(&pbdev->iommu_mr, 0, event);\n \n out:\n return iommu->dma_limit ? iommu->dma_limit->avail : 1;\n }\n \n-static void s390_pci_batch_unmap(S390PCIIOMMU *iommu, uint64_t iova,\n+static void s390_pci_batch_unmap(S390PCIBusDevice *pbdev, uint64_t iova,\n uint64_t len)\n {\n uint64_t remain = len, start = iova, end = start + len - 1, mask, size;\n@@ -687,7 +688,7 @@ static void s390_pci_batch_unmap(S390PCIIOMMU *iommu, uint64_t iova,\n size = mask + 1;\n event.entry.iova = start;\n event.entry.addr_mask = mask;\n- memory_region_notify_iommu(&iommu->iommu_mr, 0, event);\n+ memory_region_notify_iommu(&pbdev->iommu_mr, 0, event);\n start += size;\n remain -= size;\n }\n@@ -778,14 +779,14 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra)\n coalesce += entry.len;\n } else if (coalesce > 0) {\n /* Unleash the coalesced unmap before processing a new map */\n- s390_pci_batch_unmap(iommu, iova, coalesce);\n+ s390_pci_batch_unmap(pbdev, iova, coalesce);\n coalesce = 0;\n }\n \n start += entry.len;\n while (entry.iova < start && entry.iova < end) {\n if (dma_avail > 0 || entry.perm == IOMMU_NONE) {\n- dma_avail = s390_pci_update_iotlb(iommu, &entry);\n+ dma_avail = s390_pci_update_iotlb(pbdev, &entry);\n entry.iova += TARGET_PAGE_SIZE;\n entry.translated_addr += TARGET_PAGE_SIZE;\n } else {\n@@ -801,7 +802,7 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra)\n }\n if (coalesce) {\n /* Unleash the coalesced unmap before finishing rpcit */\n- s390_pci_batch_unmap(iommu, iova, coalesce);\n+ s390_pci_batch_unmap(pbdev, iova, coalesce);\n coalesce = 0;\n }\n if (again && dma_avail > 0)\n@@ -1031,7 +1032,7 @@ static int reg_ioat(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib fib,\n iommu->g_iota = g_iota;\n \n if (t) {\n- s390_pci_iommu_enable(iommu);\n+ s390_pci_iommu_enable(pbdev);\n } else {\n s390_pci_iommu_direct_map_enable(iommu);\n }\n@@ -1039,9 +1040,10 @@ static int reg_ioat(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib fib,\n return 0;\n }\n \n-void pci_dereg_ioat(S390PCIIOMMU *iommu)\n+void pci_dereg_ioat(S390PCIBusDevice *pbdev)\n {\n- s390_pci_iommu_disable(iommu);\n+ S390PCIIOMMU *iommu = pbdev->iommu;\n+ s390_pci_iommu_disable(pbdev);\n iommu->pba = 0;\n iommu->pal = 0;\n iommu->g_iota = 0;\n@@ -1265,7 +1267,7 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,\n cc = ZPCI_PCI_LS_ERR;\n s390_set_status_code(env, r1, ZPCI_MOD_ST_SEQUENCE);\n } else {\n- pci_dereg_ioat(pbdev->iommu);\n+ pci_dereg_ioat(pbdev);\n }\n break;\n case ZPCI_MOD_FC_REREG_IOAT:\n@@ -1276,7 +1278,7 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,\n cc = ZPCI_PCI_LS_ERR;\n s390_set_status_code(env, r1, ZPCI_MOD_ST_SEQUENCE);\n } else {\n- pci_dereg_ioat(pbdev->iommu);\n+ pci_dereg_ioat(pbdev);\n if (reg_ioat(env, pbdev, fib, ra)) {\n cc = ZPCI_PCI_LS_ERR;\n s390_set_status_code(env, r1, ZPCI_MOD_ST_INSUF_RES);\ndiff --git a/include/hw/s390x/s390-pci-bus.h b/include/hw/s390x/s390-pci-bus.h\nindex eb15cb8b2d..a71f562dfc 100644\n--- a/include/hw/s390x/s390-pci-bus.h\n+++ b/include/hw/s390x/s390-pci-bus.h\n@@ -276,7 +276,6 @@ struct S390PCIIOMMU {\n S390PCIBusDevice *pbdev;\n AddressSpace as;\n MemoryRegion mr;\n- IOMMUMemoryRegion iommu_mr;\n MemoryRegion *dm_mr;\n bool enabled;\n uint64_t g_iota;\n@@ -354,6 +353,7 @@ struct S390PCIBusDevice {\n S390MsixInfo msix;\n AdapterRoutes routes;\n S390PCIIOMMU *iommu;\n+ IOMMUMemoryRegion iommu_mr;\n MemoryRegion msix_notify_mr;\n IndAddr *summary_ind;\n IndAddr *indicator;\n@@ -391,9 +391,9 @@ int pci_chsc_sei_nt2_have_event(void);\n void s390_pci_sclp_configure(SCCB *sccb);\n void s390_pci_sclp_deconfigure(SCCB *sccb);\n bool s390_pci_is_translation_enabled(uint64_t g_iota);\n-void s390_pci_iommu_enable(S390PCIIOMMU *iommu);\n+void s390_pci_iommu_enable(S390PCIBusDevice *pbdev);\n void s390_pci_iommu_direct_map_enable(S390PCIIOMMU *iommu);\n-void s390_pci_iommu_disable(S390PCIIOMMU *iommu);\n+void s390_pci_iommu_disable(S390PCIBusDevice *pbdev);\n void s390_pci_generate_error_event(uint16_t pec, uint32_t fh, uint32_t fid,\n uint64_t faddr, uint32_t e);\n uint16_t s390_guest_io_table_walk(uint64_t g_iota, hwaddr addr,\ndiff --git a/include/hw/s390x/s390-pci-inst.h b/include/hw/s390x/s390-pci-inst.h\nindex c782990e3b..38268c256e 100644\n--- a/include/hw/s390x/s390-pci-inst.h\n+++ b/include/hw/s390x/s390-pci-inst.h\n@@ -99,7 +99,7 @@ typedef struct ZpciFib {\n } QEMU_PACKED ZpciFib;\n \n int pci_dereg_irqs(S390PCIBusDevice *pbdev);\n-void pci_dereg_ioat(S390PCIIOMMU *iommu);\n+void pci_dereg_ioat(S390PCIBusDevice *pbdev);\n int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_t ra);\n int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra);\n int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra);\n@@ -111,7 +111,7 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,\n int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,\n uintptr_t ra);\n void fmb_timer_free(S390PCIBusDevice *pbdev);\n-uint32_t s390_pci_update_iotlb(S390PCIIOMMU *iommu, S390IOTLBEntry *entry);\n+uint32_t s390_pci_update_iotlb(S390PCIBusDevice *pbdev, S390IOTLBEntry *entry);\n \n #define ZPCI_IO_BAR_MIN 0\n #define ZPCI_IO_BAR_MAX 5\n", "prefixes": [ "03/15" ] }