From nobody Sun Jul 26 13:28:55 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1781575490; cv=none; d=zohomail.com; s=zohoarc; b=inPxLQ8GE2kTgcBKeKaXj0JrGMIA14AvyPWVR0yPYjej1NKQQz6AidkyiqcLmai423Iy9k3DhQIyKQPJyc84bA2QADW2cqZhKBoLhrvh1VoEd3PfiupqLeCNNYWLUBrs3hkykRGaEIQAUxF4wq3Seku+JH6hIwFmWZonhHp25pM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781575490; 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=iBELB2QcseXb5jo2451d8LaqdpobkKbY+E9paLs2UhM=; b=bF0hyFQq6rGZRcOdjvt0zQBjrJe6xQa7KqFA8gF2QeZdO8NYg+VbtMNf/t7TMkP4KXWEHmaIhoWNHarouHgwMEWbBSW8DTCNZWKK5+QSOuqszntgooi7+J97V/73TDHoz/bqRPakI/Y4A8o4S1iNz7tiAvIujdnh7k/pnofk1Po= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781575490385806.9793526435137; Mon, 15 Jun 2026 19:04:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZJ9w-0006fR-VT; Mon, 15 Jun 2026 22:04:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJ9w-0006fE-0x for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:12 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJ9u-0007tf-H4 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:11 -0400 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65G1xiEd2338087 for ; Tue, 16 Jun 2026 02:04:09 GMT Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4etgvhkmff-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 02:04:09 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-91931144870so456043885a.1 for ; Mon, 15 Jun 2026 19:04:09 -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-49230a58fddsm17802425e9.8.2026.06.15.19.04.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 15 Jun 2026 19:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= iBELB2QcseXb5jo2451d8LaqdpobkKbY+E9paLs2UhM=; b=dGoItQqsMR14JqFY GiFoW3FWpE+1m3NAvrob0mnTmvpNp92pUjPdNdCgMEdnCUIoYyIe1phRUZCroYsG rOF0oVP1JIIkV9mYaQ7ANbZ//FL4iuBpW0Qo4zUTR0SR7SnpYLUZrr+5h0OpzLMl XbkXvQR3O2wzvajtoizQrrkIJilVsUlQ0ucy+sp3b1yU9r+YcNFk/wf6EBdopBmX xLLu+ygrtuHLuQTtEc/GEAd/iHtaQbwMc4bM/BbQaL/jiiPaqezT4fMqC3UtjcBs zCVGfxyqhU+KzgxCkoUs0ude5a0aC4/md0PxFqcWbvrhcuZ7ML1smAkCykgUpjs1 H2sqfg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781575448; x=1782180248; 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=iBELB2QcseXb5jo2451d8LaqdpobkKbY+E9paLs2UhM=; b=asis5aC4mmfSCWHb8LKAv5/f5mg9tSm9yj5KokSH5b2749Obk2wf1qj0W/gfVb0mxL 43DXsXPu7Gy8BuCHJkICA2AFMl6JVh34BRoF76e0q8ODpkpEu76W6qXGWUYlcOrIXDlW fEaW+lY2zpsFvo2j81duJy/jt3uXWo55aDzlGM0hlSOxnTLOoeTXMEnWTAs/auo5OeIB j+ql5aUW7fLdD7nMoiyoI7dtnm3p4dXDxf3jZKe10GmfoqpaC6gfHYXQ9KdXet5YOhxu 46Iqsb9751GnUHjM9nDvdYYnhUeiZTM9DtDJKTgqMPDAhPey6OQV+znwZHE2JfYSX8Fn hnRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781575448; x=1782180248; 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=iBELB2QcseXb5jo2451d8LaqdpobkKbY+E9paLs2UhM=; b=gL6UjHNyMmpsVRWzdjE99tVi8b5+mUK/zBgUwznCEKgyznuqAlo/sdrjXJsnpGVufV 0ILvyeiwlhsTQWNMt39XKxM3yi143ilQf6ahZ98353cnrJ8RPqxxv11Kj2j6ZKENMp50 tdwap3OkJIgB7ZTu79VPcdJfgJzPr0/xQPPXCWWPcegyO3dw2FaS1bxn8BFgkg1n/ZMW aRpDIwEmBbU2cFFvCfCqCZkFB+AN0coAk5Uj+HYIG3KxVIA+p6/V7bYytxMMYo+lH6le KM7WWnujguBDPSyA7Yd1tpqJR3Ijbf1aHTEKgkKv3v76eWhN7nYs/5Y0UZrojsNZmA8K fUDg== X-Gm-Message-State: AOJu0YyqAy5reQnhVRzf5UBQHKvxbAYyweYIQ+Trat9g0RQskfHFuQ+E DwcpmShCY6BGpnuOo6SoSgIZB4WiTFtQKOnU2A7XM+41eSmbe4nZiFDHDh+gi9qfMCeYF5vj34H py+X4sQMHBw+ZC7Zmykx46Itq0+VgDScoK9HIarPTw1kERCuATxQBeBqL3rDTPYApjQ== X-Gm-Gg: Acq92OFm5gNxN1y3wXMeh+u7KkNRlsorNgiiIPXRyAfThqtNHib4silqTOxhcyxS3Kb 5+WqZ21+3rV6ggyAKc9cS3cbIF2soD/fhjMWuxzqm7l67ZTL2xmJc67NWO1zZPjWUFS2tOqmWIA 2k3FHUxe/gHf0Qu4jOW3n+vCY56QmBQ7TzK/xPJvJQjWq8HmScvI2r+xXGOamL21hC6H4mFCJS3 OzWm5oOAfmxDBPys8kqeuGvRDWu5UkTd/QdmYGKkGcy5V95E0N7WaS7XvyyhD9Q3WBi4vcghjVW VLWfhcraEp/EGlwo3FC9LFv8JuqUbMSdgmtyCdonLZaciQT1HsDKwQP7veC+eazXiSPeGOuQg6X q42cNfzMpjNH0mc+A9k3M/s41Ed+cYMsOc32cJuh1vLa0kybDY8duyyl/rkBfj/iPQ2/0GPtUFA WZM2o= X-Received: by 2002:a05:620a:bce:b0:90c:a08f:c5f0 with SMTP id af79cd13be357-9161bccaed3mr2699398285a.33.1781575448513; Mon, 15 Jun 2026 19:04:08 -0700 (PDT) X-Received: by 2002:a05:620a:bce:b0:90c:a08f:c5f0 with SMTP id af79cd13be357-9161bccaed3mr2699394285a.33.1781575448058; Mon, 15 Jun 2026 19:04:08 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Xu , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/6] system/memory: Constify various AddressSpace arguments (checks) Date: Tue, 16 Jun 2026 04:03:53 +0200 Message-ID: <20260616020359.18627-2-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260616020359.18627-1-philmd@oss.qualcomm.com> References: <20260616020359.18627-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfX0WSs9JLsgGrU ZpiFi/5KdY+cIAgb4Rvge+sG2Ksq10n+MQ4gErRR2fCe+iQx52vFvd00zmlINrU9eiKGMn50VwA zFXSAAxO4I0/k2VGaeRgTQYkHB48TQY= X-Authority-Analysis: v=2.4 cv=Zqnd7d7G c=1 sm=1 tr=0 ts=6a30af19 cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=e-NtlPoBfifz4Kb8xpcA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=bTQJ7kPSJx9SKPbeHEYW:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: e_4lNX16BcweBvhrW-S2_06Ly6MeA3gg X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfX57BTWoqbJRiV I8UpytTBfkDrjXRCV2RlFnlOaXT9szwZhetGmbdnoy1+vdXdoEBclw17waQAm72CozLUBKVUUTy ZQCAHGOr2PPg50nrTjJaeJ1Gnsal4GwVYxffmM3rDdCbk91yer2y365iFOD33rVBAmk7+htkiNb rigoaSMLrqyDzkCazCXnau4ekO4Z3IvB/IqrWNUJHGPDUqPu74NeofYO9ksaCvND81X86TD/PuN yqzNL0UQGNHHWmT/YBH0IQkXizG/wO+auDRZC/2zbxJ5Yf+YT2sknFSKOdpnaWKLIU5CNGBcvnw DB0GCcnwuTDJWgVvcK7ht0vClRi0SZ6htT1QeTYq30hJi6MZ/3yl/OOzr/bmqNxjb68AhD66ccY mrcozNTs674Y/QNLED0khTc3x1QDOguMX7IgWby8EA0rXF1q5peWtY8q34x4+ui+/C+GM5H/zuW rIlm8q5pZWOD94Qh9VA== X-Proofpoint-ORIG-GUID: e_4lNX16BcweBvhrW-S2_06Ly6MeA3gg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_01,2026-06-15_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 clxscore=1015 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606040000 definitions=main-2606160016 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1781575491682158500 From: Philippe Mathieu-Daud=C3=A9 Mark the AddressSpace structure const when it is only accessed read-only. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/system/memory.h | 3 ++- system/physmem.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/system/memory.h b/include/system/memory.h index 1417132f6d9..5c525646193 100644 --- a/include/system/memory.h +++ b/include/system/memory.h @@ -2829,7 +2829,8 @@ static inline MemoryRegion *address_space_translate(A= ddressSpace *as, * @is_write: indicates the transfer direction * @attrs: memory attributes */ -bool address_space_access_valid(AddressSpace *as, hwaddr addr, hwaddr len, +bool address_space_access_valid(const AddressSpace *as, + hwaddr addr, hwaddr len, bool is_write, MemTxAttrs attrs); =20 /** diff --git a/system/physmem.c b/system/physmem.c index 7bcbf875736..a0561177afd 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3646,7 +3646,7 @@ static bool flatview_access_valid(FlatView *fv, hwadd= r addr, hwaddr len, return true; } =20 -bool address_space_access_valid(AddressSpace *as, hwaddr addr, +bool address_space_access_valid(const AddressSpace *as, hwaddr addr, hwaddr len, bool is_write, MemTxAttrs attrs) { --=20 2.53.0 From nobody Sun Jul 26 13:28:55 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1781575524; cv=none; d=zohomail.com; s=zohoarc; b=BWdViWg2aso0PbZs8goUj+Zd1TeszTD0GKwcE78JQux0RDpX8QfZnP9gDKFKUovSIJr0wAqsC98LGt11ItqXVIT5vVtd5wWZ+dJ67UJX8VpZF9ar4U6xaMKQFozcr9wi8nC5vkh6k0REHk+0A7bGOOGvR08LGz5NRrq5Vg/S0es= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781575524; 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=rDEM2XcKvCPctGiNVGvP91Jj7baqZxy5jXwlIijFwuw=; b=DqiIwD9EuU+hj7EGcLQ//tVWGm561s86ivtjREW/0KR1uRbECW2cJME9bRG8FmzqcrZVVrLZBD0xxMNWBp+E0XXEaixfHIWu7ut/JYq8PqFT+JMSlxuYQFrf7N1DVnFcJGvjuZN4pmM1/+hTiBoyQtCchV+hmYbY90RXXGB/bJg= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781575524298715.4583565693705; Mon, 15 Jun 2026 19:05:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZJA5-0006hD-CR; Mon, 15 Jun 2026 22:04:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJA4-0006h3-9l for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:20 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJA2-0007xI-Lm for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:20 -0400 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65G204Q92148524 for ; Tue, 16 Jun 2026 02:04:17 GMT Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4etetf41rx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 02:04:17 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51989985485so14072581cf.1 for ; Mon, 15 Jun 2026 19:04:17 -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-4922fa8b423sm35892525e9.11.2026.06.15.19.04.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 15 Jun 2026 19:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= rDEM2XcKvCPctGiNVGvP91Jj7baqZxy5jXwlIijFwuw=; b=NzCvyN85qiqSzszT LXK7QaORiyk7OBIEzh7qw+3hH0gU9up58xWNuGWtFtmzGMTgZyQ/A68hz8pJrY6K ES7RpI1uOerymzymPVCGBJknCXXVZ7LfX2FdwmOo1dyhRvl1RaGqynwJg/pzvPFz 7ClQPAeyEjaiHyALdpsA6jFefN1nXNf1BIxhP+Tc5l4wTeGwCOHsmCf1W9rK/EFL +Wk2csdGovz8kGXeA88uZwdT0mFIvwjJzCZuMU2046spZ1xgbb8QHzcD0uCSXdK6 fksWWB0HAFcEK27DbWvV/OA+bJ+HdMkBngJfTGm7lONphZlvrdJJ72uFoo7SmXoE VMYjdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781575457; x=1782180257; 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=rDEM2XcKvCPctGiNVGvP91Jj7baqZxy5jXwlIijFwuw=; b=Nfs/KeDGj0gDLiIun2IAbXSZNPzmeQrF2eX48ExK7qb/d6MRHpvA5QD98ufpRClbk4 euGHVAQ2zIrj5W3TlxEYmn6siPqS1E/vitKisPWTffzuCLiCRdNgcfp1fxBPYURyh4NL nMOO70GH+aG6p/MXMl2x9zS1IZEkyP2bBL7fIB9EafFInJJRMlYMPv/cSh1iiuwwR59M HLL3vSmfJKUDGwteqwGttzn5aQmHdTJv+Cw/UvHuORY6QuJEG7uuLhWe+Zl/UhQhnU7U zBO3vnza3w72h9XZRIkk1XmYmnQqs5to7lxEfW5L6oBUn6yMvXHyZK7cNkTXs136VuV9 5kCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781575457; x=1782180257; 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=rDEM2XcKvCPctGiNVGvP91Jj7baqZxy5jXwlIijFwuw=; b=THYQXffRlP+UqMh1H8N27ac9Z6v2DMmqlsQzpwGpzf96a1tD9cazmFi7TBKCsp2jmG jMf2xwgmDjj1koh5Y6jPLKagOjCP2k3veVlDC4ZfLTbgLlAicW95KADGuGXGVgxhoiQs PcIZUj896u+aU84no1jNIoTyrgyQThHmvmscJHR8VDIdtLNdTjPJJdnnegIrFRj/yowz kodYtJ/8d9WQgHZYiVNN/u961aBpKPCLcZ+TctdchOVN5TLsu02VS9oHGa3RSGuEaIgX NReawMRq8uzNfqa2ayRvUJmvrBVZTStX+/GZruwEXWpL7wCHRqAVTAEZfLPVF2R4QiMm SN1g== X-Gm-Message-State: AOJu0YyY9EH2P+u9HaXrrqSb2UfA8Nx1Nfp2bQXCfCvKqMl3G2UiQfx7 J5xyYk8hQj7qvRLJBB5Z6sd0vG8U0haXSYKtB67zeS/QhDFIl/bqhXpDw8/t2cOu4r/l2feAML/ ab/9npYh0DgKzs2ARkKLm3Z+SXbFF6gUv/7du71oZ967G9Uc9UiIDPf9e+vGPKGwpVQ== X-Gm-Gg: Acq92OFgPMPYYLzCppMCoQLcuUV3B1s0MKp1sjZeF37jUlk34Psa2miFlgNQQ3h0Jxj pSPhNqOa8LwHK7Cf46boeVKE8D6rgnPp4+A/t92myI1ZTDqMp4dMHiqZoCmYZ30x+XyWwnCXobU XDZTDK+MFc/W3jwBJjE1mO5rhTfEyAxKtPknRrjfdzpQxw/2cVTVsdfOmaFEqGFyf1rXVBvJhR7 eMGmcIDcn874Fjp56KBkYKB5CyrfmxYqjV9cjLAuBbZgifKdxRIaF4gnrNGr3XVIZreKT/zINCa NYufA5MN7kvyghtFIOzJYolGwAKmUqzEcmysED0m/JOhi6wKrHsvNmz3eITGEgASZbMrUhhlEiZ 7jOR5hfsmsEh0H/jtq84ZChh0uqg2mKMkEfj1xnTxN6A5T7u62eHiFnkh/Uo3/Lex05PTES/jDm 7ROOw= X-Received: by 2002:a05:620a:460d:b0:915:673a:617b with SMTP id af79cd13be357-917eefc4291mr2095161785a.24.1781575456969; Mon, 15 Jun 2026 19:04:16 -0700 (PDT) X-Received: by 2002:a05:620a:460d:b0:915:673a:617b with SMTP id af79cd13be357-917eefc4291mr2095158685a.24.1781575456566; Mon, 15 Jun 2026 19:04:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Xu , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/6] system/memory: Constify various AddressSpace arguments (flat-range) Date: Tue, 16 Jun 2026 04:03:54 +0200 Message-ID: <20260616020359.18627-3-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260616020359.18627-1-philmd@oss.qualcomm.com> References: <20260616020359.18627-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=adxRWxot c=1 sm=1 tr=0 ts=6a30af21 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=PVUNuLZfzPDvKcjOmkIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: yZ4GNy36Q46YfkZNm65tjkoyKDb9whVX X-Proofpoint-ORIG-GUID: yZ4GNy36Q46YfkZNm65tjkoyKDb9whVX X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfX9b/xcaSNJlzO 7A6rHNhYSMz5y4PlRunlkMxmY6Ul2Dm7MWi6IP/I/Quk/XqnmQoLOueuILkP+8yejI6fd+HiNf9 mn2k5bjEIwn5koZ2RRHv6E+0/YsDclI= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfX9zLmLgL0IoU6 awvk6EHJ7n/aB4eAo9XY/VoR6njr7ABjKi1ERqnxzwQ91RnVPOeaERwBgsdHT/gSxAkQjvEQDik RdfKNq36OYxMrBQ9oOGDRxNR6xb4iO6fIGYbdiB3RaGWlCq1Um6KVchy/bQzf9LAQSmM0xVNlBg AYypuXGGDNU2Y6IYtNu6dlQd1jGk4PIW7qCb2TOr2X+vwgUlAy0+voYLjMlwJpi+pYfQz7LgfP8 QbgqWKPMk+QHELgWY8BCNpMXsjjKd+MorMXYwN8vVhCOHqTWjCqsYSC1kn5vYySyZ76tWE0VBBM ZBzJ/6Yil7YoWZ6/+KEXIhLFjIVQJke9qsTZtd9G0S5pDXzcUPBKyvCjNEXzdxZKC6v5MrJy64N sLzAsLiJVwhA+8bbFh/Ncd6HvT1uNLmoC6DruDDLMAsgwGaTBMv7syEXO2/yTt5xO1L9YJEhWgK mRKqcnNYRgZcwMFSXMQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_01,2026-06-15_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 impostorscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606040000 definitions=main-2606160016 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1781575525753158500 From: Philippe Mathieu-Daud=C3=A9 Mark the AddressSpace structure const when it is only accessed read-only. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- system/memory.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/system/memory.c b/system/memory.c index 739ba11da6f..ea2ce80cf2c 100644 --- a/system/memory.c +++ b/system/memory.c @@ -889,7 +889,8 @@ static void address_space_update_ioeventfds(AddressSpac= e *as) * range `cmr'. Only the part that has intersection of the specified * FlatRange will be sent. */ -static void flat_range_coalesced_io_notify(FlatRange *fr, AddressSpace *as, +static void flat_range_coalesced_io_notify(FlatRange *fr, + const AddressSpace *as, CoalescedMemoryRange *cmr, bool= add) { AddrRange tmp; @@ -913,7 +914,7 @@ static void flat_range_coalesced_io_notify(FlatRange *f= r, AddressSpace *as, } } =20 -static void flat_range_coalesced_io_del(FlatRange *fr, AddressSpace *as) +static void flat_range_coalesced_io_del(FlatRange *fr, const AddressSpace = *as) { CoalescedMemoryRange *cmr; =20 @@ -922,7 +923,7 @@ static void flat_range_coalesced_io_del(FlatRange *fr, = AddressSpace *as) } } =20 -static void flat_range_coalesced_io_add(FlatRange *fr, AddressSpace *as) +static void flat_range_coalesced_io_add(FlatRange *fr, const AddressSpace = *as) { MemoryRegion *mr =3D fr->mr; CoalescedMemoryRange *cmr; @@ -940,7 +941,8 @@ static void flat_range_coalesced_io_notify_listener_add_del(FlatRange *fr, MemoryRegionSection *mrs, MemoryListener *listener, - AddressSpace *as, bool add) + const AddressSpace *as, + bool add) { CoalescedMemoryRange *cmr; MemoryRegion *mr =3D fr->mr; --=20 2.53.0 From nobody Sun Jul 26 13:28:55 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1781575528; cv=none; d=zohomail.com; s=zohoarc; b=CsWeIG/9TWo8vqnbfOzkFAnBnljEWB43WMJHYYC4r0yfZ0wJuFmYLxz2PHGbq/YczuB8YMHqyi3ul9iTrwPO1HQrllOyUivyEBlQPuU0szcGawcnEM9HUntqvCffeviggSpw4fVnWbu9GIaLPdfFMHM1AlLQ4rGZ9ZW5Ot9kNKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781575528; 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=wEjg8+U/42yccFbZy9d7OftFpIh1aOtbljZ3CkytmxI=; b=nxzlSLbsEx/ad3b1uOADL9LcuBEhyFA7tRculJFyhltdlgdFdgfbiShaBgVFrqahqmI3wz182ihudxDSLKip0S0mv5bKQdCRGvR52RKJ9x2GggpH0hVL5cifsjbSowdbWpyJnRNIbSt05gOTTZxsRRW++6jT9QxazgEeVdNxJx4= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781575528251478.3082732446451; Mon, 15 Jun 2026 19:05:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZJAE-0006iu-FI; Mon, 15 Jun 2026 22:04:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJAD-0006ia-44 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:29 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJAB-0007yJ-Cl for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:28 -0400 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65G20GQm1801121 for ; Tue, 16 Jun 2026 02:04:25 GMT Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4etfa741s8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 02:04:25 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-9157f453a27so582035885a.1 for ; Mon, 15 Jun 2026 19:04:25 -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-4606f2b0c10sm40199342f8f.21.2026.06.15.19.04.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 15 Jun 2026 19:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= wEjg8+U/42yccFbZy9d7OftFpIh1aOtbljZ3CkytmxI=; b=hliu5hNV2iKk2bRi Siye6o7ECHgdUkDwAiIWOH1r8wiqBDfUgfo1z38sS+Bn+ps5ytdLVeNqNuu0/wWV uTHLQPOgL8lRTFjnNxAptAAsEPHjmHifZyFTdwqx5+6IrVkep8PvgKjHUk9NSSOx wbIFpVmq4eZgvsTWf8yQpL9onAPbBfWhJPhKSqudMg1EeN1u6rpxTj1t925YLBeJ Tl72gU2JrxRWQGtMnDZK8lb1x1uDzvgYSZT/DXB0GN9sbkm8W1yc572dFseAEEK8 KMX2Q5BB52Wuu/yUGWyTfaisCGEimQrXnFeWwTa7ssOXgp7fQFWcyRj872hS/SOw 4oHDKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781575465; x=1782180265; 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=wEjg8+U/42yccFbZy9d7OftFpIh1aOtbljZ3CkytmxI=; b=JiienHjwnc8YqnkyB7+hbzQ3Qno72h2p/kV2GvjxrjZ7zpSi972cRgkA8DW6/XFK8C 2v8U94BW6ZQJA8mNahsdMoRbAMp4tNpSYkZbLJWgLu6D+AfpmSh8B/rB/pVhvZtS5d11 uSm9tUZ1p9Anmm0F7dZRXOmyK8BgTRzpg11q1LoIANRx6/Owb+aabBaBmGwIuqonzuHC ki7Rif/b27B8LxBWVXT/RQleA83loRaIvXH6ZGSyP00XEfC1t9NpAl0F8BJNhewvVvBk ICeybRkhSEF0KXW+A1wpketM+mSv8EXB3KsEgvn6IlE8LnBVBnDVCKTCu8ivKyHjWbHk dxZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781575465; x=1782180265; 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=wEjg8+U/42yccFbZy9d7OftFpIh1aOtbljZ3CkytmxI=; b=L9A/4IB2qzZjO2iaPMSyz6DMd74jU+4VyteXfD/M/MJRigPf4wHVjr2qv9Sh6UhJAt cp2UZds0foTd4GhnHLK5irCrXRwxsyrdOgwJ69fGzodgvqQokHXdVZh6XTy/Kijq7urc Y5T8k4KwEVKKTIrq9zUWGNcZhYE//5hNyfrWxvPZJmv2t2H4GdfMxAaczfQ4lqWVn99C zGc4xTfcNUdJEFzgahlMMgEf3vSn3v6WItg8SC70KSWMRC16tS2OkN3S1jdJvyI87weZ yHEQ3ropDFsd0Lo7rhb+7JoGlH/zOswr3A6UCsQvwmzUjJ4dw30zEyEIauzxkWXchMoV U4wg== X-Gm-Message-State: AOJu0YyXcE+rP1A/LLKqmh46MXVDD8uRtFT5pYWvZ5lg1APRv49D0gRH bFr1GZDKsiRQXuYA0ngFD0y/MkHcMLLBT4F9M8Iw05qHU75P2ZW7RQKvzB3c97FbKvVf3nv5YKn iqjEUhrOZwPOnAzCIg41ylO7CgR2R+I7yXFUI63ukOshnuEKd7Oz6oe7SYTGDd+Yl/w== X-Gm-Gg: Acq92OFunfgxgq/HNaD00IxT7VYKgomkJSOsqKaJS6n9yMkqE9BLeFpEwSsqr4BMdvG Q08hua9WEeH/Pch1I2z+/DJGmoDZ2mRaNuJWmchPy6i/g2vDzgzfOjTAfYUbli6reGmhqIvl8j1 ZcckDrpKeGAdCq7y1ne7tcNB3vkn5gB2OdzP+Nj/kgOP29madcU4F5UYz2l2LimON1sVvolt3KC 456QCOhgBtfxteQvK4QLxuE5nA01uewdmu07x1xeWyzBfEVoAQZZsyxw2m4Ctsx+mQxMGx/yfeW XTHM+/tZ+dH7iIq3YY2SPGb7l8/y5Tx3vHR8f9wieLX8X9H9gxrnE6vYrxWyUijh5XF6Gw0T52f ELByP7OLbkDrmx+eGpzdLdWr9Kr/CWoZe085BNQyQ7jWhSOmH+RQ/F3Mo2hfffdd+1U2vfbr+sZ h7UUA= X-Received: by 2002:a05:620a:390c:b0:915:cf88:1e3b with SMTP id af79cd13be357-9161bf722a8mr2589454085a.47.1781575464635; Mon, 15 Jun 2026 19:04:24 -0700 (PDT) X-Received: by 2002:a05:620a:390c:b0:915:cf88:1e3b with SMTP id af79cd13be357-9161bf722a8mr2589451085a.47.1781575464131; Mon, 15 Jun 2026 19:04:24 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Xu , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/6] system/memory: Constify various AddressSpace arguments (notify) Date: Tue, 16 Jun 2026 04:03:55 +0200 Message-ID: <20260616020359.18627-4-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260616020359.18627-1-philmd@oss.qualcomm.com> References: <20260616020359.18627-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: JpnK6zATV2VWJ3rWYRjCOpVtmRAusOAq X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfX74l3mfnEoUES GduwzdMRc6Cw5kuA0uLBdsa3+Lh/77apYUo7fn4WBBe91T0S9dAa3H6BAQsKzQZstjTHxsWRfvG wc1KyCXL0EoVib9UbqdKBTnIwiixZ6U= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfXwxXYuYwEj6yr UAyQYbFjj37xkM7QxKr2uwbrNrEba5wyf73dFH/ZNfG3yV4IJZJ2oD6Qo06hopXzSsqnE4ac11y ziqymrXJXAy9CqEJpVF92NCW8j8vMtAY14muVTSByr1EZJylj0GqmeuC9AUUuVYHch4d7xi+1Ua oyHjLpV0AQMZjkUu06uetKjYwN9VnV+SWyVhsCfhkASJz1FPxfvwbDs/cDjltAiM+kxkmVHpA/o 1PworXLle8at40lAfjF+zDVBEV6lF8OZ5S5APt4cWoNZhU2/CePwARXpI2Kp4t9okIK0yAtuiRo /MOFgsKV5tBNutUeIayaJFhIgl7I1DHF1x019O4wk5SnSyU0tvOxANMn1ZegHzKtTLmwAUWRq2x +padRQa574MHQ3daCcHQIKkO5iu5ni3AsogJ5nMwrJXQmt46c9MvbcLBgFZIbY0xqc6QpukOi70 jiSE7zmlqo15hWlSRlA== X-Proofpoint-GUID: JpnK6zATV2VWJ3rWYRjCOpVtmRAusOAq X-Authority-Analysis: v=2.4 cv=AN2yTM5Z c=1 sm=1 tr=0 ts=6a30af29 cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=nR6OtcKYjoWMIbXoh8MA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=bTQJ7kPSJx9SKPbeHEYW:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_01,2026-06-15_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 phishscore=0 adultscore=0 malwarescore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606040000 definitions=main-2606160016 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1781575529382158500 From: Philippe Mathieu-Daud=C3=A9 Mark the AddressSpace structure const when it is only accessed read-only. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/system/memory.h | 2 +- system/memory.c | 6 +++--- system/physmem.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/system/memory.h b/include/system/memory.h index 5c525646193..fbb4166008a 100644 --- a/include/system/memory.h +++ b/include/system/memory.h @@ -2682,7 +2682,7 @@ void address_space_destroy_free(AddressSpace *as); * * @as: an initialized #AddressSpace */ -void address_space_remove_listeners(AddressSpace *as); +void address_space_remove_listeners(const AddressSpace *as); =20 /** * address_space_rw: read from or write to an address space. diff --git a/system/memory.c b/system/memory.c index ea2ce80cf2c..f58fae67fa1 100644 --- a/system/memory.c +++ b/system/memory.c @@ -2985,7 +2985,7 @@ void memory_global_dirty_log_stop(unsigned int flags) } =20 static void listener_add_address_space(MemoryListener *listener, - AddressSpace *as) + const AddressSpace *as) { unsigned i; FlatView *view; @@ -3050,7 +3050,7 @@ static void listener_add_address_space(MemoryListener= *listener, } =20 static void listener_del_address_space(MemoryListener *listener, - AddressSpace *as) + const AddressSpace *as) { unsigned i; FlatView *view; @@ -3155,7 +3155,7 @@ void memory_listener_unregister(MemoryListener *liste= ner) listener->address_space =3D NULL; } =20 -void address_space_remove_listeners(AddressSpace *as) +void address_space_remove_listeners(const AddressSpace *as) { while (!QTAILQ_EMPTY(&as->listeners)) { memory_listener_unregister(QTAILQ_FIRST(&as->listeners)); diff --git a/system/physmem.c b/system/physmem.c index a0561177afd..e8a2c438c7d 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3565,7 +3565,7 @@ address_space_unregister_map_client_do(AddressSpaceMa= pClient *client) g_free(client); } =20 -static void address_space_notify_map_clients_locked(AddressSpace *as) +static void address_space_notify_map_clients_locked(const AddressSpace *as) { AddressSpaceMapClient *client; =20 --=20 2.53.0 From nobody Sun Jul 26 13:28:55 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1781575515; cv=none; d=zohomail.com; s=zohoarc; b=SyGpqNZxPal1JvjLAR1FGrx5TzGtQxGrz9eQZSgl4SX61Qlyj9+jwNFXeQ2FQ3B/3lxZ9GmfkZCMJ6wZpxLTxkMIduQ7GGsB68rff20OCJvQnDaB8eFEbFF3qS+zTKYa/Dxuni1r8tmpy64LdXsxsx2vmDIDfHf0sb5MovllKoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781575515; 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=VX7NLQYLerFMFCVchnq1CkD+pT2w/NHCxn4QKAYqUcU=; b=jfUGGmwDX8q1p2YIpIpPfzAFjx1oGerQRmb26mjH1IZs/Noteo2yBXgp8HY4WHz8wRa7jCNC6GlTRtUq8+amCv15moXpktEb2Zh38S9JTg4hNRXYwewQk/uNErNgUWyjoowVSmbVIj+HOj/FJPk+/pWkzAHLmGa3Wqzcdd47koU= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178157551551544.646220222436796; Mon, 15 Jun 2026 19:05:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZJAL-0006jz-R4; Mon, 15 Jun 2026 22:04:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJAK-0006jb-A3 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:36 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJAI-0007zq-OX for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:36 -0400 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65G1xgTL1766990 for ; Tue, 16 Jun 2026 02:04:33 GMT Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eteydc234-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 02:04:33 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-915c8347cd5so819712285a.0 for ; Mon, 15 Jun 2026 19:04:33 -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-49230a4601esm17317795e9.1.2026.06.15.19.04.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 15 Jun 2026 19:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= VX7NLQYLerFMFCVchnq1CkD+pT2w/NHCxn4QKAYqUcU=; b=i1AIzcB62UiruuRV NnBdN0lDwR6KVtLtW9dAn8oKzl88gkVqAHVbsMcmOT+HlBqCIiIwGkRJzO1jx939 RMnUZ1wreSXNHFpUD+iYWzeYZzPa01U/S6p1G7LgtgC840EdNs7ApW8xQNCfeOf3 AIQZwOGy8caV4UhtUirSNUliOTQp4pCocvvmFb5ScdRpyfS/ictmw7qR7QB4iURT zNd48KejqrhAT1t2gzRiLNXfKAsZp/Brx4R51OuAOR2jLLDFM7C45FFeprHxYRKV +HZkKYTPTbzrmjFGJgSac8SvXMQ1UxTU8JpN7Z1Cksy6AtpeTtvmeXE0yRPx4reW VUAnRg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781575472; x=1782180272; 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=VX7NLQYLerFMFCVchnq1CkD+pT2w/NHCxn4QKAYqUcU=; b=PxMO1q9p2QykIJ8uzgusDmOsIBjNHizGTX2ERCMhGY+T/XnCCu5h0WmYeMXBmUb/n1 Qe/U9M/vb2j5PHCfbNZhEKfIflFzbVWZAkrP+l5WRJB1o5pzfNBONBrSj5mtzz6Khjuh zuqbhIZf1UaBbPHpcsCA1i0w58tsjcZFzNApKIVY6IRZt3Dznt9IKRmXK/59pL+Y61Iw WWNxg0Bxgjc05Vj/aZ5DntDZGRIqZDqq5JpGV6o6HpDKqVEbS3Hdnozq1PCertHPxWCi jA3BEOwL/ZDTsLEzVaezgXuKcy/8XehjXb6ZONP/dVETuXd78tQUFo+RlmCJ3bxPvBqd nKlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781575472; x=1782180272; 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=VX7NLQYLerFMFCVchnq1CkD+pT2w/NHCxn4QKAYqUcU=; b=NZUyBgrp/B2i3hstaaq7URBAreICMPpx7SzFkO7pyvZe9QIq2ec1KEMTVPljMQlhOe fZ0LGoKYMm7EFiNJgRpGSJOYkOAIVZdq7z7GCok7fdXjj97d8F5MEZmFaVHY6qKQpIBy kGC4JmZcPRoIRHNslTyofENhq0yBgy1CosPvdjRPTliRcjmxYE1TS7+D1DYPenGp8u9i 2VgcZj/iLDBzCktZlhI6gfgP4B+p6dyUUlaYA/DoBcD3JoL7XDTQuOx5oD2NzHu0Hz5Q GdaSWiYs1xImX4EQIE/SfYhIbA6Lj0l8pc4PFlWkfC6hZewJ0hgRvIfHECgQBWzWlJmr +wtw== X-Gm-Message-State: AOJu0YziXR3HfYOVUWQ/avRUMRlEwlFd9YtuYws9lzW6JP5J370e1h+J 6uhXCGUqKdP9HcgTeLNJYoOpHsvbAlW5yna/+vr1mbeFPw+Gm2K8ph1Mw5LIxZmFOgW3ahAI7v2 IoGSrksiQLDA6qhDqhEX48epd0+5wPR0re2g1m3XjbbtYLPvTqm2fSDA4seb847fjOg== X-Gm-Gg: Acq92OF+FvNyQRbNlYNmrHeY4rku9tzuXUGJGi6m/KTiV/jdbG/f5HMAzQzH5R6OA5Y tyGorZVq50hDLQbpWNOFNGPf7/nMugYoQOMtovyTpUY8inq8GEjoHH2+4yBdFtj6Sdm7UohJQ1q eGuxJS8CdTwsN80IAkRiEZfHg59hx9n8hCNpZfhdSQoUUL+/WbQHDmeP6xorVZCH4XmA1fYfRHY C33rGaEChzEviNu5XXFKpfUuS4gRcuyLO2AxH/jjQCV5sTPa6M6mXglLCHEttVFN6A1rI1Md9nD J4uJBc5YEDgXyZvan/EgPsY2jYmY7BawPgDuRvcutTVIf7vuQerQUrGlFRwvG+zEUYQ6sTLXPzs Q//F6aptSaYGfPCgrXkGffIF+/XQZ5qc+ehWnOtuhzORURFAIJnS94+5CW3uCOZHrdcUXuaIsbK lqnEA= X-Received: by 2002:a05:620a:25d4:b0:915:ba3c:8c2b with SMTP id af79cd13be357-917efcb331amr2159742485a.19.1781575472431; Mon, 15 Jun 2026 19:04:32 -0700 (PDT) X-Received: by 2002:a05:620a:25d4:b0:915:ba3c:8c2b with SMTP id af79cd13be357-917efcb331amr2159740985a.19.1781575472079; Mon, 15 Jun 2026 19:04:32 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Xu , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 4/6] system/memory: Constify various AddressSpace arguments (cache) Date: Tue, 16 Jun 2026 04:03:56 +0200 Message-ID: <20260616020359.18627-5-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260616020359.18627-1-philmd@oss.qualcomm.com> References: <20260616020359.18627-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: IBCyjySzyRVkSrJ-zD0UQTIsf7E3esD5 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfXwuLS9+NYGAZB 94HjKw3lMx8sGzh6796RSGAfl7EyIe/aDDgOBgXz0LAcascdqleauw2H3HiN8JZsge667C0xDwm 3sOEIIMKy05+Lcjc3BEzpWVm62nA3bY= X-Authority-Analysis: v=2.4 cv=QrJuG1yd c=1 sm=1 tr=0 ts=6a30af31 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=e-NtlPoBfifz4Kb8xpcA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: IBCyjySzyRVkSrJ-zD0UQTIsf7E3esD5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfX5oDHOG5qvGkb CCQH4ZQdQ3hgJdwVOn+L2iW8gNVa4h2wOn49G+JBMb3Euao05LgSsZdxk+JZUNWyG8XyNbuwmQ3 UVorRPodT2Dz6HXsXgDBPBTNAwaSMa+6anKM64bmcdcmwXXloich3St3LtzV0Ux0G3iHFKALkmb 98/jBybFuiygKMUwGK7W19pd0EeCwmrjcMW93QFhUXdcBHwy6bgyYjpQl5fc8G0noo7ZoIkJqXR 63fFaXsvtiGq889LRo1j3UoSB1JNmYfF8qGrannKb+380MIsQA3K0qLuY1m1Ei9JMal1NDNoo1O 8Q2UJwmp1suaaGH+vc4mkx6SpDN89HqTvkvAYdvuK8gnRreXzfOzNUtASkF7ru9eP6kPRxxM5j4 DiD87atm/tkOGxIJwoSs3+Yyl5/IBHspXnuAeXz9z6D71pbzzms8rfQ4yZNlrnxAd7FLwjMdBTW mFS6znmEsZNUMJJPgnw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_01,2026-06-15_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 suspectscore=0 phishscore=0 spamscore=0 impostorscore=0 malwarescore=0 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606040000 definitions=main-2606160016 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1781575517568158500 From: Philippe Mathieu-Daud=C3=A9 Mark the AddressSpace structure const when it is only accessed read-only. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/system/memory_cached.h | 2 +- system/physmem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/system/memory_cached.h b/include/system/memory_cached.h index 6eb6179140b..760ecb38c19 100644 --- a/include/system/memory_cached.h +++ b/include/system/memory_cached.h @@ -117,7 +117,7 @@ void address_space_stb_cached(MemoryRegionCache *cache, * are relative to @addr. */ int64_t address_space_cache_init(MemoryRegionCache *cache, - AddressSpace *as, + const AddressSpace *as, hwaddr addr, hwaddr len, bool is_write); diff --git a/system/physmem.c b/system/physmem.c index e8a2c438c7d..b33aa14ab64 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3829,7 +3829,7 @@ void cpu_physical_memory_unmap(void *buffer, hwaddr l= en, #include "memory_ldst.c.inc" =20 int64_t address_space_cache_init(MemoryRegionCache *cache, - AddressSpace *as, + const AddressSpace *as, hwaddr addr, hwaddr len, bool is_write) --=20 2.53.0 From nobody Sun Jul 26 13:28:55 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1781575524; cv=none; d=zohomail.com; s=zohoarc; b=jslDtwSiaVMJ9/yzmzbg9HbQ2rKRVq7ttTHB/S2w4fkrC75r5c90oBKj7Nv2lFX/82sT/5TSPP18ndUUvYEesd0NAkPGoLqZ6mOlzxke6E82L0AxNBoTRfdkENLWPDEw6IhUZQfzbg1NlEbfOczk5brTlCkG+kYH/Z9Iidzsu1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781575524; 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=NAhqKK7+Vu7qtKIk3dyuaazJ1lv3y+VNix17Z5KE80I=; b=jmqIDkQNfDTyajLQNNcYTh5rM4it6q/Ld4Tu1RYEZj101U7RFKH5ls9Cq74lnlisn7oBsu28AOYjvXL4WYhSu/fUqrZPm1zObjXxr3btvbGl3EcYrgZ87ontdHFq9Ux46IyD5E1CcIX9VQr2ZYKIVcofP5fvBZ2cJbo36EOI/AQ= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781575524309833.5103867185486; Mon, 15 Jun 2026 19:05:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZJAT-0006lB-9p; Mon, 15 Jun 2026 22:04:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJAS-0006kq-4b for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:44 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJAQ-000824-AE for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:43 -0400 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65G202id1748223 for ; Tue, 16 Jun 2026 02:04:40 GMT Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eter041h5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 02:04:40 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-915d1d4fc5aso687458985a.3 for ; Mon, 15 Jun 2026 19:04:40 -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-4606f263945sm40456639f8f.8.2026.06.15.19.04.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 15 Jun 2026 19:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= NAhqKK7+Vu7qtKIk3dyuaazJ1lv3y+VNix17Z5KE80I=; b=gNB9eF/SX+ne/54F 44kC8Enp3jjj7702MKJb7cdZBSGLUyBFPU5UkaTBED291ZrpIyaqgAgVh7UDesRo BHpmQTLIqjqoN8f0nFqOIzAKB4reGD7rQZCTg3fV95XYBQR0k5cj2w31N0Mkhq5G Z4Mhzsz3vZ35ibG7APSq2F65iLcZMrYtZIH/P44eEej8vb2R8sePMDsHKN6kXnol 37ZmHJH/bT+7/Fi0mxgzhF6rSMaiq1BxI8Gnm5An4kCWeFlc4IShYNw4uMLCVe+H 0lxsb8Q5xfAHrJpQwZg+8mEg7zhoE+Y+DCb7cEVVvPetBW6TXWzyg2o8a4JVQ7SO +AhQwg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781575480; x=1782180280; 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=NAhqKK7+Vu7qtKIk3dyuaazJ1lv3y+VNix17Z5KE80I=; b=h7ohdyYPg3rhFx3zFevOMAtDBO5jvlXzzovklU4irc0pka44yS2vugrkPcWnbAgFv0 39eaCTEPFabnUzBRviVVFjlELsENlNLqVfu2aIvCus5tpMLVo/KQ8Y+Sqn2OX7AYsiCy NtD1Ccri0zZTx88WyII4gc+mC1h7Jn6xvGhYc4L9ZZPN4tKKcB9jk2yscEsjtQf19hzY /x/ZDIZ0DXhzeDEcQm+LENs6zKK7wkgZQtBEfXVIFVwXUcfLxCKm3Tq1NV62qMGwjSnm +3ZI/AxZ1o6y9PiUCbNGuSFYX0JDMM39QC9KRoBXudO2pVL1NQ0zcyq3FtA3kLWz9Usq gNgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781575480; x=1782180280; 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=NAhqKK7+Vu7qtKIk3dyuaazJ1lv3y+VNix17Z5KE80I=; b=ZmblorNP4Kwgn+xh05O1zaL4a0yXDfWGVU0yQljsKHEQT3IL3ovKSgzc7DVTgDDJqW yq0O/32FJ2TP3JJhVAJI8OjKvtOqb0wM3mI6Yl1z4DhJwIxKoeq7AO6d7Mna9K+BnNSJ mlVDQk4BGwsjdqhe4VvnDdhSkyJmD83IJIiL/k8Jxg804Tw+82LTDTL5GbSTYvkBkEUU 8oc8wpYkATZUiVIzls1NN7jlAVEAj7wsXOy6ihpwno47zYlFj29s9Gt/ZFRmOCFdTSjq zPAVEUX5s8Rmh12o/OYflb+WlpqTS4/PQcMwgwZ+6AwLpgP334icXeY1XwqrKP90BuYs aRbg== X-Gm-Message-State: AOJu0Yw0Nen9BhhdRgzoUTATVjXVbQH9kt/2IYxRIKOVwR5QK9vQ/vrg H5E8vF5GxN6ntBrNs88+migzkNXTG5WFRcTi9tXIQTjFDlQ6rGQBUKh4Q9bMG3/48SA8tlw5psK 4j2xI4ova2R6SmuXnJSUNqRFGMyDyCgKy2juElfhV37MM2NflvMgDLi3EGcON8dMLkA== X-Gm-Gg: Acq92OFg9kmHmWypzTIirW4KGWUQuAFL/e7U3MUR8ph/ID8hicutnZmkbSCcrEJ/RXO qOlsmYQ7S29uMax06bf6Y+qawu33OBaGBz1h0euUBv6A0WUiJQQsBhAqdsj3PiQ3MHSXDSvdkwr oZNDbIC3a3FOPw2DKOGWDpgUBKfsC5s7LKieLxuJxCdN91ddy6jMBJ9AV+0b+ynYm7msXoukrLX zjUDxZSng7E3IqQ1PfqItdMlPDCn/ZK09ikEM5r83XpsSAakk50dslYiSuGWCGYTmEuoSmf1VYm qEAt4MAWrcNCEaSZ6o9JDCV7dexPejiultjAgcxF3EuWgmzxNEk8FG/tsuA3Ntcw+Up9lKMJXBn U+KnOn6eDccc464NuIcReAZ4V/p1gL7vGVUn62NedF2bPzl6dYQ8qOnSHDEDSK5x3yKbmkQiaLc c09hs= X-Received: by 2002:a05:620a:f0b:b0:90f:5da3:950e with SMTP id af79cd13be357-9161baf48a4mr2561459685a.9.1781575479547; Mon, 15 Jun 2026 19:04:39 -0700 (PDT) X-Received: by 2002:a05:620a:f0b:b0:90f:5da3:950e with SMTP id af79cd13be357-9161baf48a4mr2561456685a.9.1781575479125; Mon, 15 Jun 2026 19:04:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Xu , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 5/6] system/memory: Constify various AddressSpace arguments (access) Date: Tue, 16 Jun 2026 04:03:57 +0200 Message-ID: <20260616020359.18627-6-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260616020359.18627-1-philmd@oss.qualcomm.com> References: <20260616020359.18627-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: 9xu-GO0vmLdZHi1coZkO6sTT9g2f36Fx X-Proofpoint-GUID: 9xu-GO0vmLdZHi1coZkO6sTT9g2f36Fx X-Authority-Analysis: v=2.4 cv=UPzt2ify c=1 sm=1 tr=0 ts=6a30af38 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=6VrJFKV1bllTVhfUZIYA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=PEH46H7Ffwr30OY-TuGO:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfX/4Kiwz9xH+D4 RzELZqYlYi17WlheEXTk//tY0dZG0s45255zV3HjzJZFRDv2awy5+tC7/RaHys3qnJGTjIbhx/J gUxR1M68Z92KT12Pqj40VUC981vIyLTtq+Q0KecX57OmbJYkbIimN79kP44lugunSVTSFtN03uB AZrPwVDegyGDzUYqAYOxiv2G8OoMvOljkllASOYrFjNrW8Fd1DCJGn3Y2GzId4lo2lDyx6tehj8 2tPZJIHXarGjN3JtqFjFd2u8YBqpidx7tZMta8+4Att+4czeZExnz8eqJ0TWNyK46bJjqCqhKpX Z/1hPdSVpKB2S1i9SQVRulgMgo99Wl1brnCwXo4R17YSBpxi12sxYzcqVe7cC1JxMKokFTJFmZZ f9WiOyivCVg1VflvpKe6IKNMYD4nx7s7MCDgx+iGQH/vvyxY3MzZ0PHz3MMPTZzK4X3QkLAsAOR 4m1JcMYnrv9HXr0Ruow== X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfX2CJAAF1f8/tr hg+PuKsZpzbKKt32dhmcn12tEb19cEjF34qpCPLE3NRRmQLY/vrjw2Fx/A0eNxfe9TBt0+lUUeB Q5oHDz5lWUoIea+qarV8CPrhk2WQ+do= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_01,2026-06-15_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 suspectscore=0 phishscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606040000 definitions=main-2606160016 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1781575525790158500 From: Philippe Mathieu-Daud=C3=A9 Mark the AddressSpace structure const when it is only accessed read-only. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/system/memory.h | 13 +++++++------ system/physmem.c | 12 +++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/system/memory.h b/include/system/memory.h index fbb4166008a..918f5bc80c2 100644 --- a/include/system/memory.h +++ b/include/system/memory.h @@ -2698,7 +2698,7 @@ void address_space_remove_listeners(const AddressSpac= e *as); * @len: the number of bytes to read or write * @is_write: indicates the transfer direction */ -MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, +MemTxResult address_space_rw(const AddressSpace *as, hwaddr addr, MemTxAttrs attrs, void *buf, hwaddr len, bool is_write); =20 @@ -2715,7 +2715,7 @@ MemTxResult address_space_rw(AddressSpace *as, hwaddr= addr, * @buf: buffer with the data transferred * @len: the number of bytes to write */ -MemTxResult address_space_write(AddressSpace *as, hwaddr addr, +MemTxResult address_space_write(const AddressSpace *as, hwaddr addr, MemTxAttrs attrs, const void *buf, hwaddr len); =20 @@ -2778,7 +2778,8 @@ MemTxResult address_space_write_rom(AddressSpace *as,= hwaddr addr, #include "system/memory_ldst_phys.h.inc" #endif =20 -void address_space_flush_icache_range(AddressSpace *as, hwaddr addr, hwadd= r len); +void address_space_flush_icache_range(AddressSpace *as, + hwaddr addr, hwaddr len); =20 /* address_space_get_iotlb_entry: translate an address into an IOTLB * entry. Should be called from an RCU critical section. @@ -2898,7 +2899,7 @@ void address_space_register_map_client(AddressSpace *= as, QEMUBH *bh); void address_space_unregister_map_client(AddressSpace *as, QEMUBH *bh); =20 /* Internal functions, part of the implementation of address_space_read. = */ -MemTxResult address_space_read_full(AddressSpace *as, hwaddr addr, +MemTxResult address_space_read_full(const AddressSpace *as, hwaddr addr, MemTxAttrs attrs, void *buf, hwaddr le= n); MemTxResult flatview_read_continue(FlatView *fv, hwaddr addr, MemTxAttrs attrs, void *buf, @@ -2953,7 +2954,7 @@ static inline bool memory_access_is_direct(const Memo= ryRegion *mr, * @len: length of the data transferred */ static inline __attribute__((__always_inline__)) -MemTxResult address_space_read(AddressSpace *as, hwaddr addr, +MemTxResult address_space_read(const AddressSpace *as, hwaddr addr, MemTxAttrs attrs, void *buf, hwaddr len) { @@ -2996,7 +2997,7 @@ MemTxResult address_space_read(AddressSpace *as, hwad= dr addr, * @len: the number of bytes to fill with the constant byte * @attrs: memory transaction attributes */ -MemTxResult address_space_set(AddressSpace *as, hwaddr addr, +MemTxResult address_space_set(const AddressSpace *as, hwaddr addr, uint8_t c, hwaddr len, MemTxAttrs attrs); =20 /* Coalesced MMIO regions are areas where write operations can be reordere= d. diff --git a/system/physmem.c b/system/physmem.c index b33aa14ab64..d202e540c09 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3416,7 +3416,7 @@ static MemTxResult flatview_read(FlatView *fv, hwaddr= addr, mr_addr, l, mr); } =20 -MemTxResult address_space_read_full(AddressSpace *as, hwaddr addr, +MemTxResult address_space_read_full(const AddressSpace *as, hwaddr addr, MemTxAttrs attrs, void *buf, hwaddr le= n) { MemTxResult result =3D MEMTX_OK; @@ -3431,7 +3431,7 @@ MemTxResult address_space_read_full(AddressSpace *as,= hwaddr addr, return result; } =20 -MemTxResult address_space_write(AddressSpace *as, hwaddr addr, +MemTxResult address_space_write(const AddressSpace *as, hwaddr addr, MemTxAttrs attrs, const void *buf, hwaddr len) { @@ -3447,7 +3447,8 @@ MemTxResult address_space_write(AddressSpace *as, hwa= ddr addr, return result; } =20 -MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs att= rs, +MemTxResult address_space_rw(const AddressSpace *as, + hwaddr addr, MemTxAttrs attrs, void *buf, hwaddr len, bool is_write) { if (is_write) { @@ -3457,7 +3458,7 @@ MemTxResult address_space_rw(AddressSpace *as, hwaddr= addr, MemTxAttrs attrs, } } =20 -MemTxResult address_space_set(AddressSpace *as, hwaddr addr, +MemTxResult address_space_set(const AddressSpace *as, hwaddr addr, uint8_t c, hwaddr len, MemTxAttrs attrs) { #define FILLBUF_SIZE 512 @@ -3514,7 +3515,8 @@ MemTxResult address_space_write_rom(AddressSpace *as,= hwaddr addr, return MEMTX_OK; } =20 -void address_space_flush_icache_range(AddressSpace *as, hwaddr addr, hwadd= r len) +void address_space_flush_icache_range(AddressSpace *as, + hwaddr addr, hwaddr len) { /* * This function should do the same thing as an icache flush that was --=20 2.53.0 From nobody Sun Jul 26 13:28:55 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1781575510; cv=none; d=zohomail.com; s=zohoarc; b=IqDsTB/1WtWL0tqiNWQEGQIFgK9CfwKOW/7sLpzkIGQHudOsoNDrz+LdUFJu/esqxhdOZREgt9n9nTDy27gWqA95xf7dXuDj6RUBnmO+svRvlyjYFe8pHhNYNE0+BXsFoiH9FBP+j9+XLvhPXMDiZof2LSod0n/FBwOLLEs6S+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781575510; 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=R2wGHPAeHsBapB1nBDD8SmHsqh/WIW2RgVo66lnwkpA=; b=XTdolz75MP7YKBpuPzQ74fhN3ZgAYUIKE9cYZNi/Gs19LXrp/gS/BQ93yT2NLeR8FlJWbcuWqZK2R5/LY43ZZqG9b8qExJB+ZaTDWhpAskfDvSuZJ4Pgch74l3M1g+q+4B4Hw0AAkp+nM9oYP4qsTXiqxHKRB6RSedjjnzCPcW0= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781575510326874.0743040330443; Mon, 15 Jun 2026 19:05:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZJAc-0006pZ-J3; Mon, 15 Jun 2026 22:04:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJAa-0006oo-R3 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:52 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZJAX-00083h-M6 for qemu-devel@nongnu.org; Mon, 15 Jun 2026 22:04:52 -0400 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65G1xq0M2300445 for ; Tue, 16 Jun 2026 02:04:48 GMT Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eter245e9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 02:04:48 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-9158f2c4b55so647319385a.0 for ; Mon, 15 Jun 2026 19:04:48 -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-49230a96b47sm13015455e9.13.2026.06.15.19.04.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 15 Jun 2026 19:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= R2wGHPAeHsBapB1nBDD8SmHsqh/WIW2RgVo66lnwkpA=; b=cfhloVCwD4TfbOId 2TXt9B+w+Wq+rz8YorExhZaArmS/Zeoz+E6H0mI0XACrau+I+nY5s0rqB8QVC3ci Hyiizemd64+LIlKWh8k2KRweb6FD0okg6i2Ng9VupFVb1CnSiXs4j+inYfMrSrA8 +xq7MsTSI8unBvAvsQmAFAm2R7uAmOfOyPOHdvTPWfrfQB89CtxJQjNKlTZy5WvX usHxCiiaMBE2n/MSSGKsQtNq28NwPWwYEINxmtvsp1XSzEuVTYZb4GVG+/tBAZVe P97gOA6uk3fi2dVYqBe1PsG+GNVN5iB9mqs4bVRKHbiI//UJu/a5Oxx5DVIMv2Ua joyuFw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781575488; x=1782180288; 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=R2wGHPAeHsBapB1nBDD8SmHsqh/WIW2RgVo66lnwkpA=; b=SyTeIqywB6FltibvSOkVttc1e9ifFFIojCljpw3fb2ys0ZH1tbXKlj9QxXHjfxfo5O 5psPErpobbEKKbzqTEtxmjPqRLxX7/Rmxt0Eb4KX0h9MWTMrJqqKHOq4Cj1FmFqqv6BK xNIMYAayexQUKYqr1d4LeGJBSF+SFjiqME9vqJuaDVRo/F3j9GbgEgeX4eaghvQflQOC JMm2zbQrzhcDNPb7BjkWp6m7sOL64XT3xlMa78EwX3pevAkaB/OmLRaP2d5r9nl3z/NP y/4TWGDcn4PoWz4Dy1/gCBVOFs1inZlDIm452ClUxGtgpjtrbgA8nYLCtUjFbd46wOBX CQjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781575488; x=1782180288; 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=R2wGHPAeHsBapB1nBDD8SmHsqh/WIW2RgVo66lnwkpA=; b=DMjSNRYcgMPL8Gna3qZBQz0Au98RNJY0eYIRHIz/rZtTn0AhS8s9Sn0lf/ngN64Gn2 jgwqXxFPWVprB5dQ/58A8VyP+XPGzER3tv9QRPLVKC94SyOYiXoPUk4n2vtUxC5xbEPY sQa2e2uLSkkv8A83RoBEmHhqCVolvj0UNGtaMrNm4jqUiXA0TBRpZSIuCCVkylqwq0Fh K/iCMJThABkpa8augU/ej5YfMz81Ir80Utb1Wb9dJYXKSAZ/zit4L5YAegZ/ni7GJfj+ IYmtKTO9cUS+mhngP07bNdejyFugOPEyaZ7t0pSCchwUTJttdafgRQobvoVPKHg4oapg xdSA== X-Gm-Message-State: AOJu0Yx1RH6mA1XlFTrE7IRXnbnyNtFh2Vq9T6x5dxAA3iB8PeQFMrFc sAnl4e5TqOqzCsu1aq+bHzm6Rj2+nYVEy1ia7rXbup+3ru+TRC0bZOyJnM4ZCvWHZMjUo8HbDK/ cZMwVoYG/tJSarweXKMUKvcSoulVB1KOQgRU30mz8/9e8vAW/aIBWyNBlO7Zvzp60Gw== X-Gm-Gg: Acq92OGFa+1/QR32/tb7HtNEKJDjInnPJl8ws5bew6gyY4CPjmVNXRrWyxnWSFnXaiJ xNOQRmDKPGzMi1aGVHm489m+IaYb6b4n8wRM9nzB2/RiUVlyrMaZBGXngjHs2Zak/8ALKRWtF2X WxpQAxlwT/TvoV0yaXYYB88OnuEtIPRXQ+l9TKVnV01PTtKMCHQA27LiOKo2Kqax2PgqlykmuMh UflV3Eiv7zlGlSiKN1Rtiz80WO3Q8ylf9V8kjWcTmvCC5ZDUvFrIx0mCUO2hAWr/KVLzCrgKuf9 QkXbwMc1T1hDpBHtD4GPVNUcM3vxvOucURkrSifMdJAn5Dp86CVH4sLPU/YwQPc8TAQ+XSGkuZw lVQfeMNyeQE7mljP+bs+rbBwAkjvL7aaholafon230rlJdjts14H1J9AWjmS5USdhqeYQN72V5e XAQE0= X-Received: by 2002:a05:620a:2890:b0:915:d443:e6e1 with SMTP id af79cd13be357-91c2602d5fbmr346673185a.26.1781575487861; Mon, 15 Jun 2026 19:04:47 -0700 (PDT) X-Received: by 2002:a05:620a:2890:b0:915:d443:e6e1 with SMTP id af79cd13be357-91c2602d5fbmr346670085a.26.1781575487392; Mon, 15 Jun 2026 19:04:47 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Xu , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 6/6] system/memory: Constify various MemoryRegionCache arguments Date: Tue, 16 Jun 2026 04:03:58 +0200 Message-ID: <20260616020359.18627-7-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260616020359.18627-1-philmd@oss.qualcomm.com> References: <20260616020359.18627-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfX49QvRJZslNeA WDwINZHkM8A5wGZdS6YR5gVlksbQRp3uPO8CCWSn/QfJneTML/qrUAdT//5T+GQmufCcX5k0Fs9 ZKXQ+HUjlDFuBS6aNaIrPVIoI2uxQGM= X-Proofpoint-GUID: ca_ZVjprW7fyEJ09HjfDIBJn3Omsskvp X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDAxNiBTYWx0ZWRfXy/jNPP8/svSO 2NBs4YCN4ffUHZjQNiolr+UaevhnF5/p/Qe3YxMwp8YcdEGbNBjsqBegnLVuz14+L/sOX2rYm0p wrs3bDjw35psiH+aRwzkyoPRj3K1RfRcw+p7K/5yP4FnQe8yoj4AQukTys/grleFICWG1OIKAlx yxedGnpOKsbYg0SVkvFwmDSCxzWu9bKUuSNFxlpi5GZPS4GAMubGKBP7Pxpy/5/qw6BdQPkEUgO RbBbidHpuuRInHeEA33G56UcYMHlnAbsNSvdYQXuXPlz4KVjishAG0sC3up4PWs9kJOwCH3nCRf ELCsBI/6MSASqesvyCNGWGbPrKPg62/jD5WtEkeIWyuSY0RJGVYyoSLs+zz1II+R6EBm/ROR1jV Xz+JEpYsASavTfpPHYV2ant2+vIszPa//CqFJl4fxBYGRUUIG9w0KKMEiY8hkiR3MFhhLP+a9Uu YeESYKRSkX1Qti+l4TA== X-Authority-Analysis: v=2.4 cv=F4tnsKhN c=1 sm=1 tr=0 ts=6a30af40 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=fhQonfk0Xf6UbOH1hI0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: ca_ZVjprW7fyEJ09HjfDIBJn3Omsskvp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_01,2026-06-15_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 clxscore=1015 impostorscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606040000 definitions=main-2606160016 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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 @qualcomm.com) X-ZM-MESSAGEID: 1781575511639158500 From: Philippe Mathieu-Daud=C3=A9 Mark the MemoryRegionCache structure const when it is only accessed read-only. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/system/memory_cached.h | 18 +++++++++--------- include/system/memory_ldst_cached.h.inc | 15 +++++++++------ system/physmem.c | 10 +++++----- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/include/system/memory_cached.h b/include/system/memory_cached.h index 760ecb38c19..09d46821bec 100644 --- a/include/system/memory_cached.h +++ b/include/system/memory_cached.h @@ -51,12 +51,12 @@ struct MemoryRegionCache { =20 #define SUFFIX _cached_slow #define ARG1 cache -#define ARG1_DECL MemoryRegionCache *cache +#define ARG1_DECL const MemoryRegionCache *cache #include "system/memory_ldst.h.inc" =20 /* Inline fast path for direct RAM access. */ static inline -uint8_t address_space_ldub_cached(MemoryRegionCache *cache, hwaddr addr, +uint8_t address_space_ldub_cached(const MemoryRegionCache *cache, hwaddr a= ddr, MemTxAttrs attrs, MemTxResult *result) { assert(addr < cache->len); @@ -68,7 +68,7 @@ uint8_t address_space_ldub_cached(MemoryRegionCache *cach= e, hwaddr addr, } =20 static inline -void address_space_stb_cached(MemoryRegionCache *cache, +void address_space_stb_cached(const MemoryRegionCache *cache, hwaddr addr, uint8_t val, MemTxAttrs attrs, MemTxResult *result) { @@ -93,7 +93,7 @@ void address_space_stb_cached(MemoryRegionCache *cache, =20 #define SUFFIX _cached #define ARG1 cache -#define ARG1_DECL MemoryRegionCache *cache +#define ARG1_DECL const MemoryRegionCache *cache #include "system/memory_ldst_phys.h.inc" =20 /** @@ -145,7 +145,7 @@ static inline void address_space_cache_init_empty(Memor= yRegionCache *cache) * address that was passed to @address_space_cache_init. * @access_len: The number of bytes that were written starting at @addr. */ -void address_space_cache_invalidate(MemoryRegionCache *cache, +void address_space_cache_invalidate(const MemoryRegionCache *cache, hwaddr addr, hwaddr access_len); =20 @@ -160,9 +160,9 @@ void address_space_cache_destroy(MemoryRegionCache *cac= he); * Internal functions, part of the implementation of address_space_read_ca= ched * and address_space_write_cached. */ -MemTxResult address_space_read_cached_slow(MemoryRegionCache *cache, +MemTxResult address_space_read_cached_slow(const MemoryRegionCache *cache, hwaddr addr, void *buf, hwaddr = len); -MemTxResult address_space_write_cached_slow(MemoryRegionCache *cache, +MemTxResult address_space_write_cached_slow(const MemoryRegionCache *cache, hwaddr addr, const void *buf, hwaddr len); =20 @@ -175,7 +175,7 @@ MemTxResult address_space_write_cached_slow(MemoryRegio= nCache *cache, * @len: length of the data transferred */ static inline MemTxResult -address_space_read_cached(MemoryRegionCache *cache, hwaddr addr, +address_space_read_cached(const MemoryRegionCache *cache, hwaddr addr, void *buf, hwaddr len) { assert(addr < cache->len && len <=3D cache->len - addr); @@ -197,7 +197,7 @@ address_space_read_cached(MemoryRegionCache *cache, hwa= ddr addr, * @len: length of the data transferred */ static inline MemTxResult -address_space_write_cached(MemoryRegionCache *cache, hwaddr addr, +address_space_write_cached(const MemoryRegionCache *cache, hwaddr addr, const void *buf, hwaddr len) { assert(addr < cache->len && len <=3D cache->len - addr); diff --git a/include/system/memory_ldst_cached.h.inc b/include/system/memor= y_ldst_cached.h.inc index d7834f852c4..b4c696bff1f 100644 --- a/include/system/memory_ldst_cached.h.inc +++ b/include/system/memory_ldst_cached.h.inc @@ -24,7 +24,8 @@ #define LD_P(size) \ glue(glue(ld, size), glue(ENDIANNESS, _p)) =20 -static inline uint16_t ADDRESS_SPACE_LD_CACHED(uw)(MemoryRegionCache *cach= e, +static inline +uint16_t ADDRESS_SPACE_LD_CACHED(uw)(const MemoryRegionCache *cache, hwaddr addr, MemTxAttrs attrs, MemTxResult *result) { assert(addr < cache->len && 2 <=3D cache->len - addr); @@ -36,7 +37,8 @@ static inline uint16_t ADDRESS_SPACE_LD_CACHED(uw)(Memory= RegionCache *cache, } } =20 -static inline uint32_t ADDRESS_SPACE_LD_CACHED(l)(MemoryRegionCache *cache, +static inline +uint32_t ADDRESS_SPACE_LD_CACHED(l)(const MemoryRegionCache *cache, hwaddr addr, MemTxAttrs attrs, MemTxResult *result) { assert(addr < cache->len && 4 <=3D cache->len - addr); @@ -48,7 +50,8 @@ static inline uint32_t ADDRESS_SPACE_LD_CACHED(l)(MemoryR= egionCache *cache, } } =20 -static inline uint64_t ADDRESS_SPACE_LD_CACHED(q)(MemoryRegionCache *cache, +static inline +uint64_t ADDRESS_SPACE_LD_CACHED(q)(const MemoryRegionCache *cache, hwaddr addr, MemTxAttrs attrs, MemTxResult *result) { assert(addr < cache->len && 8 <=3D cache->len - addr); @@ -71,7 +74,7 @@ static inline uint64_t ADDRESS_SPACE_LD_CACHED(q)(MemoryR= egionCache *cache, #define ST_P(size) \ glue(glue(st, size), glue(ENDIANNESS, _p)) =20 -static inline void ADDRESS_SPACE_ST_CACHED(w)(MemoryRegionCache *cache, +static inline void ADDRESS_SPACE_ST_CACHED(w)(const MemoryRegionCache *cac= he, hwaddr addr, uint16_t val, MemTxAttrs attrs, MemTxResult *result) { assert(addr < cache->len && 2 <=3D cache->len - addr); @@ -82,7 +85,7 @@ static inline void ADDRESS_SPACE_ST_CACHED(w)(MemoryRegio= nCache *cache, } } =20 -static inline void ADDRESS_SPACE_ST_CACHED(l)(MemoryRegionCache *cache, +static inline void ADDRESS_SPACE_ST_CACHED(l)(const MemoryRegionCache *cac= he, hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result) { assert(addr < cache->len && 4 <=3D cache->len - addr); @@ -93,7 +96,7 @@ static inline void ADDRESS_SPACE_ST_CACHED(l)(MemoryRegio= nCache *cache, } } =20 -static inline void ADDRESS_SPACE_ST_CACHED(q)(MemoryRegionCache *cache, +static inline void ADDRESS_SPACE_ST_CACHED(q)(const MemoryRegionCache *cac= he, hwaddr addr, uint64_t val, MemTxAttrs attrs, MemTxResult *result) { assert(addr < cache->len && 8 <=3D cache->len - addr); diff --git a/system/physmem.c b/system/physmem.c index d202e540c09..d21eb6620dc 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3878,7 +3878,7 @@ int64_t address_space_cache_init(MemoryRegionCache *c= ache, return l; } =20 -void address_space_cache_invalidate(MemoryRegionCache *cache, +void address_space_cache_invalidate(const MemoryRegionCache *cache, hwaddr addr, hwaddr access_len) { @@ -3909,7 +3909,7 @@ void address_space_cache_destroy(MemoryRegionCache *c= ache) * address_space_cache_init. */ static inline MemoryRegion *address_space_translate_cached( - MemoryRegionCache *cache, hwaddr addr, hwaddr *xlat, + const MemoryRegionCache *cache, hwaddr addr, hwaddr *xlat, hwaddr *plen, bool is_write, MemTxAttrs attrs) { MemoryRegionSection section; @@ -3990,7 +3990,7 @@ static MemTxResult address_space_read_continue_cached= (MemTxAttrs attrs, * out of line function when the target is an MMIO or IOMMU region. */ MemTxResult -address_space_read_cached_slow(MemoryRegionCache *cache, hwaddr addr, +address_space_read_cached_slow(const MemoryRegionCache *cache, hwaddr addr, void *buf, hwaddr len) { hwaddr mr_addr, l; @@ -4007,7 +4007,7 @@ address_space_read_cached_slow(MemoryRegionCache *cac= he, hwaddr addr, * out of line function when the target is an MMIO or IOMMU region. */ MemTxResult -address_space_write_cached_slow(MemoryRegionCache *cache, hwaddr addr, +address_space_write_cached_slow(const MemoryRegionCache *cache, hwaddr add= r, const void *buf, hwaddr len) { hwaddr mr_addr, l; @@ -4020,7 +4020,7 @@ address_space_write_cached_slow(MemoryRegionCache *ca= che, hwaddr addr, buf, len, mr_addr, l, mr); } =20 -#define ARG1_DECL MemoryRegionCache *cache +#define ARG1_DECL const MemoryRegionCache *cache #define ARG1 cache #define SUFFIX _cached_slow #define TRANSLATE(...) address_space_translate_cached(cache, __V= A_ARGS__) --=20 2.53.0