Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp7007777pxv; Fri, 30 Jul 2021 07:55:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx3Izk9e02w0LeYK9FN+xSmHIKvovnlKDCkoI8rHoQ+US3aDm6xmqAPAJGxSSmmeCCOD3s X-Received: by 2002:a05:6402:31a4:: with SMTP id dj4mr3425451edb.350.1627656900095; Fri, 30 Jul 2021 07:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627656900; cv=none; d=google.com; s=arc-20160816; b=yvnveM7ocDEMn+iwiiUmU/ysUtuiADsBzKqSKn7upeo06xT1X7Q8siNpD1jVXmIg17 Ml9uxg4Cf3LWbxEjgWWVrjfcST0zf5uMlSqQ1I+lggQJF8a3uaVkNZUj+W2GK7ZbxLVZ bntyNYduX+dPHhmkDM2hT3WnZmKmKMckxHeZByzaZzFo4AuBbqCHpkKXxzJeeFJbd0+1 sna5rWA4XFPF0Rp1Nqclk7Ir4lIx0hAxeI1SZfhqmyAHKsBVTLOmFUVnLV/K3hHX67IF N+NWJoTZDNK7j4F/7iUmjeEwM4fPk8EFwBp+UTUv6egaBOVxyEO5nInlm+4f8HKB3tz2 aKiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ummilxoh0ZQLxnqV8kKXeD6I/61ogm6RuCV1bCxYeMY=; b=PnJpze2nUjO8ml3v9hSktHjsyeEC0tpyHXh1fmS1eT6NoLRytds0i7RiAqa76EtSCD mceMWBndUhiBBHSBEPz6CSTGJUYTyrEEsJK9NQ1cqDAxOCenJ6pofXHgsJ/Zoj6FDgSz NBVW5oPG6u/jH6rTNgrL3oaxA0VrOANz8oTLCJyV3eoGoD09jAsNwepXvlvlzSdYMozc 5DIUCNmiqlochVFYTaJf9WRyAOvADYD5+AuBmpjhSbX2l3fHijAHtVmMilI3rTja0lok LFa+NUdgG+V2ZfPhkV4eIhpJq+bDOdwawBbiS5hzn1RTL/uWtbgU2czKBORSXcu/xaQD NZ/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m16si2005484edc.309.2021.07.30.07.54.37; Fri, 30 Jul 2021 07:55:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239405AbhG3Ouk (ORCPT + 99 others); Fri, 30 Jul 2021 10:50:40 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:33608 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S239325AbhG3OuT (ORCPT ); Fri, 30 Jul 2021 10:50:19 -0400 X-UUID: e15cf568580b4d4ab5b02adcc5708293-20210730 X-UUID: e15cf568580b4d4ab5b02adcc5708293-20210730 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1688251014; Fri, 30 Jul 2021 22:50:12 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 30 Jul 2021 22:50:10 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 30 Jul 2021 22:50:10 +0800 From: To: CC: , , , Yee Lee , Jonathan Corbet , Catalin Marinas , Will Deacon , Matthias Brugger , "Paul E. McKenney" , Randy Dunlap , Andrew Morton , Thomas Gleixner , "Maciej W. Rozycki" , Viresh Kumar , Peter Zijlstra , Vlastimil Babka , Marc Zyngier , David Brazdil , Ard Biesheuvel , Fuad Tabba , "open list:DOCUMENTATION" , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , "moderated list:ARM/Mediatek SoC support" Subject: [PATCH v3 1/1] arm64/cpufeature: Optionally disable MTE via command-line Date: Fri, 30 Jul 2021 22:49:53 +0800 Message-ID: <20210730144957.30938-2-yee.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210730144957.30938-1-yee.lee@mediatek.com> References: <20210730144957.30938-1-yee.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yee Lee For some low-end devices with limited resources, MTE needs to be optionally disabled to save system costs such as tag memory and firmware controls. This allows ID_AA64PFR1_EL1.MTE to be overridden on its shadow value by giving "arm64.nomte" on cmdline, and to suppress MTE feature. Suggested-by: Marc Zyngier Suggested-by: Suzuki K Poulose Signed-off-by: Yee Lee --- Documentation/admin-guide/kernel-parameters.txt | 3 +++ arch/arm64/kernel/idreg-override.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index bdb22006f713..6f257e39d89e 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -380,6 +380,9 @@ arm64.nopauth [ARM64] Unconditionally disable Pointer Authentication support + arm64.nomte [ARM64] Unconditionally disable Memory Tagging Extension + support + ataflop= [HW,M68k] atarimouse= [HW,MOUSE] Atari Mouse diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c index 53a381a7f65d..d8e606fe3c21 100644 --- a/arch/arm64/kernel/idreg-override.c +++ b/arch/arm64/kernel/idreg-override.c @@ -54,6 +54,7 @@ static const struct ftr_set_desc pfr1 __initconst = { .override = &id_aa64pfr1_override, .fields = { { "bt", ID_AA64PFR1_BT_SHIFT }, + { "mte", ID_AA64PFR1_MTE_SHIFT}, {} }, }; @@ -100,6 +101,7 @@ static const struct { { "arm64.nopauth", "id_aa64isar1.gpi=0 id_aa64isar1.gpa=0 " "id_aa64isar1.api=0 id_aa64isar1.apa=0" }, + { "arm64.nomte", "id_aa64pfr1.mte=0" }, { "nokaslr", "kaslr.disabled=1" }, }; -- 2.18.0