Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1183201pxf; Fri, 9 Apr 2021 02:02:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJF+GW3NLr2pdkMyIm5HIYlivNTLZoixkzGEQmtDXyPaVEKsmYKrvYBXzbcJbnMFSRu9f3 X-Received: by 2002:a17:906:7691:: with SMTP id o17mr15219315ejm.55.1617958949214; Fri, 09 Apr 2021 02:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617958949; cv=none; d=google.com; s=arc-20160816; b=FdXbNC0co/5+eXY5bx0rtR0K/PbbxSFQlkUI7LyGQ3YcAOYTrvgZrZorXX/a6N1Gt0 /gRMCQMSudrqm9c4dm4Tgn4gU9bYPj5c9NHMFzZbi2M/CRB0C7r7T8UiGelatb2RFLhU oAEJl3ppEoEjS2TzwUeS9AnqZaoxKhO8quxRXJbHKSXLMhts+7leftw7QA1rOMjRpzYq Pfnrcw7pFs8YQuWmRoHTBmJlHlWk3cyWQ4NJDXHxMg6g+IjHTMpb1CM8CCwcXGeBEqy5 mpgjsCi2WP7oED4zuFWDe1GKIG4y41eELiz+jniZfeCKD7ZTLq3jnY4BrcQKmYwItHG2 3QmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=jarNlk2DwPK78FCuAiIuH+QbgBiPotQIxoGPBxwctpY=; b=Udo3LH0M8uerZ40ULLZO9HRrTtehgRRs9OMWIZaflM7zuD7i97hfUOu6rur8AkpiTR laZX+7ik8SmkNK6jsoIiE8l8bqecTwLU2rDO4AZzNzyd00PHeWeoDQQe02kf4mbqNqAY 7Hdpz+KzhZaZoV31QgxtxG5V+mg87q/GG0nSZz5cLr4n1YXsGO05tpCGQ1Vz8edY+iIl 7rzK+eXkLVyxwi9DcA55jBGUOqKTTttyr/XqZNa3erFoihWrSVbBs1cyap/4SkKAwI1B KDA7TZrj3CWrHjKkCi7UXjCJw84Gig50Y9YJyxD7BN4v7Stj4Gt5L2tZofBGvIujWHvN WsoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d26si1608348ejt.459.2021.04.09.02.02.03; Fri, 09 Apr 2021 02:02:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232161AbhDIJAu (ORCPT + 99 others); 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: linux-kernel@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.