From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH 19/38] KVM: PPC: Add cache flush on page map Date: Wed, 15 Aug 2012 12:26:02 -0500 Message-ID: <502BDBAA.6030708@freescale.com> References: <1344985483-7440-1-git-send-email-agraf@suse.de> <1344985483-7440-20-git-send-email-agraf@suse.de> <502AFA29.3030201@freescale.com> <3882D134-C53C-42D2-BEE5-EC21A07B3937@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: , KVM list To: Alexander Graf Return-path: In-Reply-To: <3882D134-C53C-42D2-BEE5-EC21A07B3937@suse.de> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 08/15/2012 04:52 AM, Alexander Graf wrote: > > On 15.08.2012, at 03:23, Scott Wood wrote: > >> On 08/14/2012 06:04 PM, Alexander Graf wrote: >>> When we map a page that wasn't icache cleared before, do so when first >>> mapping it in KVM using the same information bits as the Linux mapping >>> logic. That way we are 100% sure that any page we map does not have stale >>> entries in the icache. >> >> We're not really 100% sure of that -- this only handles the case where >> the kernel does the dirtying, not when it's done by QEMU or the guest. > > When the guest does it, the guest is responsible for clearing the > icache. Same for QEMU. It needs to clear it when doing DMA. Sure. I was just worried that that commit message could be taken the wrong way, as in "we no longer need the QEMU icache flushing patch". > However, what is still broken would be a direct /dev/mem map. There > QEMU should probably clear the icache before starting the guest, in > case another guest was running on that same memory before. > Fortunately, we don't have that mode available in upstream QEMU :). How is QEMU loading images different if it's /dev/mem versus ordinary anonymous memory? You probably won't have stale icache data in the latter case (which makes it less likely to be a problem in pratice), but in theory you could have data that still hasn't left the dcache. -Scott