From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B546AC5AC7A for ; Fri, 7 Aug 2026 17:10:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wsO3b-0003fd-U8; 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 1wsO3X-0003YQ-LB; Fri, 07 Aug 2026 13:08:27 -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 1wsO3V-0000wg-5Y; Fri, 07 Aug 2026 13:08:27 -0400 Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 677GlYpT153984; Fri, 7 Aug 2026 17:08:20 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=2hK24WnXB6VxFKT3Q Fo9AHd3o5qFYlYhxda9U5RnhVI=; b=evzeBTCFpxRAwYLze6615u6V4qux4y+Iw NQAtZ8NIw0F6HfNpEKUU7IcQlkem93QIiTt9rg9KTbhO6CCWA5t+kQ2TDEFux/Is 75hS7TBUB3bcRRsX0JKOqT+vLKzTHFDHuFiqicJMzUJMs9M5UdQeGqvzq4nDl/88 8TOc811msxU50SYye/DkPWAYrwLMwK8EHe039ArAQgbWdSdLfhOhE2qVAUdUJrGU UJcYb/ladzjhF+nOWnO2IOQwu0LMSyOoD/iX1DOuF749jNY/nLRZUlwg6V3VAWRC dQWlUmhAuW//fwSflKEPR4Zp3OdvvcjQrGNTNAh/aCCziowWiDnUA== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fvy01n0g1-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 pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 677GuLqN025991; Fri, 7 Aug 2026 17:08:19 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fswu00by4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Aug 2026 17:08:19 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 677H8ISR44695952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 Aug 2026 17:08:18 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A01705803F; Fri, 7 Aug 2026 17:08:18 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 66C6358056; 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) 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 10/15] s390x/pci: Move pba from S390PCIIOMMU to S390PCIBusDevice Date: Fri, 7 Aug 2026 12:08:07 -0500 Message-Id: <20260807170812.658820-11-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: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: W57TJJE7fhIFVu0p6KBByJRbUce2TBBk X-Proofpoint-Spam-Info: AW1haW4tMjYwODA3MDEzMSBTYWx0ZWRfXzm1ZY/kN0c1t yVEsDe9FT9QvgQBBzyRyTZcd8O4Xh7SPrvKGyQ5QgmcOMyN+Ab0DzxHMa77TSSXMMIMNLn9MBtw hyiypmSgk0IPMxRpkSKxyug9vKMJhuM= X-Proofpoint-ORIG-GUID: W57TJJE7fhIFVu0p6KBByJRbUce2TBBk X-Authority-Analysis: v=2.4 cv=afNRWxot c=1 sm=1 tr=0 ts=6a761104 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=VnNF1IyMAAAA:8 a=THYS1zffzJpO_GefUMYA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODA3MDEzMSBTYWx0ZWRfX+IiTiTlsDlcb 21XjVjowB0bN4HS8Dj9fme8muKo4uYliQVdid/mAkaaOurQg6tUEAP9f6Kuc+KF8Xclf0hxu2U2 M2MN13m7QR0WAOwAfaR5qux9MPn4wHS/moIwzpRHuxGtHpaFZm1pzXiNrDhi6T4NE/N3Ytc/i0y wZaCk3l92KgT9haRrWzQO/eGUjhseFikqdMnOzdgyky2fmURyf26NMfCYU3WAALpi9DTnjdj0nC lBEL74lgBl/KJdTyWNXP4G2oArRqELhQaYOjmHCZIYyiQC9kDLsqR//MzDIcgsfuWWRsSIAadh2 OIHaQFNSpwMpJ6B3hwszBC0rG84qP0wmyg45vKUMipGmWL6YKYVtqG7+AxAlfYFXiz4LT4+2EmR 3FT6ZOTB0E5MB3M9/PMP8bTL6CDyf+fj5Pa31SjWz0V8TnyH9CH0uNMHIuSg0h8wHo3CLRtW5bL tAfUtReXs2iG9Vh03zQ== 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 malwarescore=0 spamscore=0 phishscore=0 impostorscore=0 adultscore=0 suspectscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=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 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 --- hw/s390x/s390-pci-bus.c | 4 ++-- hw/s390x/s390-pci-inst.c | 10 +++++----- include/hw/s390x/s390-pci-bus.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 5180849518..2309afcfa6 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -565,7 +565,7 @@ static IOMMUTLBEntry s390_translate_iommu(IOMMUMemoryRegion *mr, hwaddr addr, trace_s390_pci_iommu_xlate(addr); - if (addr < iommu->pba || addr > iommu->pal) { + if (addr < pbdev->pba || addr > iommu->pal) { error = ERR_EVENT_OORANGE; goto err; } @@ -602,7 +602,7 @@ static void s390_pci_ioat_replay(S390PCIBusDevice *pbdev) hwaddr curr, end; S390PCIIOMMU *iommu = pbdev->iommu; - curr = iommu->pba; + curr = pbdev->pba; end = iommu->pal; if (pbdev->dm_mr) { diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 22b477ab38..aa2bc98254 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -770,7 +770,7 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra) goto err; } - if (end < start || end < iommu->pba || start > iommu->pal) { + if (end < start || end < pbdev->pba || start > iommu->pal) { error = ERR_EVENT_OORANGE; goto err; } @@ -778,7 +778,7 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra) * If the specified range at least partially overlaps the registered * aperture, clamp the request to the aperture and ignore the rest. */ - sstart = MAX(start, iommu->pba); + sstart = MAX(start, pbdev->pba); end = MIN(end, iommu->pal + 1); retry: @@ -1054,7 +1054,7 @@ static int reg_ioat(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib fib, return -EINVAL; } - iommu->pba = pba; + pbdev->pba = pba; iommu->pal = pal; pbdev->g_iota = g_iota; @@ -1071,7 +1071,7 @@ void pci_dereg_ioat(S390PCIBusDevice *pbdev) { S390PCIIOMMU *iommu = pbdev->iommu; s390_pci_iommu_disable(pbdev); - iommu->pba = 0; + pbdev->pba = 0; iommu->pal = 0; pbdev->g_iota = 0; } @@ -1444,7 +1444,7 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, return 0; } - stq_be_p(&fib.pba, pbdev->iommu->pba); + stq_be_p(&fib.pba, pbdev->pba); stq_be_p(&fib.pal, pbdev->iommu->pal); stq_be_p(&fib.iota, pbdev->g_iota); stq_be_p(&fib.aibv, pbdev->routes.adapter.ind_addr); diff --git a/include/hw/s390x/s390-pci-bus.h b/include/hw/s390x/s390-pci-bus.h index a7d1f1ade2..42f39a5cf0 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 pba; uint64_t pal; uint64_t max_dma_limit; }; @@ -352,6 +351,7 @@ struct S390PCIBusDevice { MemoryRegion *dm_mr; GHashTable *iotlb; uint64_t g_iota; + uint64_t pba; S390PCIDMACount *dma_limit; MemoryRegion msix_notify_mr; IndAddr *summary_ind; -- 2.34.1