qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] PAM: make PAM emulation closer to documentat


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2] PAM: make PAM emulation closer to documentation
Date: Tue, 21 Jul 2015 09:46:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1


On 20/07/2015 12:53, Efimov Vasily wrote:
> This patch improves PAM emulation.
> 
> PAM defines 4 memory access redirection modes. In mode 1 reads are directed to
> RAM and writes are directed to PCI. In mode 2 it is contrary. In mode 0 all
> access is directed to PCI. In mode 3 it is directed to RAM. Currently all 
> modes
> are emulated using aliases. It is good for modes 0 and 3 but modes 1 and 2
> require more complicated logic. Present API has not needed region type.
> 
> The patch uses ROM-like regions for modes 1 and 2. Each region has I/O 
> callbacks
> to redirect access to destination defined by current mode. Write access is
> always redirected by callback. If actual read source is RAM or ROM (it is
> common case) then ram_addr of PAM region is set to ram_addr of source region
> with offset. Otherwise, when source region is an I/O region, reading is
> redirected to source region read callback by PAM region one.
> 
> The reasons of ram_addr modification for read redirection are:
> - QEMU cannot execute code outside RAM or ROM (while BIOS tries exactly that);
> - it is faster because of TLB is used.
> 
> Redirection is based on address spaces: for PCI and for RAM. QEMU has no ones 
> so
> PAM creates private address spaces with root regions that alias to actual PCI
> and RAM regions.
> 
> The memory commit callbacks are used to keep read source and write destination
> address spaces and ram_addr up to date.
> 
> Signed-off-by: Efimov Vasily <address@hidden>

Out of curiosity, would it be necessary to flush the TLB when the PAM
registers change?

In QEMU, the TLB also has the function of a cache in some sense
(because, by pointing to a ram_addr_t, it prevents reads, writes or
fetches from going through the slow MMIO path).

Paolo



reply via email to

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