Message ID | 20250127160709.80604-5-ubizjak@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EB4BC0218A for <linux-mm@archiver.kernel.org>; Mon, 27 Jan 2025 16:07:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 16EB82800E8; Mon, 27 Jan 2025 11:07:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F0C66B0160; Mon, 27 Jan 2025 11:07:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E34852800E8; Mon, 27 Jan 2025 11:07:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C0F556B015F for <linux-mm@kvack.org>; Mon, 27 Jan 2025 11:07:30 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 6B9D11C7132 for <linux-mm@kvack.org>; Mon, 27 Jan 2025 16:07:30 +0000 (UTC) X-FDA: 83053711860.06.335E9E1 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by imf30.hostedemail.com (Postfix) with ESMTP id 757F280013 for <linux-mm@kvack.org>; Mon, 27 Jan 2025 16:07:28 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=WstyVLCI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.218.52 as permitted sender) smtp.mailfrom=ubizjak@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737994048; a=rsa-sha256; cv=none; b=PyvPvdLM8D7iT70cZIkw6X8ylGR7fqDQbiZ9cM3bPWQvkeELNkMfAWaEdrKumdHQVpCN7R lJnIxAQtqBYmspviFMxbReO4+sxLrSfNKOpALtLs124DMwvn5xkc9Syln5XOpj2jwSLvWC 6inlahTGo15tGlFdlv9tjKqDukI0kcY= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=WstyVLCI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.218.52 as permitted sender) smtp.mailfrom=ubizjak@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737994048; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=eOGOr4s5yiF+IlrjEXheryEMyHp3uedGamtyEKhbkyY=; b=5svehoK7aXwvc6aj3w4ZtQd0tog+S1bmdXdbjWfo/8lKTXE0KBupSNGdfImUaNn/URJ5rz 4rOsxUrwA9WTvq/p0KQmhEJ3ktt0C3MjsinDONYo46kwB4QjWPe+63K3ILokLM4xxLn012 d+PUaVqced7LpdorKog6HXTo2HAeq/M= Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-aaee2c5ee6eso953982666b.1 for <linux-mm@kvack.org>; Mon, 27 Jan 2025 08:07:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737994047; x=1738598847; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eOGOr4s5yiF+IlrjEXheryEMyHp3uedGamtyEKhbkyY=; b=WstyVLCIn4sIIT0INP9lb0iVPg+Tmcc3mCXwQRlrS9Oc1TovjiYbsXLq0kxtCyHdcw 2QRH5XEbv9YBRSds6jSn916wrxlrQmwIyy8WvljG2XjigWfk2dOcaFHHMktI6B6VJLKp g5QdFPVyZpD0EBz+A5CZyW8wYx1NMTODMyr9Zr+RTi/vF5Szknnlb3ArzPJh7BGyekOV uzzDbcU9JPMLXyEzoagJxd1punv7CZZbA8dobVFKdLVD/ERWkVSi9Eh2I8zd3CRoFgbp haneJ63NnF09nSNiKKIvSFy9cTs2vaRjj/isJOtOVyhg3OPkrWrMAitxsb0ORPXCuXmW y/ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737994047; x=1738598847; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eOGOr4s5yiF+IlrjEXheryEMyHp3uedGamtyEKhbkyY=; b=kjEdh6Qlomh1ZfKmRqPnhuVnKOm08epVMMam5q+2UTJBhvq0OZcluny/H4EuvQwbat Hx76g6anXEry0XvvfsuIYnCu51sVwEhFpTT51ZD3j7btANan3ex4nrtseZoYTNmWsdSq +ijV39mo6IM1xXj7Jsmk2ZghQTKChru6M6uogrsfDtBtyoWH9NCMpM6nJ4MdjIs8reJ1 /YPisl7TE7pRhdwfK9+ygJy/peH7HtMalnV21de/Ety67HDrqELHFecbr4L9Woin5RIQ HMCBfrRaRMHFufLpcfpQi56qBk0jzQyLWjeK3nG0QoOeFLUdUE4csouu1AXuQWoqQlb6 A6SQ== X-Forwarded-Encrypted: i=1; AJvYcCXEKOmrqg4eupiqvwIx0kebrWpMssukRQU3mhbDH7Q5rCRwLSgxlzxd59zstEx2LHRCW0w3DQy2nw==@kvack.org X-Gm-Message-State: AOJu0YxR+LbtmiQ2Gz9jytCnef9+hFeFO8plIzrKqJfz4nY6OpxwRrrN OaUBPo24ahgHlOrYF3deGYpDIREepf2CWkSUhghVJpCN/j4Uhht1 X-Gm-Gg: ASbGnctKS4t9HEixEYigL/RD+FUwmPekQSidxZ9GwzQxIGFe0rDMn5fR2c2rKPwWmy7 JZo66qjepfbYbxerjT5SMcTBw72ZJBQlHlvZqRYlwQFdDiOlb2wOUYUs+c0rLnTQWUByyX3+H9Q XHEr8aM2t/ndmrWcHky1Zoltj3xtI0A1N5bMeBy1tkDLnhdFi4ODgEGYsEw4FoXnrndwLdDIE00 HfHBz+liufr3MHo3lwLE3RT5oP0DrXQGZ4o416vuRYXQlXMqGs82wtnystGeLhPgSrtPDtJlxVC qKd0UZNkLhd9UA== X-Google-Smtp-Source: AGHT+IERCLQXnCU+YIaBBJp+oaHBkoRX9ZwnjjcfabyvezHHAG9ec22+X9u8D1546w+n0uGxAoPHpg== X-Received: by 2002:a17:906:2cc4:b0:ab3:a3b4:f91c with SMTP id a640c23a62f3a-ab3a3b4f9b3mr3132086166b.34.1737994046774; Mon, 27 Jan 2025 08:07:26 -0800 (PST) Received: from localhost.localdomain ([46.248.82.114]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab675e8b01asm592643866b.84.2025.01.27.08.07.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 08:07:26 -0800 (PST) From: Uros Bizjak <ubizjak@gmail.com> To: x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-bcachefs@vger.kernel.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org Cc: Uros Bizjak <ubizjak@gmail.com>, Nadav Amit <nadav.amit@gmail.com>, Christoph Lameter <cl@linux.com>, Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com>, Linus Torvalds <torvalds@linux-foundation.org>, Andy Lutomirski <luto@kernel.org>, Brian Gerst <brgerst@gmail.com>, Peter Zijlstra <peterz@infradead.org> Subject: [PATCH v4 4/6] percpu: Use TYPEOF_UNQUAL() in *_cpu_ptr() accessors Date: Mon, 27 Jan 2025 17:05:08 +0100 Message-ID: <20250127160709.80604-5-ubizjak@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20250127160709.80604-1-ubizjak@gmail.com> References: <20250127160709.80604-1-ubizjak@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 757F280013 X-Rspamd-Server: rspam10 X-Stat-Signature: zw1ftj6sa5esurxay8s18c7a3omz3i54 X-HE-Tag: 1737994048-930007 X-HE-Meta: U2FsdGVkX19M2NsUARxMJHH+fMRMQBGJSHJDY2AaNy+I8Bel043W7bhtm3fvzmqti+swq24OBYy8pExCG+ri4lStqOy/1qk+dfk8qM5nwlIl9HCpD11oAYphU+pNN1SFXDM6acZ/ZNBDOJlfI96f4MOqDApWjgDcKj4weBDksekqfGQprsWR4eJOsxPJDzXulDjYK+V7pVUsDeOrMX2NbA6xp27KsRxGqEelcIKxnCa4ybmj1oOuZIlJ9jKFjOj4xjwOUUpsClNHuwvtPuL8M/YwiL1xVOcb4fn1XN6T72VSF1jMzyEts8Ed4faB4evVlZEOJpCkFdgbpPFDiv4gXSaCm6Y/acHHcthzFM3a3G8W+cagrVn/NT7Lw39GxX2pS0YzA0TXl6Pq8R1BP3d5RyzVyCMuxXh6g5zr9N4PxB8cytemKU9U3BXd8lWy32aQjXmGhN690EndCAab5cVOyH3pjsHyRGL17xIKS0O2xW+sk8tgkSUbsoP72yH58XA4ELrb1xtRUapFrz/Bnjlaf9Xu9I7GY9MRd3aoG/Jt/Z1DOZ32NgmezEYokaVI7KGnhd3uVdr+Q6jQg3g+iEvavB6Kc5dlGJcUmeBgdLy+KnUnvP5o5nYtYgbudWsmaHlofdVl276zVxN1+755V8bQBrBYGBzKXPmUx0JmN0VyPcSXiOkXWbNdyV/fVUM9wBNR8WonMKt/2D9QW05TdbSNG2oyfCuf/AfHRm2Y/dHLjHWGfXkNpdSR+3GIbUO0a0x855YDCpK+omCWttiWU1CemSenbm4qHWa/HZCraWcK4pQyILQYv97Qw8cpWWGzX+yGAwn4H0qkI3RRLkBqfNBBqwfEAvCoy7fscy7zMs7xeMf2xLtU40ufTXVYSAPYLEqSJyc9px9rtg0L2sgxYUgkNx4r5o8BBRO31kf5vI4YMyj/SacxMmOlDJv/UqPnQvBXwWuFDf4hlmSvBPa+Viy bjzhkGpK BnpGnrFp0OBZX5Pv9OjA6X3c8XOpOhdSw7EpkYHfsYxMiCIvP80Ua8oQJvovBBDPSwVf28AqKSyxYDmfxm62rdWbCmbuFUwSfa/QRwW0jqLUA4q7Eiucw45LTID174NMjWbvlgRQ7vkF5oDQ+caJ7q35OonasfxitYVY6tqHLcr54jmKYpoPgAozPyDHrPpyIR1pBFiI8zBHGcOpKusATk1fBGPkGhITG26rveeDmLPDTevMNfqVBYtF6guksAgkUM3CMWUDNb9qZx+fwKGD+TMleONw66pvI7DPvkCQvABvK/MFjs08riYD7YJusydI1bbxTg00PCc0pIDOlM2Uy9BghfrmO5lhHaNJw+Ac9JsUOfn39lzq1QQpKqegz0nYrZDbvTUDiE7LONsfKlT20JYYtRcJQ5Yn/vb57UGA7PuJXPL6IIVAGHE0N+gC3A8+uWduJDaNNrs2FV6fy3UNRfINX198uwjIwnoOhfZtfE/b1DjJ33DP8DxFtJgOualYVDbua4FK7NRH6dOoMJMY9awiK3/7vEDqrN712k4ttXMGFso48WADJQvQQWRkNMdWJS3u+fRiNTnZgu5pexsekiQBxx3O88nKBOzt1sipOxdEipMiWFuctT/70NORlFq/5Va7++AV1CbtsOkPU8I36gI+5zP647QOO9/8wrQLdPR29pXM45RQRg+UH6EbU+GyFI5K4pWRlS7f0ysHHewUKsXAP9blVO7+G+/r8yRvlxZSB3C0heZ7u8qQMapfdE1hsc4DZTI1F2N9/lBPsoqCswDI5eA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Enable strict percpu address space checks
|
expand
|
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index 666e4137b09f..27f668660abe 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -73,10 +73,14 @@ unsigned long tcp_ptr__ = raw_cpu_read_long(this_cpu_off); \ \ tcp_ptr__ += (__force unsigned long)(_ptr); \ - (typeof(*(_ptr)) __kernel __force *)tcp_ptr__; \ + (TYPEOF_UNQUAL(*(_ptr)) __force __kernel *)tcp_ptr__; \ }) #else -#define arch_raw_cpu_ptr(_ptr) ({ BUILD_BUG(); (typeof(_ptr))0; }) +#define arch_raw_cpu_ptr(_ptr) \ +({ \ + BUILD_BUG(); \ + (TYPEOF_UNQUAL(*(_ptr)) __force __kernel *)0; \ +}) #endif #define PER_CPU_VAR(var) %__percpu_seg:(var)__percpu_rel diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 79b9402404f1..a7cf954ea99d 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h @@ -221,7 +221,7 @@ do { \ } while (0) #define PERCPU_PTR(__p) \ - (typeof(*(__p)) __force __kernel *)((__force unsigned long)(__p)) + (TYPEOF_UNQUAL(*(__p)) __force __kernel *)((__force unsigned long)(__p)) #ifdef CONFIG_SMP