diff options
| author | David Hildenbrand <david@redhat.com> | 2025-02-10 09:46:46 +0100 |
|---|---|---|
| committer | Peter Xu <peterx@redhat.com> | 2025-02-12 11:33:05 -0500 |
| commit | d732b5a4ac3e8222e9527654f067bb766fdaecb6 (patch) | |
| tree | 4c59e14105ab1fcde4b0f07d7d8d4d5fc6a382d1 /include/exec/memory.h | |
| parent | d4337aa8e222802d342b9f58440ca8e005b8bf91 (diff) | |
| download | focaccia-qemu-d732b5a4ac3e8222e9527654f067bb766fdaecb6.tar.gz focaccia-qemu-d732b5a4ac3e8222e9527654f067bb766fdaecb6.zip | |
memory: pass MemTxAttrs to memory_access_is_direct()
We want to pass another flag that will be stored in MemTxAttrs. So pass MemTxAttrs directly. Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: David Hildenbrand <david@redhat.com> Link: https://lore.kernel.org/r/20250210084648.33798-6-david@redhat.com [peterx: Fix MacOS builds] Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'include/exec/memory.h')
| -rw-r--r-- | include/exec/memory.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h index 4e2cf95ab6..b18ecf933e 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -3012,7 +3012,8 @@ static inline bool memory_region_supports_direct_access(MemoryRegion *mr) return !memory_region_is_ram_device(mr); } -static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write) +static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write, + MemTxAttrs attrs) { if (!memory_region_supports_direct_access(mr)) { return false; @@ -3053,7 +3054,7 @@ MemTxResult address_space_read(AddressSpace *as, hwaddr addr, fv = address_space_to_flatview(as); l = len; mr = flatview_translate(fv, addr, &addr1, &l, false, attrs); - if (len == l && memory_access_is_direct(mr, false)) { + if (len == l && memory_access_is_direct(mr, false, attrs)) { ptr = qemu_map_ram_ptr(mr->ram_block, addr1); memcpy(buf, ptr, len); } else { |