From patchwork Wed May 5 09:38:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 12239491 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.4 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,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 64FDAC433B4 for ; Wed, 5 May 2021 09:42:10 +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 15288613EC for ; Wed, 5 May 2021 09:42:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15288613EC 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=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=aEv4Umso90+NCf3jTTzLWaigjEGVKbirXT5BZTaN5YE=; b=Q450KUAZhWiwZdP7Ks5as2Ivms EfeQ/tD6YJoJydXBpZtGDUiEjZIUA0wp6wMnHceXW5tU4EEHPEqIZjSxTAY3R8LGpOCI+oaR13WH8 NrGkOdzgsDO+j98HG0mN5/t1jkVQstc1dXKS255s7k8+0nJbmfBSw5Mzy1t2ChwtkTBs1n2m08iHR 1WbdoWQmgWMNz6WhmrHR1fIBSuqaAKKN6yg5UTL42az2csI8HtEtWqCNltThgHn2VMect1Pz3hYhi H52eU0yy6vlgDuW/v2nQ69FbSbIMuPbc+qpBgFXAlDjZhLeHbbyY/drrwwrwQt0XxtWE4LP5zO3rT SKIsYU+Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1leDzl-000jya-O2; Wed, 05 May 2021 09:39:05 +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 1leDzh-000jxx-Cm for linux-arm-kernel@desiato.infradead.org; Wed, 05 May 2021 09:39:02 +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=qR65fFK/8BSbD1ECiv8hVrblh9U0OSUUWssbpsy823E=; b=1TlJfHRGVQUBHtKDM4CPLOlO+y Oq/yulZJn4XCBKDp27jKFWormCdfxUzcSgi2M1kAQR6Ciq/sAvpG4LgIrusoAL9lI0N1X0iZj10yF iUmKcTaaUY3U8vHNzs5WnZrCevQWS95Gdft/amy1cgQBqPH3YJ6Tyw18I7PF78XgM+Er9eBhGzZee XvWw5r5PS9a1R7IrDcvoe1vjq1wFVeSfkIqUcK09NC3Ck1xQy1bVJpzVi36DvV6ueIzQ2m7gtdgwB cdo8J4CId9CQ8OEscj9w5VYjc7pZheG8F+uGVIrKHAV7yBnPRIFz73WoC0EZmHfCbfsGPsdzGk6kd mUidyKqw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leDze-004cPf-Hk for linux-arm-kernel@lists.infradead.org; Wed, 05 May 2021 09:39:00 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 432E6613D6; Wed, 5 May 2021 09:38:57 +0000 (UTC) From: Catalin Marinas To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Subject: [aarch64 boot-wrapper][PATCH] aarch64: Enable access to allocation tags if MTE is present Date: Wed, 5 May 2021 10:38:55 +0100 Message-Id: <20210505093855.8416-1-catalin.marinas@arm.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210505_023858_637958_78BFA2A7 X-CRM114-Status: UNSURE ( 7.18 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org SCR_EL3.ATA must be set so that software can access the allocation (in-memory) MTE tags. Signed-off-by: Catalin Marinas --- arch/aarch64/boot.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S index fd7133d1725c..a9264de937be 100644 --- a/arch/aarch64/boot.S +++ b/arch/aarch64/boot.S @@ -61,6 +61,14 @@ _start: cbz x1, 1f orr x0, x0, #(1 << 27) // FGT enable +1: + /* Enable MTE if present */ + mrs x10, id_aa64pfr1_el1 + ubfx x10, x10, #8, #4 + cmp x10, #2 + b.lt 1f + + orr x0, x0, #(1 << 26) // ATA enable 1: #ifndef KERNEL_32 orr x0, x0, #(1 << 10) // 64-bit EL2