Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1880730pxb; Mon, 18 Jan 2021 02:21:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwmUFfEvtOP6U7c0OKiaV/wWBN0cXE4fpG/J9pFdp07cQyzIuSPmbV7c+GEVi72aBgLHpW X-Received: by 2002:a17:906:f18c:: with SMTP id gs12mr5903899ejb.422.1610965265486; Mon, 18 Jan 2021 02:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610965265; cv=none; d=google.com; s=arc-20160816; b=XNZEl6ghM2PoUA4nsqDtIx0Cd3wUV2d+CvcuXDdfIZLGrDaDPUqbpC6kUB9UM0SKRo 1r+wYwhrMCDoAxl4R3zN/oBtEgFWQK2V8kXooKSm4skW53ySK6bJatYLKEvMu66M3KG9 JzRL4kpDk3fvODJNOt2/R4FKhEEWTm559MlppHfCgQYPJqbzNzsjvXHO/58uxh0x0ysg u0+bdtCYPwuM6GoqFsDEs1TrXQ8Vsijfn6C84UJoQaaMPWqlWBWMFnsi0X0S1hIDInsl amhoBiQ28iCfiHOzKB/or1knHurf/euPPsxp5wTW5uANdodLU1YAa90J4YMvKzeLcKFl 9BKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=EAj4Tdr+tc3h2CKSJ8PhbtdIL/AyF4sYyYKVtDTxzR8=; b=ebDwm5+nKRYsxRIio/4T0axxEv93yAPJgPh03vBkcyytjfsnFFH7hyQBcM2NjD/KEN bpO6eHluEZ6/m+OEA4sV9/LbDNFVA+GlK/zkrdBgF5GMgjypR3c5HPw0sNHiNqzkXLYk RFxY0O+kIRPRHWR55uaZJuqG93cX58x83kWx/EIdQBlVWo/3qtrKiLk8GiKIyaGjy1SK lZgmCg97yjoxzgF6pe9CiWlo9G5+/k5iwXbQRFaAFC+HRn+gECMGkFFh3v0jQ1sMqIGo YP9KxJG8J0y9q699+PQOV/0yosghLzy4TVFLz1p7ozqo7G03EDI0CH8cB4GlSF3JFfmV S8Bw== 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 bu3si2272830edb.319.2021.01.18.02.20.37; Mon, 18 Jan 2021 02:21:05 -0800 (PST) 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 S2389566AbhARKGS (ORCPT + 99 others); Mon, 18 Jan 2021 05:06:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:37002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388284AbhARJsa (ORCPT ); Mon, 18 Jan 2021 04:48:30 -0500 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 44DF3229C4; Mon, 18 Jan 2021 09:46:07 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1l1R6r-008RhD-Gq; Mon, 18 Jan 2021 09:46:05 +0000 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Mark Rutland , David Brazdil , Alexandru Elisei , Ard Biesheuvel , Jing Zhang , Ajay Patil , Prasad Sodagudi , Srinivas Ramana , James Morse , Julien Thierry , Suzuki K Poulose , kernel-team@android.com Subject: [PATCH v4 08/21] arm64: Move SCTLR_EL1 initialisation to EL-agnostic code Date: Mon, 18 Jan 2021 09:45:20 +0000 Message-Id: <20210118094533.2874082-9-maz@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210118094533.2874082-1-maz@kernel.org> References: <20210118094533.2874082-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, dbrazdil@google.com, alexandru.elisei@arm.com, ardb@kernel.org, jingzhangos@google.com, pajay@qti.qualcomm.com, psodagud@codeaurora.org, sramana@codeaurora.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, kernel-team@android.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 We can now move the initial SCTLR_EL1 setup to be used for both EL1 and EL2 setup. Signed-off-by: Marc Zyngier --- arch/arm64/kernel/head.S | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 36212c05df42..b425d2587cdb 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -479,13 +479,14 @@ EXPORT_SYMBOL(kimage_vaddr) * booted in EL1 or EL2 respectively. */ SYM_FUNC_START(init_kernel_el) + mov_q x0, INIT_SCTLR_EL1_MMU_OFF + msr sctlr_el1, x0 + mrs x0, CurrentEL cmp x0, #CurrentEL_EL2 b.eq init_el2 SYM_INNER_LABEL(init_el1, SYM_L_LOCAL) - mov_q x0, INIT_SCTLR_EL1_MMU_OFF - msr sctlr_el1, x0 isb mov_q x0, INIT_PSTATE_EL1 msr spsr_el1, x0 @@ -494,9 +495,6 @@ SYM_INNER_LABEL(init_el1, SYM_L_LOCAL) eret SYM_INNER_LABEL(init_el2, SYM_L_LOCAL) - mov_q x0, INIT_SCTLR_EL1_MMU_OFF - msr sctlr_el1, x0 - mov_q x0, HCR_HOST_NVHE_FLAGS msr hcr_el2, x0 isb -- 2.29.2