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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 4119BC4338F for ; Wed, 11 Aug 2021 09:38:51 +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 084EF60F55 for ; Wed, 11 Aug 2021 09:38:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 084EF60F55 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=CJZlMb3y7I8jUbTq1nKuZO5lZpRkjrnmtUrODoJPaI8=; b=Xvvt7w4t+Ll2YD ykSDMwNnN9T41j5Y/tjuTzKMfZ4zDqJh4OD8lehRg899zPU4ZLh7wrG0H6qqB1vTY4pa27xdtGjZy izpTybyT0g/IPruZ4H/2b/ZU6Z5OVfZk9bttycqQAThKny3OBhBaGPFxxlr7qlzM+SL5WhhDZU3yO gHbagl39Ouu68uq6BXMuxjIgRWDFLH2uSiN1JRze57kxtbpgCeQqlhkeu84VS6YKqHrfW//rSM238 7MuNOrZ8u7FvAn4JYfaFijwwV7KTJKkhZHHclPcNJoaTGYv+cKjd//8G70qgELN5/NcywccjxACvX bsrIiLV5CqHQYX4U5blA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDked-006LEN-7I; Wed, 11 Aug 2021 09:36:07 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDkRo-006Gou-R7 for linux-arm-kernel@lists.infradead.org; Wed, 11 Aug 2021 09:22:54 +0000 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 5AB0860F55; Wed, 11 Aug 2021 09:22:52 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mDkRm-004HL7-7Q; Wed, 11 Aug 2021 10:22:50 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Cc: Mark Rutland , Oliver Upton Subject: [PATCH][boot-wrapper] aarch64: Enable ECV to allow access to CNTPOFF_EL2 Date: Wed, 11 Aug 2021 10:22:26 +0100 Message-Id: <20210811092226.2316583-1-maz@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, oupton@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210811_022252_924966_9927DE39 X-CRM114-Status: GOOD ( 11.65 ) 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: , 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 the implemnentation supports ID_AA64MMFR0_EL1.ECV==2, set SCR_EL3.ECVEn to allow EL2 access to CNTPOFF_EL2. Signed-off-by: Marc Zyngier --- arch/aarch64/boot.S | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S index 7f208b5..f0aa3cb 100644 --- a/arch/aarch64/boot.S +++ b/arch/aarch64/boot.S @@ -54,10 +54,17 @@ ASM_FUNC(_start) 1: /* Enable FGT if present */ mrs x1, id_aa64mmfr0_el1 - ubfx x1, x1, #56, #4 - cbz x1, 1f + ubfx x2, x1, #56, #4 + cbz x2, 1f orr x0, x0, #(1 << 27) // FGT enable +1: + /* Enable ECV2 if present (allows CNTPOFF_EL2) */ + ubfx x2, x1, #60, #4 + cmp x2, #2 + bne 1f + + orr x0, x0, #(1 << 28) // ECV enable 1: /* Enable MTE if present */ mrs x10, id_aa64pfr1_el1 -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel