From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: Re: [PATCH 4/4] arm/arm64: KVM: use kernel mapping to perform invalidation on page fault Date: Fri, 9 Jan 2015 13:51:13 +0100 Message-ID: <20150109125113.GT21092@cbox> References: <1420718349-24152-1-git-send-email-marc.zyngier@arm.com> <1420718349-24152-5-git-send-email-marc.zyngier@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Steve Capper To: Marc Zyngier Return-path: Received: from mail-la0-f50.google.com ([209.85.215.50]:36769 "EHLO mail-la0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754924AbbAIMur (ORCPT ); Fri, 9 Jan 2015 07:50:47 -0500 Received: by mail-la0-f50.google.com with SMTP id pn19so14637710lab.9 for ; Fri, 09 Jan 2015 04:50:46 -0800 (PST) Content-Disposition: inline In-Reply-To: <1420718349-24152-5-git-send-email-marc.zyngier@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jan 08, 2015 at 11:59:09AM +0000, Marc Zyngier wrote: > When handling a fault in stage-2, we need to resync I$ and D$, just > to be sure we don't leave any old cache line behind. > > That's very good, except that we do so using the *user* address. > Under heavy load (swapping like crazy), we may end up in a situation > where the page gets mapped in stage-2 while being unmapped from > userspace by another CPU. > > At that point, the DC/IC instructions can generate a fault, which > we handle with kvm->mmu_lock held. The box quickly deadlocks, user > is unhappy. > > Instead, perform this invalidation through the kernel mapping, > which is guaranteed to be present. The box is much happier, and so > am I. > > Signed-off-by: Marc Zyngier This looks good to me! Thanks, -Christoffer