qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] roms: Flush icache when writing roms to guest m


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH] roms: Flush icache when writing roms to guest memory
Date: Wed, 11 Dec 2013 15:17:55 +0100

On 11.12.2013, at 15:07, Peter Maydell <address@hidden> wrote:

> On 11 December 2013 13:35, Alexander Graf <address@hidden> wrote:
>> How would KVM know when things changed inside of a memory region?
>> It's up to user space to manage the contents of a memory region, no?
> 
> If the architecture spec says that a freshly reset physical CPU has
> coherent icache and dcache, then resetting the vCPU should also
> ensure the icache and dcache are coherent, so one way to solve
> this would be just to make sure that vcpu reset did the right thing.

Well, this really is a simplified view of the world.

On real hardware the system boots up with caches disabled. Firmware is then 
responsible for enabling caches and flushing things as it goes. Firmware loads 
the kernel into ram, flushing the icache on those regions it wrote to along the 
way. The kernel boots and every time it faults in a page, it flushes caches for 
that page.

So really the problem is that we're skipping the "cache disabled firmware" 
step. With this patch, we're simulating a bootloader's behavior when writing a 
blob into guest memory. Since that's really what we are trying to behave like - 
a bootloader.


Alex




reply via email to

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