Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5086957pxv; Wed, 28 Jul 2021 02:46:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKcxoMa335Uq45K9r/11e2mDHGjlZV5LTOakAbvF3zFA4LwFDir5dW+EUvha/nFADCH9YR X-Received: by 2002:a5e:9743:: with SMTP id h3mr12406758ioq.52.1627465577294; Wed, 28 Jul 2021 02:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627465577; cv=none; d=google.com; s=arc-20160816; b=ab1iun3Nm5NBMcKPwRB26YSkpW79qNbmxgb9rIZxFhmu8pbPdOp7obHsmaq0s8HMWh X3mQxP1uxCBnVnqVUX3Qh9X1BKEoZQuo1lsqAjl5o7qaEjklMqgM0/P6BUAsLXoSp3Zy 20gnBr+3iIrBeCeOZ1+ZZtj9TYVIlVpXYQSJNuFFHAWsyDFFkh+RGN4638rJMtP8CSkl wtqju+yvDJaBZuP3mVFSGYefTwdhQHnuA8lZq44knstaG/KVRFbTf0asr0To319m7M5z UqgwocSLGBn96NTGkLXGcz2lE54UgFZajLzxr3M7in6GA0Jl0RZbZTciYxasrGUR3+SE E2Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=4kC1Dx2pNR1Obk+PiZnd7JuVWndpb/MNhZdKlXYCUn4=; b=DnaifnWI8T6FOZO3L9xPl9fyZKbeXWKIbas+0QtJ5o33XdVULm4kA+ZezJkDhUoRpV AjT1VTPrKtuT/fcZfzyWik7usuBjbUzjr9wLgNfHt9AgWjzMcTE+dcEwLsi2lxi0sJan 0/n/KbjXno/t2fxmJMS4Jg3pPPaBcCw2PHgCrOewgR4jqPiI+ez/juvzCE4pTO/e6qYW CkCE893oO+vD2wWQU5/FM33UuttGS6yJhAFlQbewLheqpK+3n9tmQw4bE+uIGRdLTd6T bZegRhkbp2BLsLPqvVkW72fyVVnGE0l0ehy3O3814DKxC+pGjaGrFApbmxhP/yVdGKVY DcZg== 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 s16si6291902jan.83.2021.07.28.02.46.06; Wed, 28 Jul 2021 02:46:17 -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 S235644AbhG1JpG (ORCPT + 99 others); Wed, 28 Jul 2021 05:45:06 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:54428 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231743AbhG1JpE (ORCPT ); Wed, 28 Jul 2021 05:45:04 -0400 X-UUID: 978d33e1012a4013bdb52d88f7ed94dd-20210728 X-UUID: 978d33e1012a4013bdb52d88f7ed94dd-20210728 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 275052168; Wed, 28 Jul 2021 17:45:01 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 28 Jul 2021 17:44:59 +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; Wed, 28 Jul 2021 17:44:59 +0800 From: To: CC: , , , Yee Lee , Matthias Brugger , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" Subject: [PATCH 0/1] arm64/cpufeature: Add an option for mte support Date: Wed, 28 Jul 2021 17:42:57 +0800 Message-ID: <20210728094302.9949-1-yee.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 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 Arm64 introduced mte to enforce memory protection but also increased the system requirements, such as the additional tag memory and the firmware control complexity. For the case of products with limited resouce or low-power environment, the requirements to support mte is unlikely reached. Hence, a solution for low-end devices is necessary. This patch Add an option for mte support. An parameter from system is used to indicate its states for all requirements. If not, mte is disabled both in kernel and userspace. === Test === QEMU5.2 + mte passed cmdline : "arm64_mte_not_support" boot log: ...(skip) [ 0.000000] CPU features: detected: Memory Tagging Extension [ 0.000000] CPU features: detected: Spectre-v2 [ 0.000000] CPU features: detected: Spectre-v4 [ 0.000000] CPU features: kernel page table isolation forced ON by KASLR [ 0.000000] CPU features: detected: Kernel page table isolation (KPTI) [ 0.000000] CPU features: MTE is disabled since system does not support. Yee Lee (1): arm64/cpufeature: Add option to disable mte support arch/arm64/include/asm/cpufeature.h | 4 +++- arch/arm64/kernel/cpufeature.c | 13 +++++++++++++ arch/arm64/kernel/image-vars.h | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) -- 2.18.0