From nobody Thu Oct 22 22:40:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1786122621; cv=none; d=zohomail.com; s=zohoarc; b=D63qiktFLzaXmXW/UYHdzzeNkEuuHPbZhGTIWKu5CuiqFWVD/BlJ/a0QunOx4ljAjJk4q86B8xVqcIP1VR9bqDZi4CuAzpSiXiQFJItT60qyJYXKqDtIa2LGP7oJoRBiL/P8acx9qjSUX5qBA6QFeLOZxtQ00ZM2tuT5ov49wYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786122621; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kgCUH7HAwvT99Xf29z+IEKyEOX0qbWMc5OTd9oaw06g=; b=Sj6wiBjYsUjGsHz9rPW1TwiEPJDhAfti8iMznLFtSKMbJWTC7mJJgWoP+QbBbFtoIhRKHxPGDJV6cRcLqqAVjOScB6wSZdowaMBTQ39H3mNF46S4kqpjWGfJSoHkBi/27JanIeerqJh3X5x1Q0flbUlrp9KoFKfZfSHYDARrOs0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786122621385305.69670786450763; Fri, 7 Aug 2026 10:10:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wsO3b-0003eU-9o; Fri, 07 Aug 2026 13:08:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wsO3Y-0003b0-Mo; Fri, 07 Aug 2026 13:08:28 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wsO3W-0000xC-EE; Fri, 07 Aug 2026 13:08:28 -0400 Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 677GlVVg2000810; Fri, 7 Aug 2026 17:08:21 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fvy0450y6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Aug 2026 17:08:21 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 677GuLBM010384; Fri, 7 Aug 2026 17:08:20 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4fsvmhrgu4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Aug 2026 17:08:20 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 677H8JMX33161948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 Aug 2026 17:08:19 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2D5AD5805A; Fri, 7 Aug 2026 17:08:19 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E7D6758056; Fri, 7 Aug 2026 17:08:18 +0000 (GMT) Received: from WIN-DU0DFC9G5VV.atx-us.ibm.com (unknown [9.16.62.165]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Fri, 7 Aug 2026 17:08:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=kgCUH7HAwvT99Xf29 z+IEKyEOX0qbWMc5OTd9oaw06g=; b=Vr1X2to7Cgvh+QeUrZ3x1kyLe8mtPwLYb wh9D5VcHCjBKQeRYk7ZdEjCulmAjC+bi8HaRWdpeGl4tvyoi5pqQ2GMeVOjacpnb +Zg25QrTEQBKPtXDQAP9Cn/MOZfl8dx9aeIaIYaGd9eLFls8TkSp+F5Nz5hikkge ZAjomx7LckxbaN2ArAsfsz7zg3PWtRa9bhZA5kBfbvR16yQXSWuFr6LNj9Acorv8 w3Mvql61BDJWwnOpcCK+t7IFRKgJDX0DmIct6B5S85xA/e2TfTcg8o6caHw2PsN4 RQ5JDCnl5rQkIHVU3y1VG0waLd9eBdoHOYZio5kn5fr0kLTSyurGg== From: Konstantin Shkolnyy To: mjrosato@linux.ibm.com Cc: alifm@linux.ibm.com, farman@linux.ibm.com, richard.henderson@linaro.org, iii@linux.ibm.com, david@kernel.org, cohuck@redhat.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Konstantin Shkolnyy Subject: [PATCH v6 12/15] s390x/pci: Move max_dma_limit from S390PCIIOMMU to S390PCIBusDevice Date: Fri, 7 Aug 2026 12:08:09 -0500 Message-Id: <20260807170812.658820-13-kshk@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260807170812.658820-1-kshk@linux.ibm.com> References: <20260807170812.658820-1-kshk@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODA3MDEzMSBTYWx0ZWRfX5oFa07EMaAnO WBEgoVRR4Fjst4Im6aHB94eiLJAGSJ96nMDwkgHZAipG/UMOV6i9bUns17gOQND3hzwOWGsPu6r KDXaAT+1jvBaRVyzAC0+coZ8YNv7MhDLjq4SKEmiJ2msta8AexCjmOtrbWcRHwQqxrmt94R7RDZ 2YCErAQ9bmxZGEBQO3kdE1DFrWD48jh7xcMSRr5PFHqoCPKpop/oNkWC9sjt3inbXwlMcP/irny ARs7o6HJo3roS7oPBrLEKF/Y62B4MbiSqxqrSnTkHW22jBvbuvM0MHo+rt37iH9CwC+T1ZvgfDO D+B3PxGWVgyLW2lxoTDpwyvn9Yc+sX1mjJWl2w58ZPdIyAMqo+VKgLfH4Rbm3MsUz9TMlV78grV cmch44gtJcZz0+I1L/NDYwh9YXC4NO4W97qVLYNK0n1atna+hNaw0b8hms8oQ7DQf2vBZnuEv+0 KkGji+i9ApzaE+d3fSQ== X-Proofpoint-ORIG-GUID: kZg90gXthxPHj9NbFvCc_3KDe-cLP_8l X-Proofpoint-GUID: kZg90gXthxPHj9NbFvCc_3KDe-cLP_8l X-Proofpoint-Spam-Info: AW1haW4tMjYwODA3MDEzMSBTYWx0ZWRfX+Fnt63z/5ZFU 10PuYYNNViQFKa5DxJrB8Hsz181LtpREOxa/ywvSuPw5PmUqbrE0+Vjm+rJ4nAuCckrynxz7rjN z13TSitq2iF8s2U/R+PRnwWaDEIZPHo= X-Authority-Analysis: v=2.4 cv=WLpPmHsR c=1 sm=1 tr=0 ts=6a761105 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=YlvBUofuDPas7G3Xl8cA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-07_03,2026-08-07_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 clxscore=1015 impostorscore=0 priorityscore=1501 phishscore=0 suspectscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608070131 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=kshk@linux.ibm.com; helo=mx0a-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, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1786122622479158500 Content-Type: text/plain; charset="utf-8" This field is only used when S390PCIBusDevice exists, so it can be moved there to simplify S390PCIIOMMU which purpose is just to store the "root" AddressSpace. This also allows to save/restore this field during migration. Signed-off-by: Konstantin Shkolnyy Reviewed-by: Farhan Ali --- hw/s390x/s390-pci-vfio.c | 4 ++-- include/hw/s390x/s390-pci-bus.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c index db6de00bd2..a035ba5b2c 100644 --- a/hw/s390x/s390-pci-vfio.c +++ b/hw/s390x/s390-pci-vfio.c @@ -90,7 +90,7 @@ S390PCIDMACount *s390_pci_start_dma_count(S390pciState *s, cnt->users =3D 1; cnt->avail =3D avail; QTAILQ_INSERT_TAIL(&s->zpci_dma_limit, cnt, link); - pbdev->iommu->max_dma_limit =3D avail; + pbdev->max_dma_limit =3D avail; return cnt; } =20 @@ -152,7 +152,7 @@ static void s390_pci_read_base(S390PCIBusDevice *pbdev, * to request that the guest free DMA mappings as necessary. */ if (!pbdev->rtr_avail) { - vfio_size =3D pbdev->iommu->max_dma_limit << qemu_target_page_bits= (); + vfio_size =3D pbdev->max_dma_limit << qemu_target_page_bits(); if (vfio_size > 0 && vfio_size < cap->end_dma - cap->start_dma + 1= ) { pbdev->zpci_fn.edma =3D cap->start_dma + vfio_size - 1; } diff --git a/include/hw/s390x/s390-pci-bus.h b/include/hw/s390x/s390-pci-bu= s.h index 1f5d8d4bd4..e3cbee2695 100644 --- a/include/hw/s390x/s390-pci-bus.h +++ b/include/hw/s390x/s390-pci-bus.h @@ -275,7 +275,6 @@ struct S390PCIIOMMU { Object parent_obj; AddressSpace as; MemoryRegion mr; - uint64_t max_dma_limit; }; =20 typedef struct S390PCIIOMMUTable { @@ -352,6 +351,7 @@ struct S390PCIBusDevice { uint64_t g_iota; uint64_t pba; uint64_t pal; + uint64_t max_dma_limit; S390PCIDMACount *dma_limit; MemoryRegion msix_notify_mr; IndAddr *summary_ind; --=20 2.34.1