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 D55F3CA5FC7 for ; Wed, 30 Sep 2026 14:56:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xBvhd-0002Au-Gy; Wed, 30 Sep 2026 10:54:39 -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 1xBvgG-0000yx-8e; Wed, 30 Sep 2026 10:53:12 -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 1xBvgD-0006cj-Oc; Wed, 30 Sep 2026 10:53:11 -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 68UE5V1G1335876; Wed, 30 Sep 2026 14:53:06 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=Yi3Me+ULk1Wai3w8L kjAU/5Bs0ODurkPgASuRDqrUBg=; b=DmOGcW4Z6EmI4edxHF6xGReqOd/PQWyVz 6U+V55MnGKmId1p4+3UWQz3nEuah0k19PqDf1Mu7gKgjNQ7UROL8VAjAda9oMGB2 60TO22sBEeCBgR6aM7rSbo6+gCjsjezah4cca1QTDjhs5c+20YAbbHzKEm2wt7w+ tmpdsCPVfHiwemlLoQtihJJGGPerSz+QrWj+X4I9jdVc43YOHjkEYtwFK/M6EeuT uaGb3weAE9Xl05A7jsqkeJfFaiZy8usZNyn43TrJLOp9lJpi0Oan1fcT5kyngXpX v6dTRd8GQUyQjzxWzoTEyStcATvkwCj5HIAZQPBjYIWnQ+lMZM2gQ== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gx5qrdmqy-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 30 Sep 2026 14:53:05 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68UE343F3541449; Wed, 30 Sep 2026 14:53:05 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4h0hfpcab7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2026 14:53:05 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68UEr3lV8257798 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Sep 2026 14:53:03 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B695358059; Wed, 30 Sep 2026 14:53:03 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 23CC55804B; Wed, 30 Sep 2026 14:53:03 +0000 (GMT) Received: from WIN-DU0DFC9G5VV.atx-us.ibm.com (unknown [9.16.60.171]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 30 Sep 2026 14:53:03 +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 v11 09/16] s390x/pci: Move g_iota from S390PCIIOMMU to S390PCIBusDevice Date: Wed, 30 Sep 2026 09:52:48 -0500 Message-Id: <20260930145255.140164-10-kshk@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260930145255.140164-1-kshk@linux.ibm.com> References: <20260930145255.140164-1-kshk@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTMwMDA1OCBTYWx0ZWRfXxpmCQJ7fD6ME iS0f2lnogdVWIJgpnvrOmdHxL/Bp5JFOlW4wXcpDGiFdb25DPjplzDNGmbLOBjTJowsTL0MvMV6 1r9fwcGF5EETbqAh49+k1ayB8cqEJuEd1CQyMXExWsALX2e2x5uek3DFPOzZJnk+nkWWehb0NE2 KWaq5/L8w+W9xqwZcXSn3WSL6tX/PIMkmwGqAXRgmEKFevmQThIDcjDZ5IAAkhBF4dl+i7kQDBk 3+8SdD+zudtf7d7tkMm3/tWA0BoUvSFmO3m2CsaVa388tqyMDPs4G5KEXkV7Y3HW2nVS/kpwc8c 7r/LbZ3Xgc5+Gc1JDw7y4K1ZgCpzSNE3tz4+L7vicclpxhs84r3EXjETBagzgLkXOUJ8oVCxl1Z Z2Bw+H3MkIQChUA7PiHYW6aCElEzsUNaI+fKTFGAA1ofwjx1Qo1w8FZaKOvorq+8udPJ8T8cwRA dKZnnIq+vmP+GWI+aKA== X-Authority-Analysis: v=2.4 cv=SPbXx+vH c=1 sm=1 tr=0 ts=6abd2251 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=VnNF1IyMAAAA:8 a=eCYPC3wdSG4xViznilUA:9 X-Proofpoint-ORIG-GUID: x20ogxa_onRlcyPxRCJ2dGRToZSUfAZf X-Proofpoint-Spam-Info: AW1haW4tMjYwOTMwMDA1OCBTYWx0ZWRfX2dG4E61rKMY5 iJXz3KkeV7vGlYgcmSHtFLYS2Lrv0f4mibbXzMY+eK9tQy03uaqdNm44tLS0f3jnjlEN6VPOHi3 GggnjT833Va/j3Su2SWuZbYSD3vyYH0= X-Proofpoint-GUID: x20ogxa_onRlcyPxRCJ2dGRToZSUfAZf 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-09-30_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 bulkscore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609300058 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 towards a structure that contains only the IOMMU container information needed by the PCI layer for a given slot. This also allows to save/restore this field during migration. Reviewed-by: Farhan Ali Reviewed-by: Matthew Rosato Signed-off-by: Konstantin Shkolnyy --- hw/s390x/s390-pci-bus.c | 2 +- hw/s390x/s390-pci-inst.c | 10 +++++----- include/hw/s390x/s390-pci-bus.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 53af08018d..88ffa93977 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -617,7 +617,7 @@ static void s390_pci_ioat_replay(S390PCIBusDevice *pbdev) } while (curr < end) { - error = s390_guest_io_table_walk(iommu->g_iota, curr, &entry); + error = s390_guest_io_table_walk(pbdev->g_iota, curr, &entry); if (error) { pbdev->state = ZPCI_FS_ERROR; s390_pci_generate_error_event(error, pbdev->fh, pbdev->fid, curr, diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index fa18ad2617..3163539ead 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -768,7 +768,7 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra) } else { dma_avail = 1; } - if (!iommu->g_iota) { + if (!pbdev->g_iota) { error = ERR_EVENT_INVALAS; goto err; } @@ -788,7 +788,7 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra) start = sstart; again = false; while (start < end) { - error = s390_guest_io_table_walk(iommu->g_iota, start, &entry); + error = s390_guest_io_table_walk(pbdev->g_iota, start, &entry); if (error) { break; } @@ -1076,7 +1076,7 @@ static int reg_ioat(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib fib, iommu->pba = pba; iommu->pal = pal; - iommu->g_iota = g_iota; + pbdev->g_iota = g_iota; if (t) { s390_pci_iommu_enable(pbdev); @@ -1093,7 +1093,7 @@ void pci_dereg_ioat(S390PCIBusDevice *pbdev) s390_pci_iommu_disable(pbdev); iommu->pba = 0; iommu->pal = 0; - iommu->g_iota = 0; + pbdev->g_iota = 0; } void fmb_timer_free(S390PCIBusDevice *pbdev) @@ -1466,7 +1466,7 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, stq_be_p(&fib.pba, pbdev->iommu->pba); stq_be_p(&fib.pal, pbdev->iommu->pal); - stq_be_p(&fib.iota, pbdev->iommu->g_iota); + stq_be_p(&fib.iota, pbdev->g_iota); stq_be_p(&fib.aibv, pbdev->routes.adapter.ind_addr); stq_be_p(&fib.aisb, pbdev->routes.adapter.summary_addr); stq_be_p(&fib.fmb_addr, pbdev->fmb_addr); diff --git a/include/hw/s390x/s390-pci-bus.h b/include/hw/s390x/s390-pci-bus.h index 00e7e456e7..1bb1b87d52 100644 --- a/include/hw/s390x/s390-pci-bus.h +++ b/include/hw/s390x/s390-pci-bus.h @@ -276,7 +276,6 @@ struct S390PCIIOMMU { Object parent_obj; AddressSpace as; MemoryRegion mr; - uint64_t g_iota; uint64_t pba; uint64_t pal; uint64_t max_dma_limit; @@ -353,6 +352,7 @@ struct S390PCIBusDevice { IOMMUMemoryRegion iommu_mr; MemoryRegion *dm_mr; GHashTable *iotlb; + uint64_t g_iota; S390PCIDMACount *dma_limit; MemoryRegion msix_notify_mr; IndAddr *summary_ind; -- 2.34.1