From nobody Sat Oct 4 23:42:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1759220788; cv=none; d=zohomail.com; s=zohoarc; b=FtlykmxuaIgG8jrlHpf8QE4CYonkx6I6GaxVHOLUX2KKX6xaCKufn//734UxSO6LP9F6DiR8dhYS27WppaFu2foWJOnZ2BFdQG6Q3nyTJVAobKt8XAXpzrlR4cgpR/FMY6mE47QeJZ9MQ3vVxGJsyoRFHSHS5SGg5jUQ1NHwX8s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759220788; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=v5u2B/lBOO+ZT0vBm0zXHtehU3SXYck4J+kjqZup+Gg=; b=QduUszie20F/+k0/p9WYKvWaro58TCUDea3j3lOOHTJndB6PgCmxSZ7/FYT9XiO0mEYSVfCocYPFaOiEX5PGVj8GFucdyyrUFR1XJP/aysv4JUme71fGzrx+M5qSncBzem4KclfRbzuwwz/cyKey1ZmvjylD34KXTCuKbl1zXr4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 175922078805153.47753735965364; Tue, 30 Sep 2025 01:26:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1133912.1471997 (Exim 4.92) (envelope-from ) id 1v3VgU-0004PC-TV; Tue, 30 Sep 2025 08:26:06 +0000 Received: by outflank-mailman (output) from mailman id 1133912.1471997; Tue, 30 Sep 2025 08:26:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1v3VgU-0004Nw-Kn; Tue, 30 Sep 2025 08:26:06 +0000 Received: by outflank-mailman (input) for mailman id 1133912; Tue, 30 Sep 2025 08:26:05 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1v3VdN-0007Nm-71 for xen-devel@lists.xenproject.org; Tue, 30 Sep 2025 08:22:53 +0000 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [2a00:1450:4864:20::433]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a7f9bd95-9dd6-11f0-9809-7dc792cee155; Tue, 30 Sep 2025 10:22:51 +0200 (CEST) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3f0134ccc0cso3832225f8f.1 for ; Tue, 30 Sep 2025 01:22:51 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-41855fc661esm13882477f8f.45.2025.09.30.01.22.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 30 Sep 2025 01:22:50 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a7f9bd95-9dd6-11f0-9809-7dc792cee155 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1759220571; x=1759825371; darn=lists.xenproject.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=v5u2B/lBOO+ZT0vBm0zXHtehU3SXYck4J+kjqZup+Gg=; b=awB4yGMJ8RK5hj/xpKCvMXzqVagZ1MtHZMipLtt/5JsP8xSjsr9+k2W+MseYj5UInP eMh+icZLHPvinrfDLEbYgXm4kiqH0EHBd69y5qdhXRQ7hZs2cMYrHeEMsEDQfikBcK4X TLstJSfCZEMz4j+oKeR45m1QMiY00h5n/bLKAwbiLyrLfaIYB/e5cYt21vDxOWW8NTDg Urqy65zYUYwBFJenM414YVoxUuDaEM99bDlmUzMM2lIPft0ELUGjr/IyQBtt5jap2Uxj /0woNtM/V2Od5+1rhZFfFvbi1ZzY1uI4vaeNcVsCybiqzC0osgQcnTjRrAblVxEgQbam swdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759220571; x=1759825371; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v5u2B/lBOO+ZT0vBm0zXHtehU3SXYck4J+kjqZup+Gg=; b=skmEL4flF0ahDTZo7IRsOHSYVF9GxkowOJaww1iFunUB0AMPuxhFpvDm4ODXkiS1yd /gc6cXxHPkoSvqfmkLfP5tW4i7nOHOgW093ONzsxnbn8LFkGFj4GzNs3BeTnYwx+5EEp uyur/TR0R2+0tF845plu0ljt1NTSq4eePsDzP4FIGj1nrKRYDZIg4HGw4KSvAA/naLuO oAHmZhcJscd2H+046Lp8UaviWe1krcYBJSbQ6cUdMKSrtHWNnmUdtuJBbQRZfD/GC81W jfU0uV20o5AFMaunaya3bWRUvzHxhNDAaY2i3Zbi9hCOEY9UBzwO1Z957ocS408d9M0B bKGg== X-Forwarded-Encrypted: i=1; AJvYcCVsHXL3iq562iJKw6oLzTywBmrboo9ZElozBRGsP6XUSrRPzmuGPsC1QpwOzLHk022oBgIF1wgN23I=@lists.xenproject.org X-Gm-Message-State: AOJu0YwTaWdsca5kjAcku4cEb30yR/YmRf8ryKfL5T1Kk0aKTPERWi8g dLmV3cfiRibMP+uDmd/8S1wXc1c+NjP598l0bHpIeteMxbdCbaPJpngQ8kSHXZ4FX6o= X-Gm-Gg: ASbGnct1DojOcN5YzNYCTty3RN7nJGEAkTqUjiBW5nNRlQgv31I4CHF4am1mKDN7wZR m0/boOmJLBSzIlmAoPZfIZNB2AAQVorkbZtNNYxfVs5iOLlLAD5O9Vkx9B1ZyY7A2INqhSwBzsx 9B0rKX1gDfQjqmO/L7MvsMGpLYHA0Ql5tXGwHqM6uJuvt7ylxdLPAUeVrWa0Sc0PYso90AUoHjd tNgcGG2XqKWNcJiQ8pYgATh6LO+Imiblxv9QZ4Q3OKAsGZnjAh8gH4umx93vRKvPnaK/FNV8DNp cyLWBWB2zLnkVB4FLd0i2+M/tAsGxZ6K0QWfJxHqzLp0uZ3lWJjmnzQtQWBqPgw8McBToIzZqZu LHYPnD1lM4DpKHvZ6/XyIRD0Nw3fPpurOTrvpBgJJ9MewohOdGertlTAnKLczDuvob7rqq23oLt 3WDa85FedEdEOiSqDSwfr6 X-Google-Smtp-Source: AGHT+IF27z6BNMVinFPf1IUIruLrE/uTdfyqnRZ7rQ19Ax6aGtKGHkRUD8xTP4t1vKCXsfORDSUoIQ== X-Received: by 2002:a05:6000:2507:b0:403:e61e:82e6 with SMTP id ffacd0b85a97d-40e4b1a07admr17394709f8f.46.1759220571045; Tue, 30 Sep 2025 01:22:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Cc: Marcelo Tosatti , Ilya Leoshkevich , Reinoud Zandijk , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , David Hildenbrand , Halil Pasic , kvm@vger.kernel.org, "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Stefano Garzarella , David Woodhouse , Sunil Muthuswamy , Richard Henderson , Stefano Stabellini , Matthew Rosato , qemu-s390x@nongnu.org, Paul Durrant , "Michael S. Tsirkin" , Christian Borntraeger , Anthony PERARD , Jason Herne , Paolo Bonzini , Thomas Huth , Eric Farman Subject: [PATCH v3 15/18] system/physmem: Avoid cpu_physical_memory_rw when is_write is constant Date: Tue, 30 Sep 2025 10:21:22 +0200 Message-ID: <20250930082126.28618-16-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250930082126.28618-1-philmd@linaro.org> References: <20250930082126.28618-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1759220790040116600 Following the mechanical changes of commit adeefe01671 ("Avoid cpu_physical_memory_rw() with a constant is_write argument"), replace: - cpu_physical_memory_rw(, is_write=3Dfalse) -> address_space_read() - cpu_physical_memory_rw(, is_write=3Dtrue) -> address_space_write() Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- scripts/coccinelle/exec_rw_const.cocci | 12 ------------ system/physmem.c | 6 ++++-- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/scripts/coccinelle/exec_rw_const.cocci b/scripts/coccinelle/ex= ec_rw_const.cocci index 1a202969519..35ab79e6d74 100644 --- a/scripts/coccinelle/exec_rw_const.cocci +++ b/scripts/coccinelle/exec_rw_const.cocci @@ -62,18 +62,6 @@ symbol true, false; + address_space_write(E1, E2, E3, E4, E5) ) =20 -// Avoid uses of cpu_physical_memory_rw() with a constant is_write argumen= t. -@@ -expression E1, E2, E3; -@@ -( -- cpu_physical_memory_rw(E1, E2, E3, false) -+ cpu_physical_memory_read(E1, E2, E3) -| -- cpu_physical_memory_rw(E1, E2, E3, true) -+ cpu_physical_memory_write(E1, E2, E3) -) - // Remove useless cast @@ expression E1, E2, E3, E4, E5, E6; diff --git a/system/physmem.c b/system/physmem.c index 033285fe812..51abc4cae96 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3191,12 +3191,14 @@ void cpu_physical_memory_rw(hwaddr addr, void *buf, =20 void cpu_physical_memory_read(hwaddr addr, void *buf, hwaddr len) { - cpu_physical_memory_rw(addr, buf, len, false); + address_space_read(&address_space_memory, addr, + MEMTXATTRS_UNSPECIFIED, buf, len); } =20 void cpu_physical_memory_write(hwaddr addr, const void *buf, hwaddr len) { - cpu_physical_memory_rw(addr, (void *)buf, len, true); + address_space_write(&address_space_memory, addr, + MEMTXATTRS_UNSPECIFIED, buf, len); } =20 /* used for ROM loading : can write in RAM and ROM */ --=20 2.51.0