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 9351DCA5FF0 for ; Tue, 6 Oct 2026 00:18:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xDstK-0005HN-3y; Mon, 05 Oct 2026 20:18:46 -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 1xDsrn-000403-AG; Mon, 05 Oct 2026 20:17:15 -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 1xDsrj-0001Gs-Dz; Mon, 05 Oct 2026 20:17:09 -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 695HZKtb3658096; Tue, 6 Oct 2026 00:17:02 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=nd593Izbg1DeGqai2 ESESdV3LFv94n1s+WvSQWENp70=; b=L0EvaMhvO8DjwHGCH1+PgMlN8E89Z1+TM ApSaXhQUlQThn3YthBHUkpxA64eMjmPnxS13NoDwWbe/RbjQEh8JhMsNOQUwvUBT 3OdMolgmoOimxPbv0BjStLmb+nnQZZAk+sBcYUJukAdTOzJhBlpH/OFxGTl4kwfS muYd+xBdeknDOSt5vYi6LNpCazNClmXD6DI4DYUuc/o73oqW9h87a9KmHx/h0xoB 03BndxWBun4PXiaKThTPlJgR/BM0WFGkZmMMvdU3bRR7c16vURjOT+4jjhbgt0kZ v7GbngysKMGo7+061WabGByfBdL2aWzHnqaN1eC9VuhpctM6gWUyQ== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4h2scrd3w2-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 06 Oct 2026 00:17:01 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 695LlawB3238873; Tue, 6 Oct 2026 00:17:01 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4h3c1pqx1k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Oct 2026 00:17:01 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6960H0a451314964 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 6 Oct 2026 00:17:00 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EFF1258043; Tue, 6 Oct 2026 00:16:59 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 13C0B58053; Tue, 6 Oct 2026 00:16:59 +0000 (GMT) Received: from WIN-DU0DFC9G5VV.ibm.com (unknown [9.61.249.221]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 6 Oct 2026 00:16:58 +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 v12 12/17] s390x/pci: Move max_dma_limit from S390PCIIOMMU to S390PCIBusDevice Date: Mon, 5 Oct 2026 19:16:38 -0500 Message-Id: <20261006001643.420929-13-kshk@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261006001643.420929-1-kshk@linux.ibm.com> References: <20261006001643.420929-1-kshk@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Info: AW1haW4tMjYxMDA2MDAwMCBTYWx0ZWRfX32uqIV6QN+cl gdmE+98C8lv/h0FXGgTBwWet8Q+7H5CF4wjfw/X8CvuhBoTDCBlaZeOS7zdRPRnHUONoENb7kqR NQTBUUmbRJb9MIBVhAJciBAJ976/zvM= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDA2MDAwMCBTYWx0ZWRfX4dtuHg/xY9q8 X0kYRMMJjRtxrbexC9oa6ULI68aM4fkJO8jXI/iELzQpPI/L9oDlkMlBFVQNtYRpuj/plRQU43F 0OnClBKiVX9hWcUX3rxQoQlEhCRYWUhAi/L/ooCWidHS23UUeqAepW/uYp+YsVC1hw4lkwkHIXF A/PfcmobYiowSsu2Ae/Wq/qxZkcJUQ82fnYnpWIosh07UsDlUpKwGMGnO/lGg4KYTe8yPurEaMS q4rjhfh2VR8u3GGQGK4d8fkwHv3biATX+KFDbJpVmZp+pyVlrh+mLHRHsMuLUn7YNrs/TL018W0 ZupWNnq9rcIuP4ZSlMAZkM3zpohsP6VV1GpQPaJgtC1QF35saOtrAmPSa1wuhxTr2axAS+4iYtK dLK+OtzE2Ud0+XqQMi3DWhFv+27RA3G0bXkUp6YbZ1OE1kMapsNq6Ne4u+fadFY3A99kc+U4r86 xGMbSg/K8fe7AC3ElOw== X-Proofpoint-GUID: lqWQNaJLuZOezXATKAKN6XVmGSHVLMNY X-Proofpoint-ORIG-GUID: lqWQNaJLuZOezXATKAKN6XVmGSHVLMNY X-Authority-Analysis: v=2.4 cv=B7osQ+tM c=1 sm=1 tr=0 ts=6ac43dfe cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=VnNF1IyMAAAA:8 a=wu6SjTzT1SSAPCv-QiYA: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-10-05_05,2026-10-05_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 malwarescore=0 impostorscore=0 phishscore=0 clxscore=1015 spamscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2610060000 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. Reviewed-by: Farhan Ali Reviewed-by: Matthew Rosato Signed-off-by: Konstantin Shkolnyy --- 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 = 1; cnt->avail = avail; QTAILQ_INSERT_TAIL(&s->zpci_dma_limit, cnt, link); - pbdev->iommu->max_dma_limit = avail; + pbdev->max_dma_limit = avail; return cnt; } @@ -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 = pbdev->iommu->max_dma_limit << qemu_target_page_bits(); + vfio_size = 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 = cap->start_dma + vfio_size - 1; } diff --git a/include/hw/s390x/s390-pci-bus.h b/include/hw/s390x/s390-pci-bus.h index 9332763522..c7fa7b9514 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 max_dma_limit; }; typedef struct S390PCIIOMMUTable { @@ -353,6 +352,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; -- 2.34.1