From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.69 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796136606; b=rh1S8D8wzS8X7SbIVAi5/0s3Q6b+jtzGWn8EHcaFa4gsCIeJWa/uvXupg/VqgLCjJCLX uDKu0o0qHVk4jMUT9yzzzNsDQXJ7iE0Vn6r3fwxVdogNMHU6no1LnO1Wlstp2K0i+pkgF G7XbqI0gNZybEA4c+WaZUJdsIyKZju88DHPlDE/9eW+Ops3WAfxJPuv5XkgJlvztAIFG3 FswY2cDKVWRGD8Iw7/Pxzav9ELZ3Lu2OdE0bkPtZ4JV2DqdE2JP89+mxaZxjj42mOX8yu x0ctuOkSIwYuTtRrI5pPyZucTwSxq5EB2CucaUE5w+6lOJzZQGoq8VfUXpQqTGJaeOg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796136606; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type:Content-Transfer-Encoding; bh=GGMxXFC2QIbTho2ddHdw4AjXvd1iTLTPhUSLEfv5XFc=; b=m0WgnkOcAnp6x9+OIUUBo0fcCDrj/wuQQ3KLK5hJl1MguIb1E0JyrBATBkttdBb7cDjT 2Tom2RVe7pRNG8hB35ta6NMqlC717Th5OmtyYN2jwU9OndL9fRJOXJXIjmBaPrvlSbiaC xf+uId5ltvqggH7cdIZISyt9nIqz7ND2qhCdIeszw5CeDf+nqwfawZ9RagFE+rCWhq8qN NtNZ3RCGFwCwkmPYdQo3uIWaYnb3Q0qe3m+HJMkFsBsagbC+7ulokx3pmqs8YvPgjDBMQ ACfIutbmyiNwmmHC/DgiR5GmQ40jwUgX/IO8Vv+dF492mAspxYjXm5kGMS1RzPxAkVw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--ptosi.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=PmBVXkse; arc=none smtp.remote-ip=209.85.218.69 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7902B606A33B for ; Tue, 1 Dec 2026 14:50:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7902B606A33B Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ptosi.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=PmBVXkse Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-c50713860c0so978692366b.0 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=vger.kernel.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=PmBVXkseGwDBGcdKtDAdEVuMrbSzoV+xrktuw1v78gEYJaibWmP/CjzfMRlO7nn+YC y+xDhEaQA4r7RroyM10x4L/Cgwr4bJE+6SEFXr51sjX5LW2I72zLxrRKMn6z2fBir8tN ZoVDqKQENq9Kp0uSwlngMBWqm2q9dFRdkrxtzLEne8yAfr+WKoKnq96a/KgT56kM0OC1 qHm3PpcarT9jBR+04y7HclQCO2imnTi1vgnBu5PDX0/AQqmFuAy8W5dHmN5mrmVWdgp1 eVknlKVY12sSBxTpwAdHYf6Yn7ToHP1dVb3W8j0Qd/NsBIA/+ElvJvJrHuttSYHkEINq Cf1g== 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=rv0rTblQK38Sntk7XXLCwjDXbIdPUNoqQJhZHgAFDkdKnXv3yPAuZzZnLCyo79ECzu N43M4JNGh2bgE8XRbJsYYGXIWSAabhbMtQNa2AhKbrAU1MP5OT9gWJl0UG/GcyiZfZ4H ehgSXa8jWZbxESMDoqbX2ryuVlaFbihnUBFxG+JEpgPOL5USLxeGCmJnUSpq66FmklCi mBkx3IUKLvFNObqHgh/sR9pym4h21D9NyJul2SFc6CqIAcjEbWqXDXUnn8FWq0vt78Ai zDzNpZbGWmQhr41kXpMuqu+W8dHYAPfb/JoYIf2UZGXL5Cd4BouOGALxj+QvcuHZuC0I QnDQ== X-Forwarded-Encrypted: i=1; AL+hErEjurIA6hnc4h0SSwpByqzH/xnSTKhBtOIARVtDPIZLCtVxq2/5/4X447TNLOQqSjF4MiDVLvVoS6nU/O0=@vger.kernel.org X-Gm-Message-State: APuU4Z93xYLNtcOrha/NWUFJV0EVlcYBhyFZXXE0gGTVfU9YAfJNKX/A JBVrlpIKqUwPKbZvR+ca4+4MEunaA1Y0umKaXRas8Hu6Ah2KG1wcE02OskabpjjU7YpNx3u+NO3 b5A== 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-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 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