From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: Re: [PATCH 4/4] arm/arm64: KVM: use kernel mapping to perform invalidation on page fault Date: Thu, 08 Jan 2015 15:06:55 +0000 Message-ID: <54AE9D0F.3060002@arm.com> References: <1420718349-24152-1-git-send-email-marc.zyngier@arm.com> <1420718349-24152-5-git-send-email-marc.zyngier@arm.com> <54AE811F.4020104@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Christoffer Dall , kvm-devel , "kvmarm@lists.cs.columbia.edu" To: Peter Maydell Return-path: Received: from foss-mx-na.foss.arm.com ([217.140.108.86]:57899 "EHLO foss-mx-na.foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756093AbbAHPHD (ORCPT ); Thu, 8 Jan 2015 10:07:03 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 08/01/15 13:16, Peter Maydell wrote: > On 8 January 2015 at 13:07, Marc Zyngier wrote: >>> Can you remind me why it's OK not to flush the icache for an >>> ASID tagged VIVT icache? Making this page coherent might actually >>> be revealing a change in the instructions associated with the VA, >>> mightn't it? >> >> ASID cached VIVT icaches are also VMID tagged. It is thus impossible for >> stale cache lines to come with a new page. And if by synchronizing the >> caches you obtain a different instruction stream, it means you've >> restored the wrong page. > > ...is that true even if the dirty data in the dcache comes from > the userspace process doing DMA or writing the initial boot > image or whatever? We perform this on a page that is being brought in stage-2. Two cases: - This is a page is mapped for the first time: the icache should be invalid for this page (the guest should have invalidated it the first place), - This is a page that we bring back from swap: the page must match the one that has been swapped out. If it has been DMA'ed in in the meantime, then the guest surely has flushed its icache if it intends to branch to it, hasn't it? I have the feeling I'm missing something from your question... M. -- Jazz is not dead. It just smells funny...