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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 34C0DC433EF for ; Thu, 13 Jan 2022 09:42:30 +0000 (UTC) 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: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:In-Reply-To:References: List-Owner; bh=p2zf7PkikTTqQ+YYu9Meo1hxOGNTQGk990DdyuWM3gc=; b=yJnu9c8cJ/h/yT dByM7EzYyVifRTybviUbFjw33eOt0wCQbupgJBoVrMHR1MqeNCExQ0ro+iY6yXHpbTjEsgLQo0Oem IMSsV8pizguV7/aMMcIQCYP1ZDVSMp5DryIv4RYIw8y8m66Kng2cuZcWuQZwNDFLTdvMKKH3Js8EQ 3Nfzjd3YWxZovEFQlAtisbtkNobrv2PjdaI6wjo7nPpt5y9b2BQ+rV7YIvCe8k1LX9Ygu3vJ3WAOx 3QD9F1Ckos3vnpCxWIE9LunsmwLcou/RgJ3Cq8dNmw7o051jmxUcFzCkrY0TKT0xDRrjT/ukdZ8qk YfHPJjMobpvOaip9Nnzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7wbj-005I6g-MM; Thu, 13 Jan 2022 09:41:23 +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 1n7wbg-005I6B-Us for linux-arm-kernel@lists.infradead.org; Thu, 13 Jan 2022 09:41:22 +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 D54B66D; Thu, 13 Jan 2022 01:41:17 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.73.79]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 27A723F766; Thu, 13 Jan 2022 01:41:15 -0800 (PST) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Cc: mark.rutland@arm.com, andre.przywara@arm.com, robin.murphy@arm.com, Anshuman Khandual Subject: [bootwrapper PATCH] aarch64: Enable BRBE for the non-secure world Date: Thu, 13 Jan 2022 15:11:08 +0530 Message-Id: <1642066868-23151-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220113_014121_079336_E3F88C7D X-CRM114-Status: UNSURE ( 6.41 ) 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 MDCR_EL3.SBRBE resets to an UNKNOWN value. Configure it to allow the BRBE buffer usage and direct register access in the non-secure world. But just before that, check AA64DFR0_EL1.BRBE and make sure BRBE is implemented. We still continue to reset MDCR_EL3 register to zero with the exception of MDCR_EL3.NSPB, MDCR_EL3.NSTB and MDCR_EL3.SBRBE. Signed-off-by: Anshuman Khandual --- arch/aarch64/boot.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S index bfbb6ec..ca1b292 100644 --- a/arch/aarch64/boot.S +++ b/arch/aarch64/boot.S @@ -103,6 +103,14 @@ ASM_FUNC(_start) ldr x1, =(0x3 << 24) orr x0, x0, x1 +1: mrs x1, id_aa64dfr0_el1 + ubfx x1, x1, #52, #4 + cbz x1, 1f + + // Enable BRBE for the non-secure world. + ldr x1, =(0x3 << 32) + orr x0, x0, x1 + 1: msr mdcr_el3, x0 // Disable traps to EL3 mrs x0, id_aa64pfr0_el1 -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel