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=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 1B048C63697 for ; Thu, 26 Nov 2020 17:36:58 +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 AFCBA206F4 for ; Thu, 26 Nov 2020 17:36:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yg9EO2DC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFCBA206F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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=Lk1ddRUNcgVtcDIIHr3koZSRzl+f+AzC2UkisuZ78Zg=; b=yg9EO2DCqKo/DnSByUVmp7kOB lh5sEj0Gv2DJmwGdfTJH73PTKMHxmazL7XRS0gOuuTF6P2H/EyUgv6JOPU0sZPxspqWEJ/NNWOw8q S3uXh8B+F4TUuXuc+QM/37aQD4iSSUncf1MljYR1VzFRbDHBgBvnelnAuhUIIZMRMhrxJdblRsHjY HfZvrc4xMPS1Jvqla3m+uM9SccS8s7S8l2DOKUpQg6So46hOr2MTvtmTYffDmPE+Cvfa+GrMf6tpC eid5qgyrcXWsq6op/BjK2p/8Iqir0Cu0Tf9+k3p1z3oA8JWe1tNVMHTB9qDaF95zWlBY1jRBNQqNG ulGdVM3dQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiLBK-0000vO-NM; Thu, 26 Nov 2020 17:35:46 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiLBI-0000ue-3l for linux-arm-kernel@lists.infradead.org; Thu, 26 Nov 2020 17:35:44 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6B2F331B; Thu, 26 Nov 2020 09:35:41 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.30.234]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B5C053F23F; Thu, 26 Nov 2020 09:35:37 -0800 (PST) Date: Thu, 26 Nov 2020 17:35:34 +0000 From: Mark Rutland To: David Brazdil Subject: Re: [PATCH v3 04/23] arm64: Move MAIR_EL1_SET to asm/memory.h Message-ID: <20201126173534.GE38486@C02TD0UTHF1T.local> References: <20201126155421.14901-1-dbrazdil@google.com> <20201126155421.14901-5-dbrazdil@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201126155421.14901-5-dbrazdil@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201126_123544_285333_A1CEA46D X-CRM114-Status: GOOD ( 21.84 ) 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: Lorenzo Pieralisi , kernel-team@android.com, Jonathan Corbet , Catalin Marinas , Suzuki K Poulose , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Sudeep Holla , James Morse , linux-arm-kernel@lists.infradead.org, Marc Zyngier , Tejun Heo , Dennis Zhou , Christoph Lameter , Will Deacon , 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 Thu, Nov 26, 2020 at 03:54:02PM +0000, David Brazdil wrote: > KVM currently initializes MAIR_EL2 to the value of MAIR_EL1. In > preparation for initializing MAIR_EL2 before MAIR_EL1, move the constant > into a shared header file. Since it is used for EL1 and EL2, rename to > MAIR_ELx_SET. > > Signed-off-by: David Brazdil > --- > arch/arm64/include/asm/memory.h | 13 +++++++++++++ > arch/arm64/mm/proc.S | 15 +-------------- > 2 files changed, 14 insertions(+), 14 deletions(-) > > diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h > index cd61239bae8c..54a22cb5b17b 100644 > --- a/arch/arm64/include/asm/memory.h > +++ b/arch/arm64/include/asm/memory.h > @@ -152,6 +152,19 @@ > #define MT_S2_FWB_NORMAL 6 > #define MT_S2_FWB_DEVICE_nGnRE 1 > > +/* > + * Default MAIR_ELx. MT_NORMAL_TAGGED is initially mapped as Normal memory and > + * changed during __cpu_setup to Normal Tagged if the system supports MTE. > + */ > +#define MAIR_ELx_SET \ > + (MAIR_ATTRIDX(MAIR_ATTR_DEVICE_nGnRnE, MT_DEVICE_nGnRnE) | \ > + MAIR_ATTRIDX(MAIR_ATTR_DEVICE_nGnRE, MT_DEVICE_nGnRE) | \ > + MAIR_ATTRIDX(MAIR_ATTR_DEVICE_GRE, MT_DEVICE_GRE) | \ > + MAIR_ATTRIDX(MAIR_ATTR_NORMAL_NC, MT_NORMAL_NC) | \ > + MAIR_ATTRIDX(MAIR_ATTR_NORMAL, MT_NORMAL) | \ > + MAIR_ATTRIDX(MAIR_ATTR_NORMAL_WT, MT_NORMAL_WT) | \ > + MAIR_ATTRIDX(MAIR_ATTR_NORMAL, MT_NORMAL_TAGGED)) Patch 7 initializes MAIR_EL2 with this directly rather than copying it from MAIR_EL1, which means that MT_NORMAL_TAGGED will never be tagged within the nVHE hyp code. Is that expected? I suspect it's worth a comment here (introduced in patch 7), just to make that clear. Otherwise this looks fine to me. Thanks, Mark. > + > #ifdef CONFIG_ARM64_4K_PAGES > #define IOREMAP_MAX_ORDER (PUD_SHIFT) > #else > diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S > index 23c326a06b2d..e3b9aa372b96 100644 > --- a/arch/arm64/mm/proc.S > +++ b/arch/arm64/mm/proc.S > @@ -45,19 +45,6 @@ > #define TCR_KASAN_FLAGS 0 > #endif > > -/* > - * Default MAIR_EL1. MT_NORMAL_TAGGED is initially mapped as Normal memory and > - * changed during __cpu_setup to Normal Tagged if the system supports MTE. > - */ > -#define MAIR_EL1_SET \ > - (MAIR_ATTRIDX(MAIR_ATTR_DEVICE_nGnRnE, MT_DEVICE_nGnRnE) | \ > - MAIR_ATTRIDX(MAIR_ATTR_DEVICE_nGnRE, MT_DEVICE_nGnRE) | \ > - MAIR_ATTRIDX(MAIR_ATTR_DEVICE_GRE, MT_DEVICE_GRE) | \ > - MAIR_ATTRIDX(MAIR_ATTR_NORMAL_NC, MT_NORMAL_NC) | \ > - MAIR_ATTRIDX(MAIR_ATTR_NORMAL, MT_NORMAL) | \ > - MAIR_ATTRIDX(MAIR_ATTR_NORMAL_WT, MT_NORMAL_WT) | \ > - MAIR_ATTRIDX(MAIR_ATTR_NORMAL, MT_NORMAL_TAGGED)) > - > #ifdef CONFIG_CPU_PM > /** > * cpu_do_suspend - save CPU registers context > @@ -425,7 +412,7 @@ SYM_FUNC_START(__cpu_setup) > /* > * Memory region attributes > */ > - mov_q x5, MAIR_EL1_SET > + mov_q x5, MAIR_ELx_SET > #ifdef CONFIG_ARM64_MTE > /* > * Update MAIR_EL1, GCR_EL1 and TFSR*_EL1 if MTE is supported > -- > 2.29.2.454.gaff20da3a2-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel