mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yeoreum Yun <yeoreum.yun@arm.com>
To: catalin.marinas@arm.com, pcc@google.com, will@kernel.org,
	broonie@kernel.org, anshuman.khandual@arm.com,
	joey.gouly@arm.com, maz@kernel.org, oliver.upton@linux.dev,
	frederic@kernel.org, hardevsinh.palaniya@siliconsignals.io,
	samuel.holland@sifive.com, palmer@rivosinc.com,
	charlie@rivosinc.com, thiago.bauermann@linaro.org,
	bgray@linux.ibm.com, tglx@linutronix.de, puranjay@kernel.org,
	david@redhat.com, yang@os.amperecomputing.com, mbenes@suse.cz,
	joel.granados@kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Yeoreum Yun <yeoreum.yun@arm.com>
Subject: [PATCH v7 1/8] arm64/cpufeature: add MTE_STORE_ONLY feature
Date: Wed, 18 Jun 2025 10:29:50 +0100	[thread overview]
Message-ID: <20250618092957.2069907-2-yeoreum.yun@arm.com> (raw)
In-Reply-To: <20250618092957.2069907-1-yeoreum.yun@arm.com>

Since ARMv8.9, FEAT_MTE_STORE_ONLY can be used to restrict raise of tag
check fault on store operation only.

add MTE_STORE_ONLY feature.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
---
 arch/arm64/kernel/cpufeature.c | 8 ++++++++
 arch/arm64/tools/cpucaps       | 1 +
 2 files changed, 9 insertions(+)

diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 8a5284c733b7..fdc48aa1f0e2 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -321,6 +321,7 @@ static const struct arm64_ftr_bits ftr_id_aa64pfr1[] = {
 static const struct arm64_ftr_bits ftr_id_aa64pfr2[] = {
 	ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR2_EL1_FPMR_SHIFT, 4, 0),
 	ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR2_EL1_MTEFAR_SHIFT, 4, ID_AA64PFR2_EL1_MTEFAR_NI),
+	ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR2_EL1_MTESTOREONLY_SHIFT, 4, ID_AA64PFR2_EL1_MTESTOREONLY_NI),
 	ARM64_FTR_END,
 };
 
@@ -2882,6 +2883,13 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
 		.matches = has_cpuid_feature,
 		ARM64_CPUID_FIELDS(ID_AA64PFR2_EL1, MTEFAR, IMP)
 	},
+	{
+		.desc = "Store Only MTE Tag Check",
+		.capability = ARM64_MTE_STORE_ONLY,
+		.type = ARM64_CPUCAP_SYSTEM_FEATURE,
+		.matches = has_cpuid_feature,
+		ARM64_CPUID_FIELDS(ID_AA64PFR2_EL1, MTESTOREONLY, IMP)
+	},
 #endif /* CONFIG_ARM64_MTE */
 	{
 		.desc = "RCpc load-acquire (LDAPR)",
diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps
index fe8f4f8ce95c..b96cb6d6bcaa 100644
--- a/arch/arm64/tools/cpucaps
+++ b/arch/arm64/tools/cpucaps
@@ -69,6 +69,7 @@ MPAM_HCR
 MTE
 MTE_ASYMM
 MTE_FAR
+MTE_STORE_ONLY
 SME
 SME_FA64
 SME2
-- 
LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}


  reply	other threads:[~2025-06-18  9:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18  9:29 [PATCH v7 0/8] support FEAT_MTE_STORE_ONLY feature Yeoreum Yun
2025-06-18  9:29 ` Yeoreum Yun [this message]
2025-06-18  9:29 ` [PATCH v7 2/8] prctl: introduce PR_MTE_STORE_ONLY Yeoreum Yun
2025-06-18  9:29 ` [PATCH v7 3/8] arm64/kernel: support store-only mte tag check Yeoreum Yun
2025-06-18  9:29 ` [PATCH v7 4/8] arm64/hwcaps: add MTE_STORE_ONLY hwcaps Yeoreum Yun
2025-06-18  9:29 ` [PATCH v7 5/8] arm64/kvm: expose MTE_STORE_ONLY feature to guest Yeoreum Yun
2025-07-02 17:12   ` Marc Zyngier
2025-06-18  9:29 ` [PATCH v7 6/8] kselftest/arm64/abi: add MTE_STORE_ONLY feature hwcap test Yeoreum Yun
2025-06-18  9:29 ` [PATCH v7 7/8] kselftest/arm64/mte: preparation for mte store only test Yeoreum Yun
2025-06-18  9:29 ` [PATCH v7 8/8] kselftest/arm64/mte: add MTE_STORE_ONLY testcases Yeoreum Yun
2025-07-02 18:34 ` [PATCH v7 0/8] support FEAT_MTE_STORE_ONLY feature Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250618092957.2069907-2-yeoreum.yun@arm.com \
    --to=yeoreum.yun@arm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=bgray@linux.ibm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=charlie@rivosinc.com \
    --cc=david@redhat.com \
    --cc=frederic@kernel.org \
    --cc=hardevsinh.palaniya@siliconsignals.io \
    --cc=joel.granados@kernel.org \
    --cc=joey.gouly@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=mbenes@suse.cz \
    --cc=oliver.upton@linux.dev \
    --cc=palmer@rivosinc.com \
    --cc=pcc@google.com \
    --cc=puranjay@kernel.org \
    --cc=samuel.holland@sifive.com \
    --cc=tglx@linutronix.de \
    --cc=thiago.bauermann@linaro.org \
    --cc=will@kernel.org \
    --cc=yang@os.amperecomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®