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.3 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 75E93C433E0 for ; Thu, 11 Feb 2021 11:28:37 +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 0A76864DF5 for ; Thu, 11 Feb 2021 11:28:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A76864DF5 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:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject: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=OzFIScRFarshnehNQFm5zGCamkUlgILJeQcJ1uzhnh8=; b=UA2Crb3Hub02V2AohFREnREsET gD/EYvl2+Lk2lm7vMqrurPuS402QyIQrqVegYc2QjqPpf+kUzNgzgX1+Rmc4YdMsZGbvXaaK/urQU 98vQrsRphqS47MAU0oHgYb8dWVDDen3+ck+OFkVnBNGkl7F3fS6MeKv8VVtRjeY0qpFtre3SmA7jx WU0TnTp0k2k0EbLyazzgm8U8rtc7MnRUfYBdBtMKhaKayk8+dMgQ5dcQe1NJphn5l7sg+ISPXLEQl 3avQmHoodTCWkDvymCbhNglw8Fpn4/LjHi6grpGQPeaiUYOXyacem02f62iM2OrppZ4sQUppmQSVe zyHog00w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAA7Z-0006Wh-5Q; Thu, 11 Feb 2021 11:26:53 +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 1lAA7W-0006WF-15 for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2021 11:26:50 +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 D709E31B; Thu, 11 Feb 2021 03:26:48 -0800 (PST) Received: from p8cg001049571a15.blr.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 486273F73B; Thu, 11 Feb 2021 03:26:45 -0800 (PST) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Subject: [boot-wrapper] [PATCH] aarch64: Enable TRBE for the non-secure world Date: Thu, 11 Feb 2021 16:56:37 +0530 Message-Id: <1613042797-13109-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-20210211_062650_141584_F6E873C1 X-CRM114-Status: GOOD ( 10.45 ) 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@arm.com, Andre.Przywara@arm.com, Anshuman Khandual , james.morse@arm.com, Suzuki.Poulose@arm.com 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.NSTB resets to an UNKNOWN value. Configure it to allow the trace buffer to use non-secure memory and to permit direct register accesses from the non-secure world. Before that, just check AA64DFR0_EL1.TraceBuffer and make sure TRBE is implemented. We still continue to reset MDCR_EL3 register to zero with the exception of MDCR_EL3.NSPB and MDCR_EL3.NSTB. 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 37f4b98..e47cf59 100644 --- a/arch/aarch64/boot.S +++ b/arch/aarch64/boot.S @@ -71,6 +71,14 @@ _start: ldr x1, =(0x3 << 12) orr x0, x0, x1 +1: mrs x1, id_aa64dfr0_el1 + ubfx x1, x1, #44, #4 + cbz x1, 1f + + // Enable TRBE for the non-secure world. + ldr x1, =(0x3 << 24) + 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