From nobody Sun Mar 22 15:40:21 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1773946366; cv=none; d=zohomail.com; s=zohoarc; b=ZHB67UhXAxfFCta+njicDID0o8tERLzbOM/M9ipjSPA1l9OjYR+kTXITjAPRzn8gZ3cB9GAUA+XwiBouEHrpj/D15L3pEL6UPVZPdCg8JinFFZASxbWm83+VMlFMpliDeeSMXqphQM6IHd5ypaGusszREfuLnM3Sg4JsWHcVOqA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773946366; 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=99Agaah8svWMvp88jjgollb/i/IbGwJRUZgPwXncGK8=; b=MdOwfyzeSXKwVATKerGWHzw7sa1iSlhnZih1LNkX1voTCi1wwEwfeJ//FgxeHcQWsh2OiR4mqbQtBPUzCrjBN+9M6YCzqRBJAOMvgPW86s+TvqUyGSUZdzEcH2iTroyw8EZxUxwdyLcItVAlgPZgbCipJjblzPc/a8kBx7e6n2Q= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773946366215645.2972321678035; Thu, 19 Mar 2026 11:52:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w3ITl-0003Kb-I0; Thu, 19 Mar 2026 14:52: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 1w3ITj-0003Jj-6Y for qemu-devel@nongnu.org; Thu, 19 Mar 2026 14:52:19 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w3ITg-0000zU-Vc for qemu-devel@nongnu.org; Thu, 19 Mar 2026 14:52:18 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-483487335c2so9769215e9.2 for ; Thu, 19 Mar 2026 11:52:16 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486fe6d9896sm8408145e9.2.2026.03.19.11.52.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Mar 2026 11:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773946334; x=1774551134; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=99Agaah8svWMvp88jjgollb/i/IbGwJRUZgPwXncGK8=; b=XAOLDHQwoThKWVTUvvVXwrPn6RxvuTAHKqn638ge+pYQXfkAb86u31LiVcrx4xWd1Y I8BeSwp8B0lQB0VFtFR/9l4MEmyiMHNDZvO0aZwPFgo8OKxyHxprOUkjEvwfAN+VLMNP bwgNZ+j7iB8kcU89Ts+yiXgbuH7mc4X4h9pDLFNAhIzMSXv8Cc1Kv32gqOyqTxHvPEJl rdtrWE/S0RapyCGeAcrgJjMOpgo/rHSsKozYDcHDtgDd9HQi4p/6T2z/e/YNBaxVWAcS IGSojXffp0SWq8z/LfsIUasMXqkF3849/N4LA2D5T7jAPH14cDBlDz0TzGA1/zUXKZ9C sjmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773946334; x=1774551134; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=99Agaah8svWMvp88jjgollb/i/IbGwJRUZgPwXncGK8=; b=I16nT0UE6osTaL0MwuygKsFx8k67pzvLokgiPDbg6x7Ha+NjBsDDsG1TN6VG1u3p9L dAUs1o06DTzvokhAb0/zMIoelCtmSrOQcEXU8s/5UaUyy04ck1KgtrF8ZF71is9MhpQF EdSI7MeyrWtq0wn0RYDpET2UkwaRHibJfC571ftnrV8ydNvoH6Gh8CEo5zfy1bKAv75S VHyLQINgmNRz41/WUjia6Mq8wDcqQ64ZA/fGX/Kyjx+1v4H0dNX+XY1W4KAnd3MY3DqC RwxvXCfKteEyEJnMRVKgIDHbmZYrJLmxTYctSpODcM3SKdtZrhipmd6bxtHVM3mQS5hc TK1Q== X-Gm-Message-State: AOJu0YzUQbIWWKfxTjDyRmcvTYtYew8BYkMBzFqIknMY5IfYFEI+Dhi4 yZLMj4coRibB7Q2l+o/jgDDk3enyvjBYgTgFx5EY6rhjGBVTMHzFPHxR7CKUWNYYgfMlDSxHnLw bxb1vZNo= X-Gm-Gg: ATEYQzy4B0kAZCkqcNHfOUoI5rT3L33iSymhzMj0iDJrsnPJm+2RcP4kx4Qx6eYIxN0 ozWMAvzcTRmZYbhg1pynNm4sxUNrj9l6+fgAXJXT1WYhJznpcN0aJPODiaec9ZbCqL5GUjOKzCq S8C/5cxnnsP2hw48UNMuYu5ONGQ6j21YpynMsiNGgwRWb+bhq5OeInV9VpD7QgpxDMnZUALJ78T DwO+wbEklD5Tr3uBgFJdgYrBRWZ7GC6kshWhoHc/94fIwQkDcOHFgqZJCMmesgR7Y5ANJXx/ODV ADsdHg0SijiIpmtuMCFy5spZsx+nhNee9e3oIuGX+wPrIUN9ogPnCUCeZH0rHQDJLIG/p+uo+nA Zxg/8L5u7Oz5uHCXV3MyWe/ReQ/IS9E5oBNna7jmgr9ASb8vb75yekxNgO1aHE2hVEe/DDtGfyB 9+h6vVwe635UnxjqYqXPa12SKZVQtvOV5CeH3jT8Vw2tIDZuuXJ8L+jh4pZJysz2fj4m1xoN4R X-Received: by 2002:a05:600c:3d90:b0:485:3c8f:e4d9 with SMTP id 5b1f17b1804b1-486fee1d9e6mr2730975e9.26.1773946334418; Thu, 19 Mar 2026 11:52:14 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Ilya Leoshkevich , Anton Johansson , Eric Farman , Christian Borntraeger , Matthew Rosato , Richard Henderson , Halil Pasic , qemu-s390x@nongnu.org, David Hildenbrand , Cornelia Huck , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/5] target/s390x: Replace legacy ld/st_phys -> address_space_ld/st (cpu) Date: Thu, 19 Mar 2026 19:51:59 +0100 Message-ID: <20260319185203.11799-2-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260319185203.11799-1-philmd@linaro.org> References: <20260319185203.11799-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1773946367338158500 Prefer the address_space_ld/st API over the legacy ld_phys() because it allow checking for bus access fault. This code however doesn't check for fault, so we simply inline the calls (not specifying any memory transaction attribute nor expecting transation result). No logical change intended. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/s390x/tcg/excp_helper.c | 21 +++++++++++++-------- target/s390x/tcg/mem_helper.c | 12 +++++++----- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c index 41b0017d767..05e448d3f20 100644 --- a/target/s390x/tcg/excp_helper.c +++ b/target/s390x/tcg/excp_helper.c @@ -54,8 +54,9 @@ G_NORETURN void tcg_s390_data_exception(CPUS390XState *en= v, uint32_t dxc, g_assert(dxc <=3D 0xff); #if !defined(CONFIG_USER_ONLY) /* Store the DXC into the lowcore */ - stl_be_phys(env_cpu(env)->as, - env->psa + offsetof(LowCore, data_exc_code), dxc); + address_space_stl_be(env_cpu(env)->as, + env->psa + offsetof(LowCore, data_exc_code), dxc, + MEMTXATTRS_UNSPECIFIED, NULL); #endif =20 /* Store the DXC into the FPC if AFP is enabled */ @@ -71,8 +72,9 @@ G_NORETURN void tcg_s390_vector_exception(CPUS390XState *= env, uint32_t vxc, g_assert(vxc <=3D 0xff); #if !defined(CONFIG_USER_ONLY) /* Always store the VXC into the lowcore, without AFP it is undefined = */ - stl_be_phys(env_cpu(env)->as, - env->psa + offsetof(LowCore, data_exc_code), vxc); + address_space_stl_be(env_cpu(env)->as, + env->psa + offsetof(LowCore, data_exc_code), vxc, + MEMTXATTRS_UNSPECIFIED, NULL); #endif =20 /* Always store the VXC into the FPC, without AFP it is undefined */ @@ -619,11 +621,14 @@ void monitor_event(CPUS390XState *env, uint64_t monitor_code, uint8_t monitor_class, uintptr_t ra) { + const MemTxAttrs attrs =3D MEMTXATTRS_UNSPECIFIED; + AddressSpace *as =3D env_cpu(env)->as; + /* Store the Monitor Code and the Monitor Class Number into the lowcor= e */ - stq_be_phys(env_cpu(env)->as, - env->psa + offsetof(LowCore, monitor_code), monitor_code); - stw_be_phys(env_cpu(env)->as, - env->psa + offsetof(LowCore, mon_class_num), monitor_class= ); + address_space_stq_be(as, env->psa + offsetof(LowCore, monitor_code), + monitor_code, attrs, NULL); + address_space_stw_be(as, env->psa + offsetof(LowCore, mon_class_num), + monitor_class, attrs, NULL); =20 tcg_s390_program_interrupt(env, PGM_MONITOR, ra); } diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index 2a79a789f63..8474a694110 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -41,6 +41,7 @@ #else #include "hw/s390x/storage-keys.h" #include "hw/core/boards.h" +#include "system/memory.h" #endif =20 #ifdef CONFIG_USER_ONLY @@ -958,13 +959,14 @@ uint32_t HELPER(mvpg)(CPUS390XState *env, uint64_t r0= , uint32_t r1, uint32_t r2) inject_exc: #if !defined(CONFIG_USER_ONLY) if (exc !=3D PGM_ADDRESSING) { - stq_be_phys(env_cpu(env)->as, - env->psa + offsetof(LowCore, trans_exc_code), - env->tlb_fill_tec); + address_space_stq_be(env_cpu(env)->as, + env->psa + offsetof(LowCore, trans_exc_code), + env->tlb_fill_tec, MEMTXATTRS_UNSPECIFIED, NU= LL); } if (exc =3D=3D PGM_PAGE_TRANS) { - stb_phys(env_cpu(env)->as, env->psa + offsetof(LowCore, op_access_= id), - r1 << 4 | r2); + address_space_stb(env_cpu(env)->as, + env->psa + offsetof(LowCore, op_access_id), + r1 << 4 | r2, MEMTXATTRS_UNSPECIFIED, NULL); } #endif tcg_s390_program_interrupt(env, exc, ra); --=20 2.53.0