Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Pierre-Clément Tosi" <ptosi@google.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	 "Lorenzo Stoakes (ARM)" <ljs@kernel.org>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: "Marc Zyngier" <maz@kernel.org>,
	"Fuad Tabba" <fuad.tabba@linux.dev>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Ryan Roberts" <ryan.roberts@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	"Pierre-Clément Tosi" <ptosi@google.com>
Subject: [PATCH 0/4] Expand MTE tagging API to multi-page and !0 tags
Date: Tue, 01 Dec 2026 15:49:16 +0100	[thread overview]
Message-ID: <20261201-mte-page-api-v1-0-5e38d19462ea@google.com> (raw)

(Based on kvmarm/fixes, to avoid conflicts with Fuad's patches [1])

This series aims to provide an MTE page-tagging API which

1. supports non-zero tags, such that KASAN can reuse it (future series)
2. has built-in support for multi-page passes, for folios, (m)THP, ...

It achieves this as follows:

- patch 1 adds helpers for logical tags, used by later commits
- patch 2 decouples the page tagging API from mte.h, to address on-going
  pains of circular dependencies that header is very prone to
- patch 3 adds support for multi-page tagging with any tag value
- patch 4 adds separate functions for clearing the data along tagging

The new functions are named to fit in with existing kernel APIs and for
conciseness and clarity. A later series will make use of them and
introduce helpers for callers not dealing directly with void*, which is
most of them. That's moved out into a separate series so that the
bikeshedding doesn't delay other series (optimizations & integration
with KASAN).

Tested on v7.4-rc1 with [1]:
	git cherry-pick cbf47fe57a56 62b9e1f75a3c da9f24dc4336

[1]: https://lore.kernel.org/all/20261021110700.493315-1-fuad.tabba@linux.dev

Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
---
Pierre-Clément Tosi (4):
      arm64: Introduce mte_tag_of()/mte_tagged() helpers
      arm64: Introduce <asm/mte-tagging.h>
      arm64: Introduce mte_tag_page[s]()
      arm64: Introduce mte_[tag_]clear_page[s]()

 arch/arm64/include/asm/mte-def.h     | 20 +++++++++++
 arch/arm64/include/asm/mte-kasan.h   |  4 +--
 arch/arm64/include/asm/mte-tagging.h | 67 ++++++++++++++++++++++++++++++++++++
 arch/arm64/include/asm/mte.h         |  5 ---
 arch/arm64/kernel/cpufeature.c       |  1 +
 arch/arm64/kernel/mte.c              |  1 +
 arch/arm64/kvm/guest.c               |  1 +
 arch/arm64/kvm/mmu.c                 |  1 +
 arch/arm64/lib/mte.S                 | 26 +++++++-------
 arch/arm64/mm/fault.c                |  3 +-
 arch/arm64/mm/proc.S                 |  8 ++---
 11 files changed, 111 insertions(+), 26 deletions(-)
---
base-commit: 012e4bc01e339a65dc7c59181b5efb33b171d12c
change-id: 20261129-mte-page-api-f285a514f1ad

Best regards,
-- 
Pierre-Clément Tosi <ptosi@google.com>



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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 14:49 Pierre-Clément Tosi [this message]
2026-12-01 14:49 ` [PATCH 1/4] arm64: Introduce mte_tag_of()/mte_tagged() helpers Pierre-Clément Tosi
2026-12-01 14:49 ` [PATCH 2/4] arm64: Introduce <asm/mte-tagging.h> Pierre-Clément Tosi
2026-12-01 14:49 ` [PATCH 3/4] arm64: Introduce mte_tag_page[s]() Pierre-Clément Tosi

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-api-v1-0-5e38d19462ea@google.com \
    --to=ptosi@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=fuad.tabba@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=ryan.roberts@arm.com \
    --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