From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1573E606A332 for ; Tue, 1 Dec 2026 14:50:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kCNxPlsN; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=n8r2gj/S DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version: In-Reply-To:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=GGMxXFC2QIbTho2ddHdw4AjXvd1iTLTPhUSLEfv5XFc=; b=kCNxPlsN8bAbt8TipHKKWzpFX9 7GPrSfDXW7ttg8TNNukfR//xEUOY9U2HMT4x7oq3oWadyKQum3Qo16cD8yubgsywxRstt7J7HjeeJ j6pp4H8HtBRAw6K9aT8pVhfbHw4k751dd2JwtRt8UJ+wDDuPVJCXyLKLl380fP63TPVkNQLMxg7Gc +waa3mUegkiIl5QKKomwiGPUpCsYTriyR+THXAan4CVfKv9DCHW3wceO5bj6cMHWNEYBOk4zJsl9M oRnKG4Qc0ixyZpSJ5EG5D65EJYEfjjzFavGLkpuO3lhCkIELTame64O1nQpRez1dpSensvXtQExm3 22/4FI7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYPBM-00000008Qte-1dmB; Tue, 01 Dec 2026 14:50:12 +0000 Received: from mail-ej1-x648.google.com ([2a00:1450:4864:20::648]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYPBH-00000008Qqk-0tBv for linux-arm-kernel@lists.infradead.org; Tue, 01 Dec 2026 14:50:10 +0000 Received: by mail-ej1-x648.google.com with SMTP id a640c23a62f3a-c51314820bfso623296266b.1 for ; Tue, 01 Dec 2026 06:50:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796136605; x=1796741405; darn=lists.infradead.org; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date:from:to:cc :subject:date:message-id:reply-to:content-type; bh=GGMxXFC2QIbTho2ddHdw4AjXvd1iTLTPhUSLEfv5XFc=; b=n8r2gj/SWu/43xOLJ0WcyAIaoEBBB1N6Y1twUjYxSiPdR0xfCXF2QUl+c8RJO4aFc1 jQ10O6/wiUHIxPWdKnMOeDPBnEhq9oMasfN7GGaAOi9LZYsxp/IIiBec0A/opGnkqO5E zxAXh/fbAgGRu/2HVVNcK8zCa3vg3ajEpK775gryhcwz6jnwrYHlJfyqL1kJKXQ7YkpO 6H0UyZ9X/I0gCFi2MNkuiMw3RNkMGprHrlrfd15K8AGZaZuU0MSSF+gOUEMf8FRwJjif LGu5CTNBnkzO2/qXzP4u3PB3cGvnDvrOTTKEJmDi7DgZILT2OHpAEXYJwx1Ib1c60VTj mh3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796136605; x=1796741405; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=GGMxXFC2QIbTho2ddHdw4AjXvd1iTLTPhUSLEfv5XFc=; b=HWCxytAi3cKBCnwssYj99Om8JReCiJb+d+fxzhUICvGHbx7HwpRw5wYddtg7aH0aUi fH6moQcx+1qNMk9RnXuhFutF35/6OVfAQq9DDAXeMZTCiRZfxzB5Pjjsnyk8wp1d7jqE mBpNdHNYc6khvhJjEdSsyjB5Xz9DxVV0LLqRREKVmtfdE2jYD5eoNWfsZrON/yd0VAeh BudyMp/6IluaWi6Net2iftX3xuTlcWEdtIwmpR086he8T4sPr2ceiomyY6e04MLsynNj tSuNCXQjp/tJfCLCnSkKHjVJ0aAzH92Jg9hZo7rq+RC/S8pXgHEBuF7qWio833katV7W BqzA== X-Forwarded-Encrypted: i=1; AL+hErGesOnrZ+PQf3Qpr46m/Yhfn1JUr+9UQwVbEngUEGMHPOzz/geU1K/9AB9KZqb33feJEKd4vgeAMeaQqeXopcSk@lists.infradead.org X-Gm-Message-State: APuU4Z8lxMwiw8R963dvJzOPhTc/Buh4uzvo7po8TF+ezIgiA8MQXxDl hOV9L8hCwsTmPtU/Rc2EIbAuZPGm9ZF4/gYtu5fy28SavTBGgC038LQxqJIwokFgrYv3EqSEWAX Njw== X-Received: from ejcl14.prod.google.com ([2002:a17:906:78e:b0:c4d:4f51:fd3c]) (user=ptosi job=prod-delivery.src-stubby-dispatcher) by 2002:a17:906:5ac5:b0:c46:b9b0:8e8f with SMTP id a640c23a62f3a-c513ab1303fmr2205733366b.41.1796136604689; Tue, 01 Dec 2026 06:50:04 -0800 (PST) Date: Tue, 01 Dec 2026 15:49:18 +0100 In-Reply-To: <20261201-mte-page-api-v1-0-5e38d19462ea@google.com> X-Archived-By: Mime-Version: 1.0 References: <20261201-mte-page-api-v1-0-5e38d19462ea@google.com> X-Mailer: b4 0.14.3 Message-ID: <20261201-mte-page-api-v1-2-5e38d19462ea@google.com> Subject: [PATCH 2/4] arm64: Introduce From: "=?utf-8?q?Pierre-Cl=C3=A9ment_Tosi?=" To: Catalin Marinas , Will Deacon , "Lorenzo Stoakes (ARM)" , Vincenzo Frascino Cc: Marc Zyngier , Fuad Tabba , Mark Rutland , Ryan Roberts , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "=?utf-8?q?Pierre-Cl=C3=A9ment_Tosi?=" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_065007_266693_9B734D3F X-CRM114-Status: GOOD ( 16.92 ) X-Spam-Score: -9.5 (---------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-26.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Since mte.h is included by multiple low-level headers such as pgtable.h or uaccess.h, it is hard to extend it without falling into circular dependency traps. This is specifically relevant since upcoming patches will need to call linux/mm.h macros, which would break the build as-is. One way to get around this issue would be to add new code in *.c files, like commit da9f24dc4336 ("arm64: mte: Add mte_clear_folio_tags()") had to do but that isn't ideal for simple helpers which the compiler should ideally be able to inline. A cleaner alternative is to split up mte.h into more fundamental headers and untangle the different clients. For example, pgtable.h only needs mte.h for swap logic while uaccess.h uses it for TCO-guarded sections. Therefore, introduce a dedicated header for tagging functions, mostly intended to be included from *.c files and such that it itself can include headers such as linux/mm.h without triggering circular includes. For now, include it from all callers of mte_[zero_]clear_page_tags() and limit the header to including mte.h. Future commits will build on that. Signed-off-by: Pierre-Cl=C3=A9ment Tosi --- arch/arm64/include/asm/mte-tagging.h | 13 +++++++++++++ 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/mm/fault.c | 1 + 6 files changed, 18 insertions(+) diff --git a/arch/arm64/include/asm/mte-tagging.h b/arch/arm64/include/asm/= mte-tagging.h new file mode 100644 index 000000000000..5da9c6433fb8 --- /dev/null +++ b/arch/arm64/include/asm/mte-tagging.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * MTE tagging helpers. + * + * Header dedicated to tagging functions, pulled out of to sim= plify + * the header dependency graph and intended to mostly be included from .c = files. + */ +#ifndef __ASM_MTE_TAGGING_H +#define __ASM_MTE_TAGGING_H + +#include + +#endif /* __ASM_MTE_TAGGING_H */ diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.= c index 8265803357c1..e817d49037a6 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -88,6 +88,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm64/kernel/mte.c b/arch/arm64/kernel/mte.c index 850bcee21e77..0aadaabbe31e 100644 --- a/arch/arm64/kernel/mte.c +++ b/arch/arm64/kernel/mte.c @@ -21,6 +21,7 @@ =20 #include #include +#include #include #include #include diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index b7d36c2abfdf..fc6d067b97ef 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c @@ -25,6 +25,7 @@ #include #include #include +#include #include =20 #include "trace.h" diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index a0d4981ebb99..0ae2e19d0bc6 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c @@ -22,6 +22,7 @@ #include #include #include +#include #include =20 #include "trace.h" diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index cf855aa1c30f..e093e8473b5e 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include --=20 2.56.1.839.g22a8290db9-goog