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=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 7EFE5C433E0 for ; Mon, 1 Feb 2021 17:42:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D17C64E8F for ; Mon, 1 Feb 2021 17:42:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D17C64E8F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8NxvOb1Ndz3v7HfOrTyX3N+3NWcWjnkkohqr/GULaeU=; b=NoN1A4oPIMZmWPyxTp0OEeX8I Q/zTZX49efgWedoE+LmXSj2A/P0/ccefADRtHvf0VxGoONfq6+SYJrBGPoTjq3ulzagltmI1U5qJ2 iX4hGmLcc0KcxA6aYmoZyDKp+B+gjeC/zkBcMC/LarP1ft2nQ0nklnTua2BrWJlSqdtpM5QUvXT8W /mULuUx1Vvpq6aeYwr2+32T5970kmgz0hBAc6PqFN0zzek9J+E8WZIWSzzNwgJnhWgg2hB/a9mW18 YdPpGrx8XLk2bF9/boGBPc0kGMjXhZPJzJ9OLMwQSY7q0zxSg130+kgGibIkLa+sTdkb04StLsprg hqcRR8xsA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6dCy-00088K-WE; Mon, 01 Feb 2021 17:41:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6dCw-00087P-DV for linux-arm-kernel@lists.infradead.org; Mon, 01 Feb 2021 17:41:51 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F5E564E9C; Mon, 1 Feb 2021 17:41:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612201309; bh=Coy8GnAXaLr1Ite2Qp1Zmud9F/Xbq++8nLGERyWz1zs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Pya8jRrCvkpzbzb7LfN8NfCpsjbcALtAvceTk+7uAToBACDZndGBfLqO0TvnRs4QD vJt3n3sYn90rFk6cR3ObT0dGnrXLHiHnbGUWRrnA4+sssDkD83ArGPBV8XlQ8+N95j sBDnYQKZQx63cDdgE3rBsE6ck17Mgtp3krhlE6j7VO+NZcoFY1537qQZ1ZpO6OeGif HtFGRpj6wB5J0oYBEf6AGjSOoOhtkpeYK0TEJNYx9zOn4eNiMWXpD1a920S2bMogcL 2MjQN0N5j5kJ+fm20uyeCk7W8G9Sa0NgxmKTm7oc445f0HL/SgjiAKCk3gK3mo7LRe zwKfv6/SlM7XQ== Date: Mon, 1 Feb 2021 17:41:43 +0000 From: Will Deacon To: Quentin Perret Subject: Re: [RFC PATCH v2 04/26] KVM: arm64: Initialize kvm_nvhe_init_params early Message-ID: <20210201174143.GB15632@willie-the-truck> References: <20210108121524.656872-1-qperret@google.com> <20210108121524.656872-5-qperret@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210108121524.656872-5-qperret@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210201_124150_524407_A48125E0 X-CRM114-Status: GOOD ( 18.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, kernel-team@android.com, Suzuki K Poulose , android-kvm@google.com, Catalin Marinas , Fuad Tabba , linux-kernel@vger.kernel.org, Rob Herring , James Morse , linux-arm-kernel@lists.infradead.org, Marc Zyngier , David Brazdil , Frank Rowand , kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jan 08, 2021 at 12:15:02PM +0000, Quentin Perret wrote: > Move the initialization of kvm_nvhe_init_params in a dedicated function > that is run early, and only once during KVM init, rather than every time > the KVM vectors are set and reset. > > This also opens the opportunity for the hypervisor to change the init > structs during boot, hence simplifying the replacement of host-provided > page-tables and stacks by the ones the hypervisor will create for > itself. > > Signed-off-by: Quentin Perret > --- > arch/arm64/kvm/arm.c | 28 ++++++++++++++++++++-------- > 1 file changed, 20 insertions(+), 8 deletions(-) > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > index 04c44853b103..3ac0f3425833 100644 > --- a/arch/arm64/kvm/arm.c > +++ b/arch/arm64/kvm/arm.c [...] > @@ -1807,6 +1813,12 @@ static int init_hyp_mode(void) > goto out_err; > } > > + /* > + * Prepare the CPU initialization parameters > + */ > + for_each_possible_cpu(cpu) > + cpu_prepare_hyp_mode(cpu); > + This is the fifth for_each_possible_cpu() loop in this function; can any of them be merged together? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel