From patchwork Mon May 3 12:09:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 12236007 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 567AEC433ED for ; Mon, 3 May 2021 12:15:02 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 E730E61186 for ; Mon, 3 May 2021 12:15:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E730E61186 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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=desiato.20200630; 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=lQBkERtfa8PJIS0KzQrLzjRGzHT69ocZrWj6q0SyLgk=; b=c2ZezfsP0WlKTGuvKiNt5LMvip 64F7zYFfUlpNKJe7f9sZPe/sLyNXntCDVlMqNoMhiifCeoBZj3kvVteOk8dxai5GKewVJk/CnfPco IdzWc6ooQnrqqDDSdFftVm95NcDBVW8mi8QABXO2g5CenMtNjRJaRHndPJF3Q1+PLsucdEbcl4PgB uzw8IX1bsRY8G7+5tON63hzXekHYo73kA3ifLMRpJSF9TaaWJpbthEJWEw+KCwBDThNKSJFsQHTJN cMlH5FJVRxq3wfKDRhAv69TDvDxd52reHUl2EzwWM8aNGDRDp2f8AxvjSjoa4EjAsp+dlmpAa5F/z bhOT2kkg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ldXPN-00DpY8-J0; Mon, 03 May 2021 12:10:41 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ldXOG-00DpQG-MT for linux-arm-kernel@desiato.infradead.org; Mon, 03 May 2021 12:09:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=Pdt9vNivocHmdl08hhRyLi8z5R/dZdpK/kIoDGYu3d8=; b=vMuFoCFdGXUaWdBifNyiEX8vgy jkWaV8JYg8LrtxHwExeJYtz7Sf502Xoe5gt6kqz2PAEAA0KgksH+/xKgbitiWwGS3u5EEHZp+sfW3 LWQ5MDMHnnhYeEy8mpJ+naOjZvm99kLWr/o2TRVhssW+15yQeVpX9OUxL/LY7RixmSUInWYyJN2vB qRZ/Q1nH/5Ff4mOlhE9FZV23c4DgI4nL4dSGnbl9LJviHmmGtJvm6F+bFoOwziu+NykSG8pSjeWeY o9WTiddmwH0O5l01twdFPNQcLK7SXWQP+1hbsOSeVm0p056J5CKI1GuWE0zR1U+tAZV3WwZeuTd2t rc1Rs+Nw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ldXOE-0032ff-7n for linux-arm-kernel@lists.infradead.org; Mon, 03 May 2021 12:09:31 +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 A10186052B; Mon, 3 May 2021 12:09:29 +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 1ldXOB-00AYFF-Fo; Mon, 03 May 2021 13:09:27 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Cc: Mark Rutland , broonie@kernel.org, kernel-team@android.com Subject: [AArch64 boot-wrapper][PATCH] aarch64: Enable FGT for EL2 Date: Mon, 3 May 2021 13:09:20 +0100 Message-Id: <20210503120920.1819233-1-maz@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, broonie@kernel.org, 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210503_050930_332390_504A3CAA X-CRM114-Status: GOOD ( 10.34 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We have no intention of handling FGT traps to EL3, so let EL2 play with the feature directly. Signed-off-by: Marc Zyngier Reviewed-by: Andre Przywara Tested-by: Sudeep Holla --- Notes: Needed to boot Linux 5.13 at EL2. arch/aarch64/boot.S | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S index e47cf59..fd7133d 100644 --- a/arch/aarch64/boot.S +++ b/arch/aarch64/boot.S @@ -54,6 +54,13 @@ _start: cbz x1, 1f orr x0, x0, #(1 << 34) // TME enable +1: + /* Enable FGT if present */ + mrs x1, id_aa64mmfr0_el1 + ubfx x1, x1, #56, #4 + cbz x1, 1f + + orr x0, x0, #(1 << 27) // FGT enable 1: #ifndef KERNEL_32 orr x0, x0, #(1 << 10) // 64-bit EL2