[PATCH-for-11.1 0/8] system/memory: Constify various AddressSpace/MemoryRegionCache arguments

Philippe Mathieu-Daudé posted 8 patches 2 days, 17 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260319191017.12636-1-philmd@linaro.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Peter Xu <peterx@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
include/system/memory.h                 | 32 +++++++++---------
include/system/memory_cached.h          | 20 +++++------
system/memory-internal.h                |  5 +--
include/system/memory_ldst_cached.h.inc | 15 +++++----
system/memory.c                         | 18 +++++-----
system/physmem.c                        | 44 ++++++++++++++-----------
6 files changed, 73 insertions(+), 61 deletions(-)
[PATCH-for-11.1 0/8] system/memory: Constify various AddressSpace/MemoryRegionCache arguments
Posted by Philippe Mathieu-Daudé 2 days, 17 hours ago
When structures are only accessed read-only, it is safer to mark
them const to protect against invalid API (ab)uses. This is also
an useful hint to compilers.

Philippe Mathieu-Daudé (8):
  system/memory: Constify various AddressSpace arguments (flatview)
  system/memory: Constify various AddressSpace arguments (checks)
  system/memory: Constify various AddressSpace arguments (xlat)
  system/memory: Constify various AddressSpace arguments (flat-range)
  system/memory: Constify various AddressSpace arguments (notify)
  system/memory: Constify various AddressSpace arguments (cache)
  system/memory: Constify various AddressSpace arguments (access)
  system/memory: Constify various MemoryRegionCache arguments

 include/system/memory.h                 | 32 +++++++++---------
 include/system/memory_cached.h          | 20 +++++------
 system/memory-internal.h                |  5 +--
 include/system/memory_ldst_cached.h.inc | 15 +++++----
 system/memory.c                         | 18 +++++-----
 system/physmem.c                        | 44 ++++++++++++++-----------
 6 files changed, 73 insertions(+), 61 deletions(-)

-- 
2.53.0


Re: [PATCH-for-11.1 0/8] system/memory: Constify various AddressSpace/MemoryRegionCache arguments
Posted by Pierrick Bouvier 2 days, 15 hours ago
On 3/19/26 12:10 PM, Philippe Mathieu-Daudé wrote:
> When structures are only accessed read-only, it is safer to mark
> them const to protect against invalid API (ab)uses. This is also
> an useful hint to compilers.
> 
> Philippe Mathieu-Daudé (8):
>    system/memory: Constify various AddressSpace arguments (flatview)
>    system/memory: Constify various AddressSpace arguments (checks)
>    system/memory: Constify various AddressSpace arguments (xlat)
>    system/memory: Constify various AddressSpace arguments (flat-range)
>    system/memory: Constify various AddressSpace arguments (notify)
>    system/memory: Constify various AddressSpace arguments (cache)
>    system/memory: Constify various AddressSpace arguments (access)
>    system/memory: Constify various MemoryRegionCache arguments
> 
>   include/system/memory.h                 | 32 +++++++++---------
>   include/system/memory_cached.h          | 20 +++++------
>   system/memory-internal.h                |  5 +--
>   include/system/memory_ldst_cached.h.inc | 15 +++++----
>   system/memory.c                         | 18 +++++-----
>   system/physmem.c                        | 44 ++++++++++++++-----------
>   6 files changed, 73 insertions(+), 61 deletions(-)
> 

Series:
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>