mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Pierre-Clément Tosi" <ptosi@google.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Fuad Tabba <fuad.tabba@linux.dev>,
	 "Lorenzo Stoakes (ARM)" <ljs@kernel.org>,
	Will Deacon <will@kernel.org>
Cc: "Vincenzo Frascino" <vincenzo.frascino@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Marc Zyngier" <maz@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev,
	"Pierre-Clément Tosi" <ptosi@google.com>
Subject: [PATCH 3/3] arm64: Remove mte_clear_page_tags()
Date: Tue, 01 Dec 2026 15:56:25 +0100	[thread overview]
Message-ID: <20261201-mte-page-helpers-v1-3-5aab4a7a7ebc@google.com> (raw)
In-Reply-To: <20261201-mte-page-helpers-v1-0-5aab4a7a7ebc@google.com>

Convert the last 2 callers to mte_tag_page().

Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
---
 arch/arm64/include/asm/mte-tagging.h | 1 -
 arch/arm64/kernel/cpufeature.c       | 2 +-
 arch/arm64/kvm/guest.c               | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/include/asm/mte-tagging.h b/arch/arm64/include/asm/mte-tagging.h
index 0b429f8104f7..8f4a5c1d3b27 100644
--- a/arch/arm64/include/asm/mte-tagging.h
+++ b/arch/arm64/include/asm/mte-tagging.h
@@ -82,7 +82,6 @@ static __always_inline void mte_clear_folio(struct folio *folio)
 	mte_clear_pages(folio_address(folio), folio_nr_pages(folio));
 }
 
-#define mte_clear_page_tags(p)		mte_tag_page(p, 0)
 static __always_inline void mte_tag_page(void *addr, u8 tag)
 {
 	mte_tag_pages(addr, 1, tag);
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index e817d49037a6..b622077135b4 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -2288,7 +2288,7 @@ static void cpu_enable_mte(struct arm64_cpu_capabilities const *cap)
 	 */
 	if (!cleared_zero_page) {
 		cleared_zero_page = true;
-		mte_clear_page_tags(lm_alias(empty_zero_page));
+		mte_tag_page(lm_alias(empty_zero_page), 0);
 	}
 
 	kasan_init_hw_tags_cpu();
diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c
index 78020e1abaa8..e7ce89c232e7 100644
--- a/arch/arm64/kvm/guest.c
+++ b/arch/arm64/kvm/guest.c
@@ -1074,7 +1074,7 @@ int kvm_vm_ioctl_mte_copy_tags(struct kvm *kvm,
 
 			/* uaccess failed, don't leave stale tags */
 			if (num_tags != MTE_GRANULES_PER_PAGE)
-				mte_clear_page_tags(maddr);
+				mte_tag_page(maddr, 0);
 			if (folio_test_hugetlb(folio))
 				folio_set_hugetlb_mte_tagged(folio);
 			else

-- 
2.56.1.839.g22a8290db9-goog


      parent reply	other threads:[~2026-12-01 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 14:56 [PATCH 0/3] Introduce MTE page tagging helper APIs Pierre-Clément Tosi
2026-12-01 14:56 ` [PATCH 1/3] arm64: Introduce mte_tag_[clear_]highpage[s]() Pierre-Clément Tosi
2026-12-01 14:56 ` [PATCH 2/3] arm64: Introduce mte_tag_[clear_]folio() Pierre-Clément Tosi
2026-12-01 14:56 ` Pierre-Clément Tosi [this message]

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=20261201-mte-page-helpers-v1-3-5aab4a7a7ebc@google.com \
    --to=ptosi@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=fuad.tabba@linux.dev \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ljs@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@kernel.org \
    /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®