@samitouri / QOSamiQemu / commits / c08b84cd6e

accel/kvm: Replace legacy cpu_physical_memory_write() call

cpu_physical_memory_write() is legacy (see commit b7ecba0f6f6), replace it by address_space_write(). Both if() ladders only differ in the address space argument: rework to have a single address_space_write() call. No logical change intended. Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20260616020839.19104-3-philmd@oss.qualcomm.com>

Philippe Mathieu-Daudé committed Jun 11, 2026 at 10:35 UTC c08b84cd6e55b7dde247a396450d49a069775235
1 file changed +4 -8
accel/kvm/kvm-all.c
+4 -8
@@ -3178,16 +3178,12 @@ void kvm_flush_coalesced_mmio_buffer(void)
3178 struct kvm_coalesced_mmio_ring *ring = s->coalesced_mmio_ring;
3179 while (ring->first != ring->last) {
3180 struct kvm_coalesced_mmio *ent;
3181 + const AddressSpace *as;
3182
3183 ent = &ring->coalesced_mmio[ring->first];
3183 -
3184 - if (ent->pio == 1) {
3185 - address_space_write(&address_space_io, ent->phys_addr,
3186 - MEMTXATTRS_UNSPECIFIED, ent->data,
3187 - ent->len);
3188 - } else {
3189 - cpu_physical_memory_write(ent->phys_addr, ent->data, ent->len);
3190 - }
3184 + as = ent->pio == 1 ? &address_space_io : &address_space_memory;
3185 + address_space_write(as, ent->phys_addr, MEMTXATTRS_UNSPECIFIED,
3186 + ent->data, ent->len);
3187 smp_wmb();
3188 ring->first = (ring->first + 1) % KVM_COALESCED_MMIO_MAX;
3189 }