diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-09-29 13:38:52 +0200 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-10-07 05:03:56 +0200 |
| commit | 62c889eb7dfd4da5e30e9496496917bad53851fe (patch) | |
| tree | 376b2d3de846abefbd6921a8d1407c6216f584f2 | |
| parent | 84a8e6399bc06550e41f5b2f7b94e4a2213b2ebc (diff) | |
| download | focaccia-qemu-62c889eb7dfd4da5e30e9496496917bad53851fe.tar.gz focaccia-qemu-62c889eb7dfd4da5e30e9496496917bad53851fe.zip | |
system/physmem: Un-inline cpu_physical_memory_set_dirty_flag()
Avoid maintaining large functions in header, rely on the linker to optimize at linking time. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20251001175448.18933-11-philmd@linaro.org>
| -rw-r--r-- | include/system/ram_addr.h | 19 | ||||
| -rw-r--r-- | system/physmem.c | 18 |
2 files changed, 19 insertions, 18 deletions
diff --git a/include/system/ram_addr.h b/include/system/ram_addr.h index 2dcca260b2..81d26eb149 100644 --- a/include/system/ram_addr.h +++ b/include/system/ram_addr.h @@ -150,24 +150,7 @@ uint8_t cpu_physical_memory_range_includes_clean(ram_addr_t start, ram_addr_t length, uint8_t mask); -static inline void cpu_physical_memory_set_dirty_flag(ram_addr_t addr, - unsigned client) -{ - unsigned long page, idx, offset; - DirtyMemoryBlocks *blocks; - - assert(client < DIRTY_MEMORY_NUM); - - page = addr >> TARGET_PAGE_BITS; - idx = page / DIRTY_MEMORY_BLOCK_SIZE; - offset = page % DIRTY_MEMORY_BLOCK_SIZE; - - RCU_READ_LOCK_GUARD(); - - blocks = qatomic_rcu_read(&ram_list.dirty_memory[client]); - - set_bit_atomic(offset, blocks->blocks[idx]); -} +void cpu_physical_memory_set_dirty_flag(ram_addr_t addr, unsigned client); static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start, ram_addr_t length, diff --git a/system/physmem.c b/system/physmem.c index 144fd7303b..50235e8853 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -1012,6 +1012,24 @@ uint8_t cpu_physical_memory_range_includes_clean(ram_addr_t start, return ret; } +void cpu_physical_memory_set_dirty_flag(ram_addr_t addr, unsigned client) +{ + unsigned long page, idx, offset; + DirtyMemoryBlocks *blocks; + + assert(client < DIRTY_MEMORY_NUM); + + page = addr >> TARGET_PAGE_BITS; + idx = page / DIRTY_MEMORY_BLOCK_SIZE; + offset = page % DIRTY_MEMORY_BLOCK_SIZE; + + RCU_READ_LOCK_GUARD(); + + blocks = qatomic_rcu_read(&ram_list.dirty_memory[client]); + + set_bit_atomic(offset, blocks->blocks[idx]); +} + /* Note: start and end must be within the same ram block. */ bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t start, ram_addr_t length, |