From nobody Mon Apr 6 12:12:13 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7665B3CAE87; Thu, 19 Mar 2026 11:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773921020; cv=none; b=gV7/zgZ30UjwYVk9QMNIdV28uiZ2t0TsQLrJMkV2fgKLstrvl2Hifn+ukIOLgj06il/jsTBOohNtHVUymfV3Yf/zWyKrf+JTI0tpAKY99MknE4jh1ShyrOY17KSqP4jksaRf4Bt9ar73PMVY6l6vBNUe1iIXkdDNYlMKG+1fXMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773921020; c=relaxed/simple; bh=32l9uZ1km9Cm9dK1noYY5hOOta1mVAr1AsU5fQzpEgo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=et7J7R+4VebYbylkl/0o7NfQWG4tRsKhv7sPEwQncthQ2JzNeQY/M9e0Tk7jh1tJ/Br2wob7yHM0OmwaqFNs+ABtNpFcEH3s4SXhSvEwsCd4iOmExs330hZqQdOAJ6oWJ7TxlFggNvCuYZIncl3FUXYP5h9PKGigrZH9qxdu7vs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 05AEE20E3; Thu, 19 Mar 2026 04:50:12 -0700 (PDT) Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com [10.1.194.63]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C7B4A3F778; Thu, 19 Mar 2026 04:50:13 -0700 (PDT) From: Muhammad Usama Anjum To: Arnd Bergmann , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Kees Cook , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Uladzislau Rezki , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrey Konovalov , Marco Elver , Vincenzo Frascino , Peter Collingbourne , Catalin Marinas , Will Deacon , Ryan.Roberts@arm.com, david.hildenbrand@arm.com Cc: Muhammad Usama Anjum Subject: [PATCH 3/3] mm: SKIP KASAN for page table allocations Date: Thu, 19 Mar 2026 11:49:46 +0000 Message-ID: <20260319114952.3241359-4-usama.anjum@arm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260319114952.3241359-1-usama.anjum@arm.com> References: <20260319114952.3241359-1-usama.anjum@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Page tables are always accessed via __va(phys) / phys_to_virt(phys). With a match-all tag in the pointer, MTE never checks memory tags on access. Therefore: KASAN HW tags are set during page table allocation but never checked during use. KASAN poisoning on free provides no value for these pages as well. Its pure overhead - both at allocation time and free time. Hence, skip the tag setting for all page tables. Signed-off-by: Muhammad Usama Anjum Reviewed-by: Ryan Roberts --- include/asm-generic/pgalloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/pgalloc.h b/include/asm-generic/pgalloc.h index 57137d3ac1592..051aa1331051c 100644 --- a/include/asm-generic/pgalloc.h +++ b/include/asm-generic/pgalloc.h @@ -4,7 +4,7 @@ =20 #ifdef CONFIG_MMU =20 -#define GFP_PGTABLE_KERNEL (GFP_KERNEL | __GFP_ZERO) +#define GFP_PGTABLE_KERNEL (GFP_KERNEL | __GFP_ZERO | __GFP_SKIP_KASAN) #define GFP_PGTABLE_USER (GFP_PGTABLE_KERNEL | __GFP_ACCOUNT) =20 /** --=20 2.47.3