Message ID | 20250127160709.80604-7-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 0ABA8C02188 for <linux-mm@archiver.kernel.org>; Mon, 27 Jan 2025 16:07:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E38C76B015F; Mon, 27 Jan 2025 11:07:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DBF516B0160; Mon, 27 Jan 2025 11:07:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BC37A28011F; Mon, 27 Jan 2025 11:07:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9B52A6B015F for <linux-mm@kvack.org>; Mon, 27 Jan 2025 11:07:33 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 52DDB80358 for <linux-mm@kvack.org>; Mon, 27 Jan 2025 16:07:33 +0000 (UTC) X-FDA: 83053711986.21.02B94F0 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by imf08.hostedemail.com (Postfix) with ESMTP id 5BA5716001E for <linux-mm@kvack.org>; Mon, 27 Jan 2025 16:07:31 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IfifjK0Q; spf=pass (imf08.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=ubizjak@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737994051; 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=lrZpQikn3aM6B3Iqd/Ucnjx7jHzSyajd3QTmq9Vwrvo=; b=pjwwRMkJ45AQ6QYOxKtDzJpNlneGy3UnaqByNgbCc3q4EsTS/PExsbgnl26ztwdVKR6gyD ytRVqQqu/+CHNizJhWCUOvM7umSxVJhumSpkk4RvbopfwzAPswDdiZ/W4LvugMSqln0WZG BbtN1RMKcbEU/vs6PWr2J/0KgmT29I4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737994051; a=rsa-sha256; cv=none; b=M+Py6ksuE9riWsFC52C5Q6X13DVRosZo3X1wCgviqsuANR9Ff42yTBQlvwVhvH/fOS+E9J ua/4Z1nW+fkYkAQoeVMERNk/fGqB0mlCc+qz5m8QjkuihpJVfXiLj9iUL3GQNLfFiI5DHg mWigqwEAHsUrjjduLj6kGzcXuz/dRSg= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IfifjK0Q; spf=pass (imf08.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=ubizjak@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-aab6fa3e20eso773482566b.2 for <linux-mm@kvack.org>; Mon, 27 Jan 2025 08:07:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737994050; x=1738598850; 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=lrZpQikn3aM6B3Iqd/Ucnjx7jHzSyajd3QTmq9Vwrvo=; b=IfifjK0QwhVcgNHrHRyAWTf3KHiYudpdtEdS2uD+i4AYGAopIncoWm3ewzAOBrmVQj pjU0gA1i2PPNw7iEyrqazVFrnVZUI7VeyNZaG0USSqYT5XoUEqTlMX0AONAtwR8GzG+Y JBJOOYGgnoYz83AupLlUO3kdY9WUKtxW9iydkMPsZJ/3oafsEHycNvtQztOrJshNEXlT /r0O88hUFRUBDmxwmk9CJ2jRnPY3Sx/O5nG4icXZ7T2qditAvckI1TAxr7A6wV3429m4 /+Z+b72Y0qhWOeDreBN7M16TkMOkmfAhUWlP9y3gYzfh+2J0kYRVQdwqxu13TS/bFX09 V6ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737994050; x=1738598850; 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=lrZpQikn3aM6B3Iqd/Ucnjx7jHzSyajd3QTmq9Vwrvo=; b=YP23k6Ht5LybWuP8dE2+q61E/01exgh/dlqFIBH6yNZXzINX2dTKN9umKzMbtphqR4 Qq524H5fjH+/twfkQKEY86/QiSx8myiK0ltG6rrH/E79XiBdyqekNoNSrDPzbeH0I+2/ akEjlx9P2FmLRxcWZ4/UJhYu0V36v4kHviU8g2URb3DPji/+HwnzPTDayS9uWiyEfzwG O132NPV8gzOUJgWdOqEjBLkQOr1seujQvar0A7dmMzq92Vb84GqaUb2NqnrwTyU+Pk5A yQtaCPvQklZgjxvCaTEkfWwMsccCpEsNzAMtzKK2kC+MjarYZ9muCDFXr39ErvUlgPPE ZtXw== X-Forwarded-Encrypted: i=1; AJvYcCWLYTLmaBxhfJQ54EVijvICczoe0Ktxi89Zt5tshUirs55nvcyXjjwmwO/yNwRq8HGRp9klgHE1yQ==@kvack.org X-Gm-Message-State: AOJu0YyjgfTDoeo9mGnPl6vaOn4rCAc5hRPD1tLFd/5F2Hk0JDSxi3VD BKSV05pL8EORtmGnZYs/Y2Bnsj5d+olYl9piwN/oirj1zArcRAcY X-Gm-Gg: ASbGncv+tYh3ZtUa6f+yeAeJspaW73qZ+vNBXJI8R7i9ebPsoHzWRhmSA3x4VWgTXXt XWIalNN+leYNG7klvdS4VWQzVApasoqsMRvnQOfQOXUoUbKqnbESWwYauQhK8RYjPO5ny4Bcs+M ns0Xq1UJVQKQ3NypedC6xAgV5E+B9iJy3cSkNYNvF/XBJ6u+wt+l902r60udATUinNFLwVjoOlK YeOPl3QpHGCIuG1k8hA3BAENzIT+tsIDGSGXdTL0a+WuYICxAMcCMB9yUBdlWCeXqtzBOmdI5Zp j1QrOISZjLqLXg== X-Google-Smtp-Source: AGHT+IHVilwWp86cIXuCPcSCEjAlKAPSZRo0H0MsLWLvAzoRKeZuFBp6uVwp/VtMeJUTjVHCLgUcfw== X-Received: by 2002:a17:906:4f8c:b0:ab6:362c:a8ab with SMTP id a640c23a62f3a-ab6362caa41mr2246025266b.29.1737994049651; Mon, 27 Jan 2025 08:07:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 08:07:29 -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>, Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@linux.com>, 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 6/6] percpu/x86: Enable strict percpu checks via named AS qualifiers Date: Mon, 27 Jan 2025 17:05:10 +0100 Message-ID: <20250127160709.80604-7-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-Rspamd-Queue-Id: 5BA5716001E X-Stat-Signature: 61cxer9dhch4scyjgtaek6obyu7pcth7 X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1737994051-156138 X-HE-Meta: U2FsdGVkX186jH/9Ou5PLbi/PymUThTh7l2QKdP0otneBHBNWI7GybOIB5v6wjC951RHKs/Fa+rWVPym7W8w0QRXxm71v+92CulmEKQztYAIGaqv8za13TzrWQgGBcIwx8UiTjqvMwOyGdoNo+0sqwakl2WIjXBrmeqnATCblTNW8IQNS0R29uKDWYUIqFY4uFD8xmR+NS5gUIn1/sth7EWs0iLPtUKP7/N63K5GweJ7cNZoW5gwqOafLJFSmZaw7lRONHt0TzjmJj9/u560hMT30Z3aXh76vtUtQ9Y8KBH7vgYFOkzlAyfIqsYfXsVW3aoGGYpKS7FZmt8O42WhJnUGgo9QfbOKB+ZSQDiAdtxCN66ygUMt2UNEAlop+UYFLLvUcUXHxd3HNMK3KK6tud2O3EB5TBPzs8BZU8GZZYA/gbRc6nF6hAZVMTWkCu+PZtA2jEMskRM7pTHk6MRQTy8BDlio0bEjU2XaG1lL/hFOt13ISy9UY8qoT2eXcid4QslMvYk0AkHX0voZ8rBjNYapA+KSPvNJWubiC5I9FtPiPNejrquZsbGrLyec1uYDnE8D9vTJipnY8Pjv9TKk5G0tuMpmAdUY2AJdt73ZDg6kH8CT5Ks056ku7uAhxWsK+JRhaKx2/pBOjKeJlAj/4ofNpr5JtmFuzeQi1S39rmkQKg0OgnCnufCnCJufiwoMOscsrwfeY88iMAmBXoyCGh3suRt+RIysGBerH5bRyGcvfv1GadTCiN5ucQoQglmctfAMwjzKf++OIryVSnwE2PfyU6FC3tddexdPADRVINwaBDmD7dOB0eVxY9T5cET1IoMc4SdE9TkYga5UARpShLYv5tHo8aj8eaw1lDaXfAy2JG1snt3d4vTUD93cnd8NELeeBROEtJw7idyBPAsMArmC1v2R8kV+HkthE7AbfA/rgvQClPkU1ZV4RPCxck7adhaHxIzC3pViR7Hnjlp HCU72lpm CIhOiAlENYgt9GmlgS5GBdbN8d+X/6lPUQ9WLvKhQOzTsuRFL8O90EOPkhdj5wAdvWgpsKtUfqy8wTrvQXx+/neYhYA/CGmzne274q9oqqKO0cKsE/pvqH+RQcuTtzE8HohwjC4/QlR+YJT2QMzNXn6fT5wrzM7tSQ24R0TADf9idzwMoQd1bCupDSGjfgsshxQner22EJ9XTo2jV0zceymWfELGItaymGyS6gZxP+nUHqwtxEEXaBceW7fzbX6vuaS1m3YLt7ZEauh7F4nCeDK1L7VNoya9/mNoPb6pY7L3LNmi1WT99Ky7NcMeMjR53L0Tlb1XttFBgIBVQjiGUPelZs0AZjioUMF/4BDm9Bw66m7Qq6JOxMpSrqldtnwC1h8CG4v2YpxszSFqiYUXOSphTotRUAC1khlAsbtY5+mgwHJiS3q2DnGj94uW2vZEa7qvmmoy3D3k/JlqVc7I8NBaAhu5usfpxHZUxaCVQeKiBf5k9MuRK0uo3j1MuoQQMGTOIEl9qkaFi54ZkRCk2rBOxcl60xfTeAPUttJxHuaaZQDOtKFSXoJgSAEIwJkAT0wS1Cz2SA8nPB9cuNcALYJfckfFX+lpLxYQDni+Q/Xx5DeUpebDKkokIqdmXwIXlJ560U2Fn2Nf6hGkvHxgM9VLmJcrsi8KZ/pdGNZ/UINooPeE21LWiiEBbykpggsjHl9BGLDrj0iLeb8scNQg+Ctw0MhJAmUhR4Tbw 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 27f668660abe..474d648bca9a 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -95,9 +95,18 @@ #endif /* CONFIG_SMP */ -#define __my_cpu_type(var) typeof(var) __percpu_seg_override -#define __my_cpu_ptr(ptr) (__my_cpu_type(*(ptr))*)(__force uintptr_t)(ptr) -#define __my_cpu_var(var) (*__my_cpu_ptr(&(var))) +#if defined(CONFIG_USE_X86_SEG_SUPPORT) && defined(USE_TYPEOF_UNQUAL) +# define __my_cpu_type(var) typeof(var) +# define __my_cpu_ptr(ptr) (ptr) +# define __my_cpu_var(var) (var) + +# define __percpu_qual __percpu_seg_override +#else +# define __my_cpu_type(var) typeof(var) __percpu_seg_override +# define __my_cpu_ptr(ptr) (__my_cpu_type(*(ptr))*)(__force uintptr_t)(ptr) +# define __my_cpu_var(var) (*__my_cpu_ptr(&(var))) +#endif + #define __percpu_arg(x) __percpu_prefix "%" #x #define __force_percpu_arg(x) __force_percpu_prefix "%" #x