qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Avoid cpu_physical_memory_rw() with a constant is_write argu


From: Peter Maydell
Subject: Re: [PATCH] Avoid cpu_physical_memory_rw() with a constant is_write argument
Date: Tue, 18 Feb 2020 21:16:03 +0000

On Tue, 18 Feb 2020 at 20:07, Philippe Mathieu-Daudé <address@hidden> wrote:
> I don't understand well cpu_physical_memory*(). Aren't these obsolete?
> They confuse me when using multi-core CPUs.

They sort of are, but there is no simple mechanical replacement
for them -- you need to look at the individual use to see what
address space it should really be using. For instance the cases
in hw/dma/ probably would require the device to be updated to
the new pattern where it takes a MemoryRegion defining what
it should be doing DMA to, and then it can create an AddressSpace
and use that with address_space_*. But that's a bunch of work
on older devices which mostly people don't care very much about.

In theory we could do a textual replacement of cpu_physical_memory*
with address_space_rw(&address_space_memory,...)
but that's usually not the right address space, so I'm not
sure that churn is worthwhile.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]