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=-17.5 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, USER_AGENT_GIT 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 2DF83C4338F for ; Tue, 24 Aug 2021 13:52:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 F199561245 for ; Tue, 24 Aug 2021 13:52:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F199561245 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=twJry4zPN4oIrh1awMHm6+Z7bXpy8OL/fZbO6DB0IkI=; b=HmeH9heDy4KErY mI742KALNYZ1LgNN5DtVEvjt+fOWxs/5eJ5twXuX7e5yQSOoWYJqAhFKPP60atNIB++ytqlt5/eiU fajB6IuIKuaBk3M5s0dVozJ0kzpJoTCUj28iGz+dt2Rx/aql7E3tKF/AmwuzVhTfHRz0o2oQKqVh0 9HuKN2QxYwCFc0RjMH0n/BMaEJZ9Z83plVoCBCycsId1Rl0E3IhEd8tQ1aGpB0+T0VSoVK6IWXnaB 00apZF+L1GE9avfXMRmHrB/H8ufwTJz8p12Ge3I4CHz3Qxj5MWg/JvQ/drHRsidpIbJ170AzhRRrm UwJXvS4UbZCTNMqPN5hw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIWoP-003Io1-HC; Tue, 24 Aug 2021 13:49:57 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIWns-003IfE-UR for linux-arm-kernel@lists.infradead.org; Tue, 24 Aug 2021 13:49:26 +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 3BD421042; Tue, 24 Aug 2021 06:49:22 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 68E483F766; Tue, 24 Aug 2021 06:49:21 -0700 (PDT) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: alexandru.elisei@arm.com, andre.przywara@arm.com, mark.rutland@arm.com, maz@kernel.org Subject: [boot-wrapper PATCH 2/5] aarch32: simplify _switch_monitor Date: Tue, 24 Aug 2021 14:48:57 +0100 Message-Id: <20210824134900.34849-3-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210824134900.34849-1-mark.rutland@arm.com> References: <20210824134900.34849-1-mark.rutland@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210824_064925_094239_47F48A65 X-CRM114-Status: UNSURE ( 7.76 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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 If we're lucky enough to have been booted into secure PL1, we can switch to monitor mode with an exception return rather than an SMC call, which avoids the need for boot-time vectors. Note that while all Secure PL1 register state is accessible in Secure SVC mode, we must switch to Monitor mode before we set SCR.NS=1. Signed-off-by: Mark Rutland --- arch/aarch32/boot.S | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/arch/aarch32/boot.S b/arch/aarch32/boot.S index 82927de..e397cb0 100644 --- a/arch/aarch32/boot.S +++ b/arch/aarch32/boot.S @@ -37,9 +37,10 @@ ASM_FUNC(_start) b start_no_el3 _switch_monitor: - ldr r0, =boot_vectors - bl setup_vector - smc #0 + adr lr, _monitor + ldr r0, =(PSR_A | PSR_I | PSR_F | PSR_MON) + msr spsr, r0 + movs pc, lr _monitor: /* Move the stack to Monitor mode*/ @@ -102,18 +103,6 @@ ASM_FUNC(jump_kernel) msr spsr_cxf, r4 movs pc, lr - .section .vectors - .align 6 -boot_vectors: - b . - b . - b _monitor - b . - b . - b . - b . - b . - .section .data .align 2 flag_no_el3: -- 2.11.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel