Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2222256/?format=api
{ "id": 2222256, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2222256/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260411022618.2136588-2-kshk@linux.ibm.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.1/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": "" }, "msgid": "<20260411022618.2136588-2-kshk@linux.ibm.com>", "date": "2026-04-11T02:26:04", "name": "[v2,01/15] s390x/pci: implement IOMMU replay", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "6ca16d13812fc7b6c232aab86a77323dce7558b5", "submitter": { "id": 90249, "url": "http://patchwork.ozlabs.org/api/1.1/people/90249/?format=api", "name": "Konstantin Shkolnyy", "email": "kshk@linux.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260411022618.2136588-2-kshk@linux.ibm.com/mbox/", "series": [ { "id": 499525, "url": "http://patchwork.ozlabs.org/api/1.1/series/499525/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=499525", "date": "2026-04-11T02:26:13", "name": "s390x/pci: Implement migration for emulated devices", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/499525/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2222256/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2222256/checks/", "tags": {}, "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=juDkDG6S;\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 (lists1p.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 4fsyK75S2Nz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 12:28:43 +1000 (AEST)", "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 1wBO3s-000239-Kj; Fri, 10 Apr 2026 22:27:04 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.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 1wBO3r-00021X-1w; Fri, 10 Apr 2026 22:27:03 -0400", "from mx0b-001b2d01.pphosted.com ([148.163.158.5])\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 1wBO3o-0000LV-EG; Fri, 10 Apr 2026 22:27:01 -0400", "from pps.filterd (m0353725.ppops.net [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63B2PANr2382161; Sat, 11 Apr 2026 02:26:54 GMT", "from ppma12.dal12v.mail.ibm.com\n (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dfcqer35y-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Sat, 11 Apr 2026 02:26:54 +0000 (GMT)", "from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1])\n by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id\n 63B18fQL026665;\n Sat, 11 Apr 2026 02:26:53 GMT", "from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4])\n by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4dcmg8ayxd-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Sat, 11 Apr 2026 02:26:53 +0000", "from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com\n [10.39.53.230])\n by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 63B2QqFx31392440\n (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Sat, 11 Apr 2026 02:26:52 GMT", "from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 1798F5805A;\n Sat, 11 Apr 2026 02:26:52 +0000 (GMT)", "from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 7CF7058054;\n Sat, 11 Apr 2026 02:26:51 +0000 (GMT)", "from WIN-DU0DFC9G5VV.ibm.com (unknown [9.61.252.248])\n by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP;\n Sat, 11 Apr 2026 02:26:51 +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=zP+6BKHqwiPV9Z25t\n enrM6T/B/avjR59LPW9kUw8TqM=; b=juDkDG6SK830bT03HP6walWr6twAu9V7y\n HTQoLiBE1WsTcR0a+/8NSr8ghJDHx1WUw5NUn34Pi28rl3q+3lQc12s5bGRuLllp\n HpXqaHcZkPFo0d/29YJIrwajZtz9IwMimAFYGGHGLH8oQedFYGfAvMgq3qOT17Ey\n Cpc36gojamj3JvJC8fl1lJ+C3ZVZx/uV/F5Dl86LcCxUDy2pfk8rJzbZ0qLW4ePE\n sWqoAor3MW+zA8LWv/iKAZhb2/jPeTyUuizNLF+nYVlqGp5GcIiQpY/+Hx8Gws0W\n Z8l5zFGp0v8FZlcc6ouhfJbWdW1Uk42aUKbRcNtbibYn7gbuPV9Ag==", "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 v2 01/15] s390x/pci: implement IOMMU replay", "Date": "Fri, 10 Apr 2026 21:26:04 -0500", "Message-Id": "<20260411022618.2136588-2-kshk@linux.ibm.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20260411022618.2136588-1-kshk@linux.ibm.com>", "References": "<20260411022618.2136588-1-kshk@linux.ibm.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-TM-AS-GCONF": "00", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDExMDAxNiBTYWx0ZWRfXzzqcIjPWqk/i\n uO751AcYA3J3hJH02Xz6ErvKtdi+KDMvveSMe6InnG9YyvXQefQvrl93rIMQx2iB8ZcIeEt5a/L\n zHwICuUM5ca5UpRMjjCUhkQWkipEtPt+Cwy0rM0T1hUgL32FsyOwV8S9NIMrnsbMorHdZ7zHEUO\n OJFIKePM3OqdqCSEtIfZ//H5bzf2DTG9dWYStpX5vwjzxdumM+5uYJkzFC6PfwLNZg3+1NLlMVG\n HtUj3kdA9jj9X6CI//fs2qLIGG67zDxV/z/buCdfhr812iz2Cqs4cT8Kja3cpPm1novXTtrgfqH\n 67zYJiKvd5iWHwU6IXCu22csnnsHgL+LWI2hyCP+BrZ2AESt9kZrJu/HCZ8Qtvuqhw/mmbAcUpv\n Z+lHI9k49wlv/5TD0Nncnl/Cl+LhIdrwmJD5fyGm2ZJZV/Q2YDBme+rKH7C6N/6EWr2kyAnj8mK\n sAbfsvBFABGPKVeJBUw==", "X-Proofpoint-GUID": "DmF5m4pZlyrW0gGhW2KXExB3aUbWZppj", "X-Proofpoint-ORIG-GUID": "DmF5m4pZlyrW0gGhW2KXExB3aUbWZppj", "X-Authority-Analysis": "v=2.4 cv=YemNIQRf c=1 sm=1 tr=0 ts=69d9b16e cx=c_pps\n a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17\n a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22\n a=V8glGbnc2Ofi9Qvn3v5h:22 a=VnNF1IyMAAAA:8 a=CCwrLMjO1E3osjVnD3IA:9", "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-10_07,2026-04-09_02,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n spamscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015\n impostorscore=0 bulkscore=0 malwarescore=0 suspectscore=0 phishscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604110016", "Received-SPF": "pass client-ip=148.163.158.5; envelope-from=kshk@linux.ibm.com;\n helo=mx0b-001b2d01.pphosted.com", "X-Spam_score_int": "-26", "X-Spam_score": "-2.7", "X-Spam_bar": "--", "X-Spam_report": "(-2.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.001, RCVD_IN_MSPIKE_WL=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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": "From: Matthew Rosato <mjrosato@linux.ibm.com>\n\nThere are a few scenarios where IOMMU replay can potentially be needed\nfor zPCI device, namely VFIO device reset scenarios where the guest\ncontinues running and expects the contents of its IOMMU to be replayed\nupon IOAT re-registration and migration scenarios where the destination\nmust reconstruct the IOMMU on the destination.\n\nzPCI migration is not supported yet, but the IOMMU replay function is\nimplemented so that it can be called both from IOMMUMemoryRegionClass\nnow and migration post_load later.\n\nSigned-off-by: Matthew Rosato <mjrosato@linux.ibm.com>\nSigned-off-by: Konstantin Shkolnyy <kshk@linux.ibm.com>\n---\n hw/s390x/s390-pci-bus.c | 50 ++++++++++++++++++++++++++++----\n hw/s390x/s390-pci-inst.c | 4 +--\n include/hw/s390x/s390-pci-inst.h | 1 +\n 3 files changed, 47 insertions(+), 8 deletions(-)", "diff": "diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c\nindex 4de7b587e8..3665aba106 100644\n--- a/hw/s390x/s390-pci-bus.c\n+++ b/hw/s390x/s390-pci-bus.c\n@@ -592,14 +592,52 @@ err:\n return ret;\n }\n \n-static void s390_pci_iommu_replay(IOMMUMemoryRegion *iommu,\n+static void s390_pci_ioat_replay(S390PCIIOMMU *iommu)\n+{\n+ S390IOTLBEntry entry;\n+ uint16_t error = 0;\n+ uint32_t dma_avail;\n+ hwaddr curr, end;\n+\n+ curr = iommu->pba;\n+ end = iommu->pal;\n+\n+ if (iommu->dm_mr) {\n+ /* If direct mapping is used, there are no guest tables to replay */\n+ return;\n+ }\n+\n+ if (iommu->dma_limit) {\n+ dma_avail = iommu->dma_limit->avail;\n+ } else {\n+ dma_avail = 1;\n+ }\n+\n+ while (curr < end) {\n+ error = s390_guest_io_table_walk(iommu->g_iota, curr, &entry);\n+ if (error) {\n+ error_report(\"Failure to walk table during iommu remap\");\n+ return;\n+ }\n+\n+ if (entry.perm != IOMMU_NONE) {\n+ if (dma_avail > 0) {\n+ dma_avail = s390_pci_update_iotlb(iommu, &entry);\n+ } else {\n+ error_report(\"DMA mappings exhausted: iommu remap failed\");\n+ return;\n+ }\n+ }\n+ curr += entry.len;\n+ }\n+}\n+\n+static void s390_pci_iommu_replay(IOMMUMemoryRegion *mr,\n IOMMUNotifier *notifier)\n {\n- /* It's impossible to plug a pci device on s390x that already has iommu\n- * mappings which need to be replayed, that is due to the \"one iommu per\n- * zpci device\" construct. But when we support migration of vfio-pci\n- * devices in future, we need to revisit this.\n- */\n+ S390PCIIOMMU *iommu = container_of(mr, S390PCIIOMMU, iommu_mr);\n+\n+ s390_pci_ioat_replay(iommu);\n }\n \n static S390PCIIOMMU *s390_pci_get_iommu(S390pciState *s, PCIBus *bus,\ndiff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c\nindex 10066ca618..1834596076 100644\n--- a/hw/s390x/s390-pci-inst.c\n+++ b/hw/s390x/s390-pci-inst.c\n@@ -613,8 +613,8 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra)\n return 0;\n }\n \n-static uint32_t s390_pci_update_iotlb(S390PCIIOMMU *iommu,\n- S390IOTLBEntry *entry)\n+uint32_t s390_pci_update_iotlb(S390PCIIOMMU *iommu,\n+ S390IOTLBEntry *entry)\n {\n S390IOTLBEntry *cache = g_hash_table_lookup(iommu->iotlb, &entry->iova);\n IOMMUTLBEvent event = {\ndiff --git a/include/hw/s390x/s390-pci-inst.h b/include/hw/s390x/s390-pci-inst.h\nindex 5cb8da540b..c782990e3b 100644\n--- a/include/hw/s390x/s390-pci-inst.h\n+++ b/include/hw/s390x/s390-pci-inst.h\n@@ -111,6 +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 \n #define ZPCI_IO_BAR_MIN 0\n #define ZPCI_IO_BAR_MAX 5\n", "prefixes": [ "v2", "01/15" ] }