From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D564C433B4 for ; Fri, 9 Apr 2021 09:00:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9117611B0 for ; Fri, 9 Apr 2021 09:00:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232197AbhDIJAu (ORCPT ); Fri, 9 Apr 2021 05:00:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:59640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230181AbhDIJAt (ORCPT ); Fri, 9 Apr 2021 05:00:49 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 974C8611AB; Fri, 9 Apr 2021 09:00:36 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lUn0E-006UdP-Jz; Fri, 09 Apr 2021 10:00:34 +0100 Date: Fri, 09 Apr 2021 10:00:33 +0100 Message-ID: <87lf9romry.wl-maz@kernel.org> From: Marc Zyngier To: Quentin Perret Cc: Yanan Wang , Will Deacon , Alexandru Elisei , Catalin Marinas , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, James Morse , Julien Thierry , Suzuki K Poulose , Gavin Shan , wanghaibin.wang@huawei.com, zhukeqian1@huawei.com, yuzenghui@huawei.com Subject: Re: [PATCH v4 1/2] KVM: arm64: Move CMOs from user_mem_abort to the fault handlers In-Reply-To: References: <20210409033652.28316-1-wangyanan55@huawei.com> <20210409033652.28316-2-wangyanan55@huawei.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: qperret@google.com, wangyanan55@huawei.com, will@kernel.org, alexandru.elisei@arm.com, catalin.marinas@arm.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, gshan@redhat.com, wanghaibin.wang@huawei.com, zhukeqian1@huawei.com, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, 09 Apr 2021 09:08:11 +0100, Quentin Perret wrote: > > Hi Yanan, > > On Friday 09 Apr 2021 at 11:36:51 (+0800), Yanan Wang wrote: > > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c > > +static void stage2_invalidate_icache(void *addr, u64 size) > > +{ > > + if (icache_is_aliasing()) { > > + /* Flush any kind of VIPT icache */ > > + __flush_icache_all(); > > + } else if (is_kernel_in_hyp_mode() || !icache_is_vpipt()) { > > + /* PIPT or VPIPT at EL2 */ > > + invalidate_icache_range((unsigned long)addr, > > + (unsigned long)addr + size); > > + } > > +} > > + > > I would recommend to try and rebase this patch on kvmarm/next because > we've made a few changes in pgtable.c recently. It is now linked into > the EL2 NVHE code which means there are constraints on what can be used > from there -- you'll need a bit of extra work to make some of these > functions available to EL2. That's an interesting point. I wonder whether we are missing something on the i-side for VPITP + host stage-2 due to switching HCR_EL2.VM. We haven't changed the VMID (still 0), but I can't bring myself to be sure it doesn't affect the icache in this case... M. -- Without deviation from the norm, progress is not possible.