From nobody Fri Nov 14 18:16:49 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1760084655; cv=none; d=zohomail.com; s=zohoarc; b=niXAXGjp+NknlyyLlB2nDv5YVRlG+4OpGkBXbLWQXmRlERzSiwiCUfz5qxbyklnuco5kUURXlgqFIc8/fp5G6oBPf2G3K1p2FsqknNA8B/yXbMplymsBzqwjV0/+TexrPe50dYaGCdwoffxDr6ZveNzTHXq3vli1jz+onJFewC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760084655; h=Content-Type: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=zR9N58YTO83JkhU3KfFhan4WvyWnN7pZ0OHhHvlNLhI=; b=SioHG6d70o9WrRQrqf5JkGuyl0FbmGt43EKlIMQq405I9SvGAA+QgCrn6grYPm9sdnYLVhOHFSAjdJYDSFpkBKUsMFuq9VqxFOk4G0VfFyTc3GefCqpamwj9612UW7K2k1OtAIX8o4FKzeKNYKKBB1QnXsXob9jYBq2r0kWX5Ks= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760084655401956.7430790049352; Fri, 10 Oct 2025 01:24:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v78OI-00029d-VE; Fri, 10 Oct 2025 04:22:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78OE-00028D-WA for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78O9-000107-6K for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:14 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-322-zjYJYCvUMOeQ1CTLtnoBRQ-1; Fri, 10 Oct 2025 04:21:51 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 20BB019560AE; Fri, 10 Oct 2025 08:21:50 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.34.98]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 963441800452; Fri, 10 Oct 2025 08:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760084514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zR9N58YTO83JkhU3KfFhan4WvyWnN7pZ0OHhHvlNLhI=; b=J6EDlhIG5zwsUHijjbQ2/fZ+67Q1sYr3r0yn/2DhTHasA1cmSnu2n6FIJK0q3UmkGfmefI 3dHddq2Qgdmohg9/T+6ruEuXHfVas4qDmEcHuVNIQscSVMhbonXc53/CGv4Y70lT5CRv2y KhRNNooGFguVE8W+M5B0Q7EAyl8XcxE= X-MC-Unique: zjYJYCvUMOeQ1CTLtnoBRQ-1 X-Mimecast-MFC-AGG-ID: zjYJYCvUMOeQ1CTLtnoBRQ_1760084510 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 1/9] tests/functional: Drop the "Attempting to cache ..." log text Date: Fri, 10 Oct 2025 10:21:36 +0200 Message-ID: <20251010082145.576222-2-thuth@redhat.com> In-Reply-To: <20251010082145.576222-1-thuth@redhat.com> References: <20251010082145.576222-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.438, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 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 @redhat.com) X-ZM-MESSAGEID: 1760084671338158500 From: Thomas Huth The fetch() function already either prints "Using cached asset ..." or "Downloading ... to ..." with the same file name to the log, so the "Attempting to cache ..." message does not provide any additional valuable information. Thus let's drop it to limit the length of the logging output to a more reasonable size. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth Message-ID: <20251006170304.197387-1-thuth@redhat.com> --- tests/functional/qemu_test/asset.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_te= st/asset.py index 2971a989d1e..f666125bfaf 100644 --- a/tests/functional/qemu_test/asset.py +++ b/tests/functional/qemu_test/asset.py @@ -225,7 +225,6 @@ def precache_test(test): log.addHandler(handler) for name, asset in vars(test.__class__).items(): if name.startswith("ASSET_") and type(asset) =3D=3D Asset: - log.info("Attempting to cache '%s'" % asset) try: asset.fetch() except AssetError as e: --=20 2.51.0 From nobody Fri Nov 14 18:16:49 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1760084671; cv=none; d=zohomail.com; s=zohoarc; b=K0HZbuMHfMBH+Gfh0IIxtu1ZCWyZm651qmaAw/ZOydyWCHHhMfRK9Bgp5uqUCaJ8pYyzb7CI6CpUmOnMRpO1RLtafPQUJWjo9mb9Hll2JEYJPHLoX/61XttXk1kW1LptVtnHtZaWTYY9Kh8hjc4kJnz5zVKaNEmpquw0Ph7AfjA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760084671; 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=Fasr0vDcyU3Al2j8YMauSw32DE0/KtFTqpUjIgb7dME=; b=BtoYM9384WhvERwvTrqE1g/mFWa5GRJ0N11/Vkj7AYFLFIpkMnWvozDdYgZjfqNWrJ673iU1+MDG49Nc+1uJVame4ocSub4iE8NXk1Wa2pmuYZorYz95UI3g9WLRZquuQln87iM+BZ1JuP+VcOGTJjhJ9FMC9deHUIPHE3xtR8k= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760084671728765.5815238250542; Fri, 10 Oct 2025 01:24:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v78OL-0002Aa-Kr; Fri, 10 Oct 2025 04:22:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78OI-00029N-DJ for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78O6-00010a-OB for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:17 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-125-MtToXS--P_izpP5cVn9joQ-1; Fri, 10 Oct 2025 04:21:54 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 299E8180057E; Fri, 10 Oct 2025 08:21:53 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.34.98]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9F8C11800446; Fri, 10 Oct 2025 08:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760084519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fasr0vDcyU3Al2j8YMauSw32DE0/KtFTqpUjIgb7dME=; b=ef8f7SafXfgKzSD0BwSGlbQHDRA6Xs9CQSlQgiodjMQaEgfvy9obFjh0qyJKJD2OFG032S 3/PU6bJCuiD6j8sdLfmjEh9IRHHRZozKIxvuiTRg3YpbrURSFGnjsmOmUuIOxKwtcOwqAU RCPCA6xEb+bpziznHZTnaymz8RNFYvA= X-MC-Unique: MtToXS--P_izpP5cVn9joQ-1 X-Mimecast-MFC-AGG-ID: MtToXS--P_izpP5cVn9joQ_1760084513 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , Jaehoon Kim , Halil Pasic , Eric Farman , Christian Borntraeger , Matthew Rosato Subject: [PULL 2/9] s390x/pci: fix interrupt blocking by returning only the device's summary bit Date: Fri, 10 Oct 2025 10:21:37 +0200 Message-ID: <20251010082145.576222-3-thuth@redhat.com> In-Reply-To: <20251010082145.576222-1-thuth@redhat.com> References: <20251010082145.576222-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.438, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 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 @redhat.com) X-ZM-MESSAGEID: 1760084678945158500 Content-Type: text/plain; charset="utf-8" From: Jaehoon Kim Previously, set_ind_atomic() returned the entire byte containing multiple summary bits. This meant that if any other summary bit in the byte was set, interrupt injection could be incorrectly blocked, even when the current device's summary bit was not set. As a result, the guest could remain blocked after I/O completion during FIO tests. This patch replaces set_ind_atomic() with set_ind_bit_atomic(), which returns true if the bit was set by this function, and false if it was already set or mapping failed. Interrupts are now blocked only when the device's own summary bit was not previously set, avoiding unintended blocking when multiple PCI summary bits exist within the same byte. Signed-off-by: Jaehoon Kim Reviewed-by: Halil Pasic Reviewed-by: Eric Farman Reviewed-by: Christian Borntraeger Reviewed-by: Matthew Rosato Message-ID: <20251001154004.71917-1-jhkim@linux.ibm.com> Signed-off-by: Thomas Huth --- hw/s390x/s390-pci-bus.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index f87d2748b63..e8e41c8a9a1 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -652,7 +652,16 @@ static const PCIIOMMUOps s390_iommu_ops =3D { .get_address_space =3D s390_pci_dma_iommu, }; =20 -static uint8_t set_ind_atomic(uint64_t ind_loc, uint8_t to_be_set) +/** + * set_ind_bit_atomic - Atomically set a bit in an indicator + * + * @ind_loc: Address of the indicator + * @to_be_set: Bit to set + * + * Returns true if the bit was set by this function, false if it was + * already set or mapping failed. + */ +static bool set_ind_bit_atomic(uint64_t ind_loc, uint8_t to_be_set) { uint8_t expected, actual; hwaddr len =3D 1; @@ -662,7 +671,7 @@ static uint8_t set_ind_atomic(uint64_t ind_loc, uint8_t= to_be_set) ind_addr =3D cpu_physical_memory_map(ind_loc, &len, true); if (!ind_addr) { s390_pci_generate_error_event(ERR_EVENT_AIRERR, 0, 0, 0, 0); - return -1; + return false; } actual =3D *ind_addr; do { @@ -671,7 +680,7 @@ static uint8_t set_ind_atomic(uint64_t ind_loc, uint8_t= to_be_set) } while (actual !=3D expected); cpu_physical_memory_unmap((void *)ind_addr, len, 1, len); =20 - return actual; + return (actual & to_be_set) ? false : true; } =20 static void s390_msi_ctrl_write(void *opaque, hwaddr addr, uint64_t data, @@ -693,10 +702,10 @@ static void s390_msi_ctrl_write(void *opaque, hwaddr = addr, uint64_t data, ind_bit =3D pbdev->routes.adapter.ind_offset; sum_bit =3D pbdev->routes.adapter.summary_offset; =20 - set_ind_atomic(pbdev->routes.adapter.ind_addr + (ind_bit + vec) / 8, + set_ind_bit_atomic(pbdev->routes.adapter.ind_addr + (ind_bit + vec) / = 8, 0x80 >> ((ind_bit + vec) % 8)); - if (!set_ind_atomic(pbdev->routes.adapter.summary_addr + sum_bit / 8, - 0x80 >> (sum_bit % 8))) { + if (set_ind_bit_atomic(pbdev->routes.adapter.summary_addr + sum_bit / = 8, + 0x80 >> (sum_bit % 8))) { css_adapter_interrupt(CSS_IO_ADAPTER_PCI, pbdev->isc); } } --=20 2.51.0 From nobody Fri Nov 14 18:16:49 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1760084634; cv=none; d=zohomail.com; s=zohoarc; b=eKo1KriBfjetiZ1gAejbQpUbZoDAtOjnMpwiwSophk8t3kp1D/SN1tKVcNZxrcK5tdaNXs2xPEKNTdguFeklhp8v0UQRSxV3PV+RCsPKiH1LWa43rNf65jlT4Sp5WV8C2RKa2YOST+DQr77OB5pgwY82/r7Jxnx02OVtsXBT9KI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760084634; h=Content-Type: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=JXv/Cu7q862t0pbzb6wi7PCL6APdP4WKt8M+wjFeRsc=; b=TEJyYdVwuiSLKiUYohfpNUr7vWsvpgcu7ORSZS5FK93Vp6Hj5J8Xc1p0Jxa/3iVTlP8ZB668eYgR053OktwYm2Tkm28n+K77UMfsLtv0oAlDHLCZo8IQgzs4YyFeAFM7ps+R016tSxO3Lk6I7T+QgffI0Ahv2PHzcEYQOQt4Zh4= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760084634437486.29474456297237; Fri, 10 Oct 2025 01:23:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v78OG-00028u-Hg; Fri, 10 Oct 2025 04:22:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78OD-00027u-WB for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78O7-00010d-UV for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:13 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-115-hUrEdA6-N4aECN-afarWTA-1; Fri, 10 Oct 2025 04:21:56 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3D1D71800366; Fri, 10 Oct 2025 08:21:55 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.34.98]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C0ABB1800446; Fri, 10 Oct 2025 08:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760084519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JXv/Cu7q862t0pbzb6wi7PCL6APdP4WKt8M+wjFeRsc=; b=bnelYJfPCQg4rZP4EirqfRGngk6V+67Ne7BMELnKH3e/rKxvb+VykJluntZKK31EBlHIHs 8oodPMI73ovvJ1RZUI+rNuV5S8FGeHRqL/2VlxlkCxxA6TuItdQxymvGEWheAquxmqswzj Cb8cxyvWEuxsK2Frbq9PGvj/QsaAthY= X-MC-Unique: hUrEdA6-N4aECN-afarWTA-1 X-Mimecast-MFC-AGG-ID: hUrEdA6-N4aECN-afarWTA_1760084515 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 3/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (1/3) Date: Fri, 10 Oct 2025 10:21:38 +0200 Message-ID: <20251010082145.576222-4-thuth@redhat.com> In-Reply-To: <20251010082145.576222-1-thuth@redhat.com> References: <20251010082145.576222-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.438, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 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 @redhat.com) X-ZM-MESSAGEID: 1760084636622154100 From: Philippe Mathieu-Daud=C3=A9 Commit b7ecba0f6f6 ("docs/devel/loads-stores.rst: Document our various load and store APIs") mentioned cpu_physical_memory_*() methods are legacy, the replacement being address_space_*(). Replace the *_map() / *_unmap() methods in mchk_store_vregs(). No behavioral change expected. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251002091132.65703-5-philmd@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/tcg/excp_helper.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c index 4c7faeee82b..5e1d4dc9583 100644 --- a/target/s390x/tcg/excp_helper.c +++ b/target/s390x/tcg/excp_helper.c @@ -30,6 +30,7 @@ #ifndef CONFIG_USER_ONLY #include "qemu/timer.h" #include "system/address-spaces.h" +#include "system/memory.h" #include "hw/s390x/ioinst.h" #include "hw/s390x/s390_flic.h" #include "hw/boards.h" @@ -418,16 +419,18 @@ QEMU_BUILD_BUG_ON(sizeof(MchkExtSaveArea) !=3D 1024); =20 static int mchk_store_vregs(CPUS390XState *env, uint64_t mcesao) { + const MemTxAttrs attrs =3D MEMTXATTRS_UNSPECIFIED; + AddressSpace *as =3D env_cpu(env)->as; hwaddr len =3D sizeof(MchkExtSaveArea); MchkExtSaveArea *sa; int i; =20 - sa =3D cpu_physical_memory_map(mcesao, &len, true); + sa =3D address_space_map(as, mcesao, &len, true, attrs); if (!sa) { return -EFAULT; } if (len !=3D sizeof(MchkExtSaveArea)) { - cpu_physical_memory_unmap(sa, len, 1, 0); + address_space_unmap(as, sa, len, true, 0); return -EFAULT; } =20 @@ -436,7 +439,7 @@ static int mchk_store_vregs(CPUS390XState *env, uint64_= t mcesao) sa->vregs[i][1] =3D cpu_to_be64(env->vregs[i][1]); } =20 - cpu_physical_memory_unmap(sa, len, 1, len); + address_space_unmap(as, sa, len, true, len); return 0; } =20 --=20 2.51.0 From nobody Fri Nov 14 18:16:49 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1760084676; cv=none; d=zohomail.com; s=zohoarc; b=DBoXb70krG9nVbRSpKKX5jox6Zg1ttKzVQ14WiCfwA0CNBL+poJxAED9epiEpZXc2sfMolGsoMUwtDSgfYRTPnR+Bj9z9/9en04g5vXmcKpKqMeopad9ZGekgOwUmX948LqD6PzCScjqpWJWdDCL3WvJOPs9HoMDasGVCoZlDUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760084676; h=Content-Type: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=/vSSZEI/Kr1oUdUVr1yK3MzhrrjUHh6aYDlKLtj28uw=; b=a9GAypgFCeOF8/CycWRkMGEyy+IbRSB28Xn8qulUA0xhTiA5+0dE4FzqNHYGwFv+gOyoEAmQuCyV2MH+Ul3fJJx4DXAj8QS1j764ErjHst814RcvMSM075ETWoUSxxSBaeQ3HO+HA5rSBtnXElQ5bWImKECRGrM+Yn/Nioq6mGQ= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760084676511766.6036183064408; Fri, 10 Oct 2025 01:24:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v78OI-000291-Aq; Fri, 10 Oct 2025 04:22:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78OC-00027Q-5P for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78O7-00011Z-U9 for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:11 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-34-NCLuLMl1NSyichtBCsiqdA-1; Fri, 10 Oct 2025 04:21:58 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9EBEA1956096; Fri, 10 Oct 2025 08:21:57 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.34.98]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2837E180141D; Fri, 10 Oct 2025 08:21:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760084522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/vSSZEI/Kr1oUdUVr1yK3MzhrrjUHh6aYDlKLtj28uw=; b=Pgwb4jojNA0r8MfO5UqrEMyKsDNBYtwD/ifE3FUgDrhnTtm2pZAiC2cM492KsgtZHTCVVy lfPu2i+pTVkqxfeRBCW07tztsh4so06X25WwsWvOKQvkgUwefnWvzDcbRt7Ye3U/SHOZx6 GecyaNP2XSpSH4lKN5S5wqqK5MWQWOM= X-MC-Unique: NCLuLMl1NSyichtBCsiqdA-1 X-Mimecast-MFC-AGG-ID: NCLuLMl1NSyichtBCsiqdA_1760084517 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 4/9] target/s390x: Propagate CPUS390XState to cpu_unmap_lowcore() Date: Fri, 10 Oct 2025 10:21:39 +0200 Message-ID: <20251010082145.576222-5-thuth@redhat.com> In-Reply-To: <20251010082145.576222-1-thuth@redhat.com> References: <20251010082145.576222-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.438, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 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 @redhat.com) X-ZM-MESSAGEID: 1760084676933158500 From: Philippe Mathieu-Daud=C3=A9 To be able to access the CPU state in cpu_unmap_lowcore() in the next commit, propagate it as argument. cpu_map_lowcore() already takes it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-ID: <20251002091132.65703-6-philmd@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/s390x-internal.h | 2 +- target/s390x/helper.c | 4 ++-- target/s390x/tcg/excp_helper.c | 10 +++++----- target/s390x/tcg/misc_helper.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index 56cce2e7f50..1fb752aa1d6 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -327,7 +327,7 @@ hwaddr s390_cpu_get_phys_addr_debug(CPUState *cpu, vadd= r addr); int s390_store_status(S390CPU *cpu, hwaddr addr, bool store_arch); int s390_store_adtl_status(S390CPU *cpu, hwaddr addr, hwaddr len); LowCore *cpu_map_lowcore(CPUS390XState *env); -void cpu_unmap_lowcore(LowCore *lowcore); +void cpu_unmap_lowcore(CPUS390XState *env, LowCore *lowcore); #endif /* CONFIG_USER_ONLY */ =20 =20 diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 5c127da1a6a..a6d4a1ce05d 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -117,7 +117,7 @@ LowCore *cpu_map_lowcore(CPUS390XState *env) return lowcore; } =20 -void cpu_unmap_lowcore(LowCore *lowcore) +void cpu_unmap_lowcore(CPUS390XState *env, LowCore *lowcore) { cpu_physical_memory_unmap(lowcore, sizeof(LowCore), 1, sizeof(LowCore)= ); } @@ -134,7 +134,7 @@ void do_restart_interrupt(CPUS390XState *env) mask =3D be64_to_cpu(lowcore->restart_new_psw.mask); addr =3D be64_to_cpu(lowcore->restart_new_psw.addr); =20 - cpu_unmap_lowcore(lowcore); + cpu_unmap_lowcore(env, lowcore); env->pending_int &=3D ~INTERRUPT_RESTART; =20 s390_cpu_set_psw(env, mask, addr); diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c index 5e1d4dc9583..0ae4e266065 100644 --- a/target/s390x/tcg/excp_helper.c +++ b/target/s390x/tcg/excp_helper.c @@ -285,7 +285,7 @@ static void do_program_interrupt(CPUS390XState *env) addr =3D be64_to_cpu(lowcore->program_new_psw.addr); lowcore->per_breaking_event_addr =3D cpu_to_be64(env->gbea); =20 - cpu_unmap_lowcore(lowcore); + cpu_unmap_lowcore(env, lowcore); =20 s390_cpu_set_psw(env, mask, addr); } @@ -304,7 +304,7 @@ static void do_svc_interrupt(CPUS390XState *env) mask =3D be64_to_cpu(lowcore->svc_new_psw.mask); addr =3D be64_to_cpu(lowcore->svc_new_psw.addr); =20 - cpu_unmap_lowcore(lowcore); + cpu_unmap_lowcore(env, lowcore); =20 s390_cpu_set_psw(env, mask, addr); =20 @@ -378,7 +378,7 @@ static void do_ext_interrupt(CPUS390XState *env) lowcore->external_old_psw.mask =3D cpu_to_be64(s390_cpu_get_psw_mask(e= nv)); lowcore->external_old_psw.addr =3D cpu_to_be64(env->psw.addr); =20 - cpu_unmap_lowcore(lowcore); + cpu_unmap_lowcore(env, lowcore); =20 s390_cpu_set_psw(env, mask, addr); } @@ -405,7 +405,7 @@ static void do_io_interrupt(CPUS390XState *env) mask =3D be64_to_cpu(lowcore->io_new_psw.mask); addr =3D be64_to_cpu(lowcore->io_new_psw.addr); =20 - cpu_unmap_lowcore(lowcore); + cpu_unmap_lowcore(env, lowcore); g_free(io); =20 s390_cpu_set_psw(env, mask, addr); @@ -491,7 +491,7 @@ static void do_mchk_interrupt(CPUS390XState *env) mask =3D be64_to_cpu(lowcore->mcck_new_psw.mask); addr =3D be64_to_cpu(lowcore->mcck_new_psw.addr); =20 - cpu_unmap_lowcore(lowcore); + cpu_unmap_lowcore(env, lowcore); =20 s390_cpu_set_psw(env, mask, addr); } diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c index f7101be5745..6d9d601d29a 100644 --- a/target/s390x/tcg/misc_helper.c +++ b/target/s390x/tcg/misc_helper.c @@ -570,7 +570,7 @@ uint32_t HELPER(tpi)(CPUS390XState *env, uint64_t addr) lowcore->subchannel_nr =3D cpu_to_be16(io->nr); lowcore->io_int_parm =3D cpu_to_be32(io->parm); lowcore->io_int_word =3D cpu_to_be32(io->word); - cpu_unmap_lowcore(lowcore); + cpu_unmap_lowcore(env, lowcore); } =20 g_free(io); @@ -700,7 +700,7 @@ void HELPER(stfl)(CPUS390XState *env) lowcore =3D cpu_map_lowcore(env); prepare_stfl(); memcpy(&lowcore->stfl_fac_list, stfl_bytes, sizeof(lowcore->stfl_fac_l= ist)); - cpu_unmap_lowcore(lowcore); + cpu_unmap_lowcore(env, lowcore); } #endif =20 --=20 2.51.0 From nobody Fri Nov 14 18:16:49 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1760084613; cv=none; d=zohomail.com; s=zohoarc; b=JdbZOHkrbZL9NYDRdWK+r3gnhqsMamlCF7vMf48fGhDYNpbCwdVr0rwcKB0/5m1RZLWAiYs6y7eJ/5v1ggy/8QEzya4VF3qS+rsu+opv8qXiGewv3RFUsk94bNE1Jki1X4yJEiF0fmF7OECbhHkstCT/G/8aR2MslFgHiH1phGk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760084613; h=Content-Type: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=4qF2iQktUqaSYd6/UA/G6360wiPvRXYzYs4yJ69J+Yg=; b=Pczn3uBMFf2xM2L/l3T38kUPbnMd/a+0ug+UUmq0/Cf9BgObpgvp4dPOGI+nUPgxRgo6vz/3/O0GXlr1sjbFZva/KvKALVgYQd2feHG0N6TLjgHiHUW/oH+IWevg+FlBn/s7xXsfez67DCm99+AgE2QN/BG0EaqRjlKHf+Wr8IA= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760084613213899.2072810586776; Fri, 10 Oct 2025 01:23:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v78OE-00028C-G6; Fri, 10 Oct 2025 04:22:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78OD-00027f-2s for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78O6-00016t-Sy for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:12 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-349-ebOyLaAHMTCNNoE7eEW_Kw-1; Fri, 10 Oct 2025 04:22:00 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8A78D195608F; Fri, 10 Oct 2025 08:21:59 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.34.98]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 285B01800452; Fri, 10 Oct 2025 08:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760084522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4qF2iQktUqaSYd6/UA/G6360wiPvRXYzYs4yJ69J+Yg=; b=bInZ87Q4vSc+4jkafT1TSSi3jbAErY7OKNqrTY4+kKkxd9laaaJdohyAUr4wHVhHzxzEJ6 YSl1IYEZberCaFkPNAJazHGawhMG212wCpRDO3Av9LUMImoc0051xncuKSFuQYnmICvlhC WR2fGQGjMwcH+Bm1TM8SO6dli1peeAM= X-MC-Unique: ebOyLaAHMTCNNoE7eEW_Kw-1 X-Mimecast-MFC-AGG-ID: ebOyLaAHMTCNNoE7eEW_Kw_1760084519 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 5/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (2/3) Date: Fri, 10 Oct 2025 10:21:40 +0200 Message-ID: <20251010082145.576222-6-thuth@redhat.com> In-Reply-To: <20251010082145.576222-1-thuth@redhat.com> References: <20251010082145.576222-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.438, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 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 @redhat.com) X-ZM-MESSAGEID: 1760084615213154100 From: Philippe Mathieu-Daud=C3=A9 Commit b7ecba0f6f6 ("docs/devel/loads-stores.rst: Document our various load and store APIs") mentioned cpu_physical_memory_*() methods are legacy, the replacement being address_space_*(). Replace the *_map() / *_unmap() methods in cpu_[un]map_lowcore(). No behavioral change expected. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-ID: <20251002091132.65703-7-philmd@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/helper.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/target/s390x/helper.c b/target/s390x/helper.c index a6d4a1ce05d..b01b7d9bbbf 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -26,6 +26,7 @@ #include "hw/s390x/ioinst.h" #include "target/s390x/kvm/pv.h" #include "system/hw_accel.h" +#include "system/memory.h" #include "system/runstate.h" #include "exec/target_page.h" #include "exec/watchpoint.h" @@ -107,11 +108,13 @@ LowCore *cpu_map_lowcore(CPUS390XState *env) { LowCore *lowcore; hwaddr len =3D sizeof(LowCore); + CPUState *cs =3D env_cpu(env); + const MemTxAttrs attrs =3D MEMTXATTRS_UNSPECIFIED; =20 - lowcore =3D cpu_physical_memory_map(env->psa, &len, true); + lowcore =3D address_space_map(cs->as, env->psa, &len, true, attrs); =20 if (len < sizeof(LowCore)) { - cpu_abort(env_cpu(env), "Could not map lowcore\n"); + cpu_abort(cs, "Could not map lowcore\n"); } =20 return lowcore; @@ -119,7 +122,9 @@ LowCore *cpu_map_lowcore(CPUS390XState *env) =20 void cpu_unmap_lowcore(CPUS390XState *env, LowCore *lowcore) { - cpu_physical_memory_unmap(lowcore, sizeof(LowCore), 1, sizeof(LowCore)= ); + AddressSpace *as =3D env_cpu(env)->as; + + address_space_unmap(as, lowcore, sizeof(LowCore), true, sizeof(LowCore= )); } =20 void do_restart_interrupt(CPUS390XState *env) --=20 2.51.0 From nobody Fri Nov 14 18:16:49 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1760084675; cv=none; d=zohomail.com; s=zohoarc; b=eDD/yX51X4lqaSTDThpq6L32of+mOKjxCgq+okz8bnD97Tf282viQvHuqrPnKVQEL+PacX0wffNpd9YKeREPqhM2GA4fQHsBiwbU2rMIQxhDf6mHoRarjHmqWJ5kk0OzOV1ySq0h/+JSlyHMTmGyIgG0AiJ4m1JdH9rtYF2oAhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760084675; h=Content-Type: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=2ifzQRiT3Skm5xCdzRm4x7W/pYp3IEbzx1NvAaNKLhE=; b=YSPCyf0vfYxQ7rC/3L3Y3j0aJHhMIWXfr/bsM7YJLVMw3Aa4HrNLzCvsDFz9rFXRoWuiaALmFTUTez4JWGivo8APLc35ryObJsrWanc6ZF4wK9aOCPFTgzPQsaPHVLI/WEE7Hyr1NbemXw+hhSftRI5qiGxPq4I4wlzSFq+WJKc= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760084675221228.5591105615348; Fri, 10 Oct 2025 01:24:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v78OI-00029K-0C; Fri, 10 Oct 2025 04:22:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78OF-00028E-2N for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78O6-000182-UX for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:14 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-522-XgTDX_7SNoKWLHOQpX4-LA-1; Fri, 10 Oct 2025 04:22:02 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 92ECD1800451; Fri, 10 Oct 2025 08:22:01 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.34.98]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 204211800452; Fri, 10 Oct 2025 08:21:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760084524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ifzQRiT3Skm5xCdzRm4x7W/pYp3IEbzx1NvAaNKLhE=; b=M3/uk7bnRHp5m3V5kLxeAB6vTDNa9TBcWHPy3nkuTMC2NSLvnYaYg+qt3prepSTnhTCw7/ 1o0udJMMO82pHTMt7w2RaRkIIsZ4YI4m+sv3ynrwQdXRdS5zbE7LuEx/HwpjNqW56iBxUm UtcVJQrVn5ugEKqAZXdbquhvKJAj0KM= X-MC-Unique: XgTDX_7SNoKWLHOQpX4-LA-1 X-Mimecast-MFC-AGG-ID: XgTDX_7SNoKWLHOQpX4-LA_1760084521 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 6/9] target/s390x: Reduce s390_store_adtl_status() scope Date: Fri, 10 Oct 2025 10:21:41 +0200 Message-ID: <20251010082145.576222-7-thuth@redhat.com> In-Reply-To: <20251010082145.576222-1-thuth@redhat.com> References: <20251010082145.576222-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.438, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 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 @redhat.com) X-ZM-MESSAGEID: 1760084681011158500 From: Philippe Mathieu-Daud=C3=A9 s390_store_adtl_status() is only called within sigp.c, move it and the SigpAdtlSaveArea structure definition there where it belongs, with other SIGP handling code. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-ID: <20251002091132.65703-8-philmd@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/s390x-internal.h | 1 - target/s390x/helper.c | 40 ----------------------------------- target/s390x/sigp.c | 40 +++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 41 deletions(-) diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index 1fb752aa1d6..a49dca94a75 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -325,7 +325,6 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cpu, vadd= r addr); hwaddr s390_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); #define S390_STORE_STATUS_DEF_ADDR offsetof(LowCore, floating_pt_save_area) int s390_store_status(S390CPU *cpu, hwaddr addr, bool store_arch); -int s390_store_adtl_status(S390CPU *cpu, hwaddr addr, hwaddr len); LowCore *cpu_map_lowcore(CPUS390XState *env); void cpu_unmap_lowcore(CPUS390XState *env, LowCore *lowcore); #endif /* CONFIG_USER_ONLY */ diff --git a/target/s390x/helper.c b/target/s390x/helper.c index b01b7d9bbbf..84321e1d68e 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -248,43 +248,3 @@ int s390_store_status(S390CPU *cpu, hwaddr addr, bool = store_arch) =20 return 0; } - -typedef struct SigpAdtlSaveArea { - uint64_t vregs[32][2]; /* 0x0000 */ - uint8_t pad_0x0200[0x0400 - 0x0200]; /* 0x0200 */ - uint64_t gscb[4]; /* 0x0400 */ - uint8_t pad_0x0420[0x1000 - 0x0420]; /* 0x0420 */ -} SigpAdtlSaveArea; -QEMU_BUILD_BUG_ON(sizeof(SigpAdtlSaveArea) !=3D 4096); - -#define ADTL_GS_MIN_SIZE 2048 /* minimal size of adtl save area for GS */ -int s390_store_adtl_status(S390CPU *cpu, hwaddr addr, hwaddr len) -{ - SigpAdtlSaveArea *sa; - hwaddr save =3D len; - int i; - - sa =3D cpu_physical_memory_map(addr, &save, true); - if (!sa) { - return -EFAULT; - } - if (save !=3D len) { - cpu_physical_memory_unmap(sa, len, 1, 0); - return -EFAULT; - } - - if (s390_has_feat(S390_FEAT_VECTOR)) { - for (i =3D 0; i < 32; i++) { - sa->vregs[i][0] =3D cpu_to_be64(cpu->env.vregs[i][0]); - sa->vregs[i][1] =3D cpu_to_be64(cpu->env.vregs[i][1]); - } - } - if (s390_has_feat(S390_FEAT_GUARDED_STORAGE) && len >=3D ADTL_GS_MIN_S= IZE) { - for (i =3D 0; i < 4; i++) { - sa->gscb[i] =3D cpu_to_be64(cpu->env.gscb[i]); - } - } - - cpu_physical_memory_unmap(sa, len, 1, len); - return 0; -} diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index 5e95c4978f9..1464be76983 100644 --- a/target/s390x/sigp.c +++ b/target/s390x/sigp.c @@ -172,6 +172,46 @@ static void sigp_store_status_at_address(CPUState *cs,= run_on_cpu_data arg) si->cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; } =20 +typedef struct SigpAdtlSaveArea { + uint64_t vregs[32][2]; /* 0x0000 */ + uint8_t pad_0x0200[0x0400 - 0x0200]; /* 0x0200 */ + uint64_t gscb[4]; /* 0x0400 */ + uint8_t pad_0x0420[0x1000 - 0x0420]; /* 0x0420 */ +} SigpAdtlSaveArea; +QEMU_BUILD_BUG_ON(sizeof(SigpAdtlSaveArea) !=3D 4096); + +#define ADTL_GS_MIN_SIZE 2048 /* minimal size of adtl save area for GS */ +static int s390_store_adtl_status(S390CPU *cpu, hwaddr addr, hwaddr len) +{ + SigpAdtlSaveArea *sa; + hwaddr save =3D len; + int i; + + sa =3D cpu_physical_memory_map(addr, &save, true); + if (!sa) { + return -EFAULT; + } + if (save !=3D len) { + cpu_physical_memory_unmap(sa, len, 1, 0); + return -EFAULT; + } + + if (s390_has_feat(S390_FEAT_VECTOR)) { + for (i =3D 0; i < 32; i++) { + sa->vregs[i][0] =3D cpu_to_be64(cpu->env.vregs[i][0]); + sa->vregs[i][1] =3D cpu_to_be64(cpu->env.vregs[i][1]); + } + } + if (s390_has_feat(S390_FEAT_GUARDED_STORAGE) && len >=3D ADTL_GS_MIN_S= IZE) { + for (i =3D 0; i < 4; i++) { + sa->gscb[i] =3D cpu_to_be64(cpu->env.gscb[i]); + } + } + + cpu_physical_memory_unmap(sa, len, 1, len); + return 0; +} + #define ADTL_SAVE_LC_MASK 0xfUL static void sigp_store_adtl_status(CPUState *cs, run_on_cpu_data arg) { --=20 2.51.0 From nobody Fri Nov 14 18:16:49 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1760084666; cv=none; d=zohomail.com; s=zohoarc; b=P3tu1o+789qhEtraB36jnM0x44jq81uZhulQ0bTEUlX/JgXmrAwiJHLCawhobM578fmSzKjjTjzqkaHtXE/ugMuRygpfiH+xnOYgzOh9CocFpkuqCyE7mCOziqAoTjsF+qv+3JcSQoYgMhOsXsVIGe9MgE6esDWcDkg5g+L2ENo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760084666; h=Content-Type: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=ehK5KRXCiUTeLGRom/AV7O2rUmdoOhUIvkIjSYXTaw4=; b=ni3nK8FSr01cFKQzk5HdWI50O/bedmEptFtsZKtWpeJrsZIuszMUz7mNg6m5/wYkzM2LJxrfo/WVvQ6P0/3xNfL2t5xSrzKcpeMlktA9fMeYYxGiC3johVocZmdOEjrrF5CgeWvEjTVDSxcbk3x6Xz2xPacM2YoqrVzxVZhFlfk= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760084666992749.9999886689832; Fri, 10 Oct 2025 01:24:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v78OK-00029i-AS; Fri, 10 Oct 2025 04:22:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78OI-00029O-Dv for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78O8-00018H-WE for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:17 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-614-VfZd5VAhO9WV5ULh8Kqd2w-1; Fri, 10 Oct 2025 04:22:04 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 95D9C19560BB; Fri, 10 Oct 2025 08:22:03 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.34.98]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 291D21800452; Fri, 10 Oct 2025 08:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760084525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ehK5KRXCiUTeLGRom/AV7O2rUmdoOhUIvkIjSYXTaw4=; b=bZCnZphnZs6AxNij/nbzjSFjHm8EFsg3KQXIfIZu695d0fDSgJo5eHT3YL4A1G/qjw1B7H Rb0VOlYc4HQFKLVvESuDEnWO5NoPPbM4Rk3FIrcvmQsc+mqGvCc2cMcGy7nSAMpB5BMaky uAL7gTzwR5aYg7MMmLh9qCRrtniMmkI= X-MC-Unique: VfZd5VAhO9WV5ULh8Kqd2w-1 X-Mimecast-MFC-AGG-ID: VfZd5VAhO9WV5ULh8Kqd2w_1760084523 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 7/9] target/s390x: Reduce s390_store_status() scope Date: Fri, 10 Oct 2025 10:21:42 +0200 Message-ID: <20251010082145.576222-8-thuth@redhat.com> In-Reply-To: <20251010082145.576222-1-thuth@redhat.com> References: <20251010082145.576222-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.438, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 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: 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 @redhat.com) X-ZM-MESSAGEID: 1760084681069158500 From: Philippe Mathieu-Daud=C3=A9 s390_store_status() is only called within sigp.c, move it and the SigpSaveArea structure definition there where it belongs, with other SIGP handling code. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-ID: <20251002091132.65703-9-philmd@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/s390x-internal.h | 2 -- target/s390x/helper.c | 67 ---------------------------------- target/s390x/sigp.c | 68 +++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 69 deletions(-) diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index a49dca94a75..9691366ec91 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -323,8 +323,6 @@ void s390x_cpu_timer(void *opaque); void s390_handle_wait(S390CPU *cpu); hwaddr s390_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); hwaddr s390_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); -#define S390_STORE_STATUS_DEF_ADDR offsetof(LowCore, floating_pt_save_area) -int s390_store_status(S390CPU *cpu, hwaddr addr, bool store_arch); LowCore *cpu_map_lowcore(CPUS390XState *env); void cpu_unmap_lowcore(CPUS390XState *env, LowCore *lowcore); #endif /* CONFIG_USER_ONLY */ diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 84321e1d68e..184428c6d9d 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -24,7 +24,6 @@ #include "gdbstub/helpers.h" #include "qemu/timer.h" #include "hw/s390x/ioinst.h" -#include "target/s390x/kvm/pv.h" #include "system/hw_accel.h" #include "system/memory.h" #include "system/runstate.h" @@ -182,69 +181,3 @@ void s390_cpu_recompute_watchpoints(CPUState *cs) wp_flags, NULL); } } - -typedef struct SigpSaveArea { - uint64_t fprs[16]; /* 0x0000 */ - uint64_t grs[16]; /* 0x0080 */ - PSW psw; /* 0x0100 */ - uint8_t pad_0x0110[0x0118 - 0x0110]; /* 0x0110 */ - uint32_t prefix; /* 0x0118 */ - uint32_t fpc; /* 0x011c */ - uint8_t pad_0x0120[0x0124 - 0x0120]; /* 0x0120 */ - uint32_t todpr; /* 0x0124 */ - uint64_t cputm; /* 0x0128 */ - uint64_t ckc; /* 0x0130 */ - uint8_t pad_0x0138[0x0140 - 0x0138]; /* 0x0138 */ - uint32_t ars[16]; /* 0x0140 */ - uint64_t crs[16]; /* 0x0384 */ -} SigpSaveArea; -QEMU_BUILD_BUG_ON(sizeof(SigpSaveArea) !=3D 512); - -int s390_store_status(S390CPU *cpu, hwaddr addr, bool store_arch) -{ - static const uint8_t ar_id =3D 1; - SigpSaveArea *sa; - hwaddr len =3D sizeof(*sa); - int i; - - /* For PVMs storing will occur when this cpu enters SIE again */ - if (s390_is_pv()) { - return 0; - } - - sa =3D cpu_physical_memory_map(addr, &len, true); - if (!sa) { - return -EFAULT; - } - if (len !=3D sizeof(*sa)) { - cpu_physical_memory_unmap(sa, len, 1, 0); - return -EFAULT; - } - - if (store_arch) { - cpu_physical_memory_write(offsetof(LowCore, ar_access_id), &ar_id,= 1); - } - for (i =3D 0; i < 16; ++i) { - sa->fprs[i] =3D cpu_to_be64(*get_freg(&cpu->env, i)); - } - for (i =3D 0; i < 16; ++i) { - sa->grs[i] =3D cpu_to_be64(cpu->env.regs[i]); - } - sa->psw.addr =3D cpu_to_be64(cpu->env.psw.addr); - sa->psw.mask =3D cpu_to_be64(s390_cpu_get_psw_mask(&cpu->env)); - sa->prefix =3D cpu_to_be32(cpu->env.psa); - sa->fpc =3D cpu_to_be32(cpu->env.fpc); - sa->todpr =3D cpu_to_be32(cpu->env.todpr); - sa->cputm =3D cpu_to_be64(cpu->env.cputm); - sa->ckc =3D cpu_to_be64(cpu->env.ckc >> 8); - for (i =3D 0; i < 16; ++i) { - sa->ars[i] =3D cpu_to_be32(cpu->env.aregs[i]); - } - for (i =3D 0; i < 16; ++i) { - sa->crs[i] =3D cpu_to_be64(cpu->env.cregs[i]); - } - - cpu_physical_memory_unmap(sa, len, 1, len); - - return 0; -} diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index 1464be76983..2487acdb49e 100644 --- a/target/s390x/sigp.c +++ b/target/s390x/sigp.c @@ -19,6 +19,7 @@ #include "system/tcg.h" #include "trace.h" #include "qapi/qapi-types-machine.h" +#include "target/s390x/kvm/pv.h" =20 QemuMutex qemu_sigp_mutex; =20 @@ -126,6 +127,73 @@ static void sigp_stop(CPUState *cs, run_on_cpu_data ar= g) si->cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; } =20 +typedef struct SigpSaveArea { + uint64_t fprs[16]; /* 0x0000 */ + uint64_t grs[16]; /* 0x0080 */ + PSW psw; /* 0x0100 */ + uint8_t pad_0x0110[0x0118 - 0x0110]; /* 0x0110 */ + uint32_t prefix; /* 0x0118 */ + uint32_t fpc; /* 0x011c */ + uint8_t pad_0x0120[0x0124 - 0x0120]; /* 0x0120 */ + uint32_t todpr; /* 0x0124 */ + uint64_t cputm; /* 0x0128 */ + uint64_t ckc; /* 0x0130 */ + uint8_t pad_0x0138[0x0140 - 0x0138]; /* 0x0138 */ + uint32_t ars[16]; /* 0x0140 */ + uint64_t crs[16]; /* 0x0384 */ +} SigpSaveArea; +QEMU_BUILD_BUG_ON(sizeof(SigpSaveArea) !=3D 512); + +#define S390_STORE_STATUS_DEF_ADDR offsetof(LowCore, floating_pt_save_area) +static int s390_store_status(S390CPU *cpu, hwaddr addr, bool store_arch) +{ + static const uint8_t ar_id =3D 1; + SigpSaveArea *sa; + hwaddr len =3D sizeof(*sa); + int i; + + /* For PVMs storing will occur when this cpu enters SIE again */ + if (s390_is_pv()) { + return 0; + } + + sa =3D cpu_physical_memory_map(addr, &len, true); + if (!sa) { + return -EFAULT; + } + if (len !=3D sizeof(*sa)) { + cpu_physical_memory_unmap(sa, len, 1, 0); + return -EFAULT; + } + + if (store_arch) { + cpu_physical_memory_write(offsetof(LowCore, ar_access_id), &ar_id,= 1); + } + for (i =3D 0; i < 16; ++i) { + sa->fprs[i] =3D cpu_to_be64(*get_freg(&cpu->env, i)); + } + for (i =3D 0; i < 16; ++i) { + sa->grs[i] =3D cpu_to_be64(cpu->env.regs[i]); + } + sa->psw.addr =3D cpu_to_be64(cpu->env.psw.addr); + sa->psw.mask =3D cpu_to_be64(s390_cpu_get_psw_mask(&cpu->env)); + sa->prefix =3D cpu_to_be32(cpu->env.psa); + sa->fpc =3D cpu_to_be32(cpu->env.fpc); + sa->todpr =3D cpu_to_be32(cpu->env.todpr); + sa->cputm =3D cpu_to_be64(cpu->env.cputm); + sa->ckc =3D cpu_to_be64(cpu->env.ckc >> 8); + for (i =3D 0; i < 16; ++i) { + sa->ars[i] =3D cpu_to_be32(cpu->env.aregs[i]); + } + for (i =3D 0; i < 16; ++i) { + sa->crs[i] =3D cpu_to_be64(cpu->env.cregs[i]); + } + + cpu_physical_memory_unmap(sa, len, 1, len); + + return 0; +} + static void sigp_stop_and_store_status(CPUState *cs, run_on_cpu_data arg) { S390CPU *cpu =3D S390_CPU(cs); --=20 2.51.0 From nobody Fri Nov 14 18:16:49 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1760084635; cv=none; d=zohomail.com; s=zohoarc; b=P7LeCT3dhQlvH8VSGTx5cMndkskN9ObuITA+evvObmzFelk3wV8/Xto/MYPMvoXGE1iNFVa91N7EhGNgFW6ppUHXdHZCKPeIqZq4w8EiyVG14Agn2pXJS2P48P9YKWvbxpT8oZU/gl+ctSRdchG3QWxUFaieQaF980ISnMIgu7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760084635; h=Content-Type: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=kN1hftEnvVvBVOyTPgXuryjh2sa8FXlMQCoo5OJbylY=; b=DCnXKC0dXCzZxQoy8y4x/SeUEqP2Hyvpy5k88kudBmNxLsCaTR+t07oT16nhXByKId37ruo+zdqyL4Bh6XP1ML3oHCxulngBmxtPgCBo6uP/eURUpTqxYYxEHVoV+UayWBlvKgDsoSSTCBEGZSEuGLjFVhXM6akiu/WikVmNxJ8= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760084635084123.8032050865578; Fri, 10 Oct 2025 01:23:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v78OH-000292-Ob; Fri, 10 Oct 2025 04:22:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78OF-00028F-4T for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78O9-00018o-G2 for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:14 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-443-_H1qvcEqN36b20i0GAhZ9A-1; Fri, 10 Oct 2025 04:22:06 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8BCF9180034F; Fri, 10 Oct 2025 08:22:05 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.34.98]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2579F1800446; Fri, 10 Oct 2025 08:22:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760084528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kN1hftEnvVvBVOyTPgXuryjh2sa8FXlMQCoo5OJbylY=; b=gZAekeU90zZono5gNioezBDEFbqjDuq1UZ/gDUMCZAfpjLoGCe7zOm61QfnePYtVSkkv/U L4TkoQudzFtrQfs9JQ/g+8Q+ySbSe1ROzo+RGxaOgB0TcqHxJDqbr/xJoOYvC+P/OPUSGT 6ZZAV4zctVNTRXPqtQaqlpef7226lkY= X-MC-Unique: _H1qvcEqN36b20i0GAhZ9A-1 X-Mimecast-MFC-AGG-ID: _H1qvcEqN36b20i0GAhZ9A_1760084525 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 8/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (3/3) Date: Fri, 10 Oct 2025 10:21:43 +0200 Message-ID: <20251010082145.576222-9-thuth@redhat.com> In-Reply-To: <20251010082145.576222-1-thuth@redhat.com> References: <20251010082145.576222-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.438, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 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 @redhat.com) X-ZM-MESSAGEID: 1760084636645154100 From: Philippe Mathieu-Daud=C3=A9 Commit b7ecba0f6f6 ("docs/devel/loads-stores.rst: Document our various load and store APIs") mentioned cpu_physical_memory_*() methods are legacy, the replacement being address_space_*(). Replace the *_map() / *_unmap() methods in s390_store_status() and s390_store_adtl_status(). In s390_store_status(), replace cpu_physical_memory_write() by address_space_stb(), restricting @ar_id scope. No behavioral change expected. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251002091132.65703-10-philmd@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/sigp.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index 2487acdb49e..f5d7bc0fa22 100644 --- a/target/s390x/sigp.c +++ b/target/s390x/sigp.c @@ -13,6 +13,7 @@ #include "s390x-internal.h" #include "hw/boards.h" #include "system/hw_accel.h" +#include "system/memory.h" #include "system/runstate.h" #include "system/address-spaces.h" #include "exec/cputlb.h" @@ -147,7 +148,8 @@ QEMU_BUILD_BUG_ON(sizeof(SigpSaveArea) !=3D 512); #define S390_STORE_STATUS_DEF_ADDR offsetof(LowCore, floating_pt_save_area) static int s390_store_status(S390CPU *cpu, hwaddr addr, bool store_arch) { - static const uint8_t ar_id =3D 1; + const MemTxAttrs attrs =3D MEMTXATTRS_UNSPECIFIED; + AddressSpace *as =3D CPU(cpu)->as; SigpSaveArea *sa; hwaddr len =3D sizeof(*sa); int i; @@ -157,17 +159,21 @@ static int s390_store_status(S390CPU *cpu, hwaddr add= r, bool store_arch) return 0; } =20 - sa =3D cpu_physical_memory_map(addr, &len, true); + sa =3D address_space_map(as, addr, &len, true, attrs); if (!sa) { return -EFAULT; } if (len !=3D sizeof(*sa)) { - cpu_physical_memory_unmap(sa, len, 1, 0); + address_space_unmap(as, sa, len, true, 0); return -EFAULT; } =20 if (store_arch) { - cpu_physical_memory_write(offsetof(LowCore, ar_access_id), &ar_id,= 1); + static const uint8_t ar_id =3D 1; + + address_space_stb(as, offsetof(LowCore, ar_access_id), + ar_id, attrs, NULL); + } for (i =3D 0; i < 16; ++i) { sa->fprs[i] =3D cpu_to_be64(*get_freg(&cpu->env, i)); @@ -189,7 +195,7 @@ static int s390_store_status(S390CPU *cpu, hwaddr addr,= bool store_arch) sa->crs[i] =3D cpu_to_be64(cpu->env.cregs[i]); } =20 - cpu_physical_memory_unmap(sa, len, 1, len); + address_space_unmap(as, sa, len, true, len); =20 return 0; } @@ -251,16 +257,18 @@ QEMU_BUILD_BUG_ON(sizeof(SigpAdtlSaveArea) !=3D 4096); #define ADTL_GS_MIN_SIZE 2048 /* minimal size of adtl save area for GS */ static int s390_store_adtl_status(S390CPU *cpu, hwaddr addr, hwaddr len) { + const MemTxAttrs attrs =3D MEMTXATTRS_UNSPECIFIED; + AddressSpace *as =3D CPU(cpu)->as; SigpAdtlSaveArea *sa; hwaddr save =3D len; int i; =20 - sa =3D cpu_physical_memory_map(addr, &save, true); + sa =3D address_space_map(as, addr, &save, true, attrs); if (!sa) { return -EFAULT; } if (save !=3D len) { - cpu_physical_memory_unmap(sa, len, 1, 0); + address_space_unmap(as, sa, len, true, 0); return -EFAULT; } =20 @@ -276,7 +284,8 @@ static int s390_store_adtl_status(S390CPU *cpu, hwaddr = addr, hwaddr len) } } =20 - cpu_physical_memory_unmap(sa, len, 1, len); + address_space_unmap(as, sa, len, true, len); + return 0; } =20 --=20 2.51.0 From nobody Fri Nov 14 18:16:49 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1760084616; cv=none; d=zohomail.com; s=zohoarc; b=N1p6utvhBg/njE1Gl1PyBVqv2FxC9SSYnb/B488UvnAuufdirNTae/BFrYbsXVqqMlBCmn5dDwKqYKF5ScuSp1jLPsAmvVriZJA2ZzvMJRfNaDlzYQ6iJzTx9HlWlL6LwHOtd5tuWBWsNBFqljPJCg288KRovaadM5UJe06Fpwc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760084616; 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=GkEwpiKaLxBSUhV5xR+XfwVb/cPt8uBBF9xkbsKEvGo=; b=klyCL4Jxs0vbjbO2soeSdzfSHpdsBLYRCqV+MPrFNun2OFjax2ilHsetD1scQPOyaNwD2e0Z6qgqwx2fuZ6iE4tXHKThSlT492/lgbSeO90RuMv2QkJUL4O0OKtRY9k8trmGG4XtNBDQZY0D8KHmda4jm1dODj46HNMLQJFi7iA= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760084616322126.65593358592594; Fri, 10 Oct 2025 01:23:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v78OP-0002BS-A6; Fri, 10 Oct 2025 04:22:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78OL-0002AV-BA for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v78OF-0001Bc-ND for qemu-devel@nongnu.org; Fri, 10 Oct 2025 04:22:21 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-674-bX2RmarzP12cibn2KWB0Tg-1; Fri, 10 Oct 2025 04:22:09 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2E8B7180057C; Fri, 10 Oct 2025 08:22:08 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.34.98]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 21BA51800452; Fri, 10 Oct 2025 08:22:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760084534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GkEwpiKaLxBSUhV5xR+XfwVb/cPt8uBBF9xkbsKEvGo=; b=NM4lUQ/11zgjEASPZvUbFVTaH8owT0v0qmAnubVCETfvrbzsXwRknqe3bBPwurkTx0aArs 21ZjlyyixSP7OXJNjuqoGqC0L/l3nDdNzhu3avW8CxUBeebXdvO350oozH4EayCDjyAjJu 6m8LtxAxp8MfikDFiwGDP0KMn8m0EUk= X-MC-Unique: bX2RmarzP12cibn2KWB0Tg-1 X-Mimecast-MFC-AGG-ID: bX2RmarzP12cibn2KWB0Tg_1760084528 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , Matthew Rosato , Farhan Ali , Eric Farman Subject: [PULL 9/9] s390x/pci: set kvm_msi_via_irqfd_allowed Date: Fri, 10 Oct 2025 10:21:44 +0200 Message-ID: <20251010082145.576222-10-thuth@redhat.com> In-Reply-To: <20251010082145.576222-1-thuth@redhat.com> References: <20251010082145.576222-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.438, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 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 @redhat.com) X-ZM-MESSAGEID: 1760084618308154100 Content-Type: text/plain; charset="utf-8" From: Matthew Rosato Allow irqfd to be used for virtio-pci on s390x if the kernel supports it. This improves s390x virtio-pci performance when using kvm acceleration by allowing kvm to deliver interrupts instead of QEMU. Signed-off-by: Matthew Rosato Reviewed-by: Farhan Ali Reviewed-by: Eric Farman Message-ID: <20251008203350.354121-1-mjrosato@linux.ibm.com> Signed-off-by: Thomas Huth --- include/hw/s390x/s390-pci-kvm.h | 7 +++++++ hw/s390x/s390-pci-bus.c | 1 + 2 files changed, 8 insertions(+) diff --git a/include/hw/s390x/s390-pci-kvm.h b/include/hw/s390x/s390-pci-kv= m.h index 933814a4025..c33f2833a3c 100644 --- a/include/hw/s390x/s390-pci-kvm.h +++ b/include/hw/s390x/s390-pci-kvm.h @@ -14,12 +14,19 @@ =20 #include "hw/s390x/s390-pci-bus.h" #include "hw/s390x/s390-pci-inst.h" +#include "system/kvm.h" =20 #ifdef CONFIG_KVM +static inline void s390_pcihost_kvm_realize(void) +{ + kvm_msi_via_irqfd_allowed =3D kvm_irqfds_enabled(); +} + bool s390_pci_kvm_interp_allowed(void); int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool as= sist); int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev); #else +static inline void s390_pcihost_kvm_realize(void) {} static inline bool s390_pci_kvm_interp_allowed(void) { return false; diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index e8e41c8a9a1..52820894fa1 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -900,6 +900,7 @@ static void s390_pcihost_realize(DeviceState *dev, Erro= r **errp) s390_pci_init_default_group(); css_register_io_adapters(CSS_IO_ADAPTER_PCI, true, false, S390_ADAPTER_SUPPRESSIBLE, errp); + s390_pcihost_kvm_realize(); } =20 static void s390_pcihost_unrealize(DeviceState *dev) --=20 2.51.0