From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794726812; b=H5YXHE0wYw7Vdz8yCjnYQpgQyCVZDiv/22au7US/IiXJwzp/XopF0vngnghyMXXjhqHJ EIdghWWFl3sVT590YZhRWSxPG+nNuJXQpoLmYaqQxkqQhWvTPzixxp4OvoH/aewTO6zFN c4hinp8J1qtM+k8CZkEPTRyQobzMaYoCorGEiRWBSG4Nfiay8g/KDR9cTVAz0FrHNgr63 dtRHrJ7NxOzxe/LvmDL1yBhdyEFTJK4aEH3HC7vU82/qyV0ZHLkQc0kh50WyAJXwWUDRt TiwwdoQgNDGVHkF1tkB6YhXTHCKhJ2iNFDj1+WgCCnr6FSr0v32p4XRcJ/WTPydvqgw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794726812; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:In-Reply-To:Date:Message-ID:References: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=i0sztYeDoa78GRxByi5DPGRDZ13zK/I8mczcB1W5Z+o=; b=PqQhDLk0x6ypFmnw7nxme1RBPFwkx20d/XN6ivSX4LjgHGOU2aibUSTMRZj7AdC6nsHG 3Db7TM0bfchclhZvD2H/EAdh+PWpi/iT7lqdqJW2jve9a3Zi9PSfWACJHHn441dABRwwI JjrAzteBFfSCHRzg2Q6nz1Y1SwJ4B6NOB2InFvFIxa/MjbAEtGMdb7kZOlrBuorWAKIRd /tQgTql6jo/uEIjwtCy/EC/nkjpDKytpX0Vn9F8AbhgyI6JHoUBv6n3CflbeIlzIVPC36 fFxCm+rgf8D1rFReWTONeohe02JxlwV0rvw9Ptw/zHnxuyeIuPlDJ7cAbb0goshgA4A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=f0EKiv+f; arc=none smtp.remote-ip=74.125.82.181 Received: from mail-dy1-f181.google.com (mail-dy1-f181.google.com [74.125.82.181]) (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 680D4606A333 for ; Sun, 15 Nov 2026 07:13:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 680D4606A333 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=f0EKiv+f Received: by mail-dy1-f181.google.com with SMTP id 5a478bee46e88-36f8cdd30beso3116738eec.1 for ; Sat, 14 Nov 2026 23:13:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794726811; x=1795331611; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :message-id:date:in-reply-to:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=i0sztYeDoa78GRxByi5DPGRDZ13zK/I8mczcB1W5Z+o=; b=f0EKiv+f25sXRcQmBoiK+WsCsclD9PQHa+U5z3sGf3KR1sS3ZNEEroqRh6RNiac07P vGJPEugwLNmQaWqJhCPHikaN8XT33PRVwWCxE9PqkkLJA6butk39sYE2ryU8qCsIMdGI yo50td1Os6it0j1WrNa5HxnLEw4W7aO/qgSsYPJply/RpIro6UCSg0Mbr4ks/thyRkDc jq1OBKLqGUt/bM6QVBsbrIsF1mbjoO/AbvtSri1zHl8+S2Sf3KoNhgqJldsJW2yIuTc5 6FJrXgJQKS6UwdWBKS3YQ4l597qJpRKbmN+vGilzta6Rl47F1I/gy3R+i3U13Lj6DU+d z+8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794726811; x=1795331611; h=content-transfer-encoding:content-type:mime-version:references :message-id:date:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=i0sztYeDoa78GRxByi5DPGRDZ13zK/I8mczcB1W5Z+o=; b=yfTUEQTKXxwDWcJkq4Xqh0Cqltq/QOhSJhNtAZECmBO1AeQk0kE1FJt9j+PMEdqf53 e1jBYreLy/Qe2ebQVg+honP2Tl/trshWqsJNy6hQUtiK08mEiBRclFQVumFrFBwgxn+f rRPk0nfw6Li8nWR2mlC7m885z6eGDvmvIvIW1VOTKlYVYf0lLKrg/FACOUYVQGYgH8oz H1+VkCZGAis5vL/hWwyZaDBAVZ/0AdPHHD/x2Iilp18UNW+D+x6nuNtmwfrLYpe5VQP+ FtEEN7g12nDqu43avO9lMJoNwRPRBZgi9KrMmL2y0kmF9/zvOklqPW7gExmwb5VO3vRw OV3Q== X-Forwarded-Encrypted: i=1; AL+hErH0IhijJKbp3GXQgPokB6ZOoZ80EvT6yCsk++yOS74m7trVz7fyswyZTN9zwfpzQlsUwIIgxes=@vger.kernel.org X-Gm-Message-State: APuU4Z8ajLp+9VuUdIOjwKuHfi/UBn68l1X0tgERjwa15rGf5sAsAgP7 vw0j393U095QXOkxJYBUKY42+5V4sWOHRWyIW5NvgqHS1W9iKhms80ZZ X-Gm-Gg: AYBFou2p2m4xlc7tkaoCbJoHjjbXWI/eJKKvEFG7i2XhmxmbyV7rOLt5mIofwgSjbaU kqdjOXQjui0bBjEJ02lA4vRvYh6L/pYNsxSaQkyO+Et4gdnskmYTGFzqLtE1MkHJznXvw0joNWv j/p2QL70WfV9S9FVVkO98WfixadqY0fuyN2crm/CcQxXa/AJE2111hnwV1f4odrwBrl4B1YZsYT R1h9d1453Nt6nA+8dBDfv/hAXMqqtKDB7KYsVVYJWr9j5EBaS3yvN5Nd/2JfXP0UnOvmJWp38td /QiXL30IsR5ElJ53F/AECVVr4OxyNEf8NW2InsCCBqInisvQp3xxq0dh9usA1VLFoGj7zFG+ip3 Uf5jyVYCkOIYrD6YUPVFfqYxA9hBWqkQXL4HQob7pNrCbSSZflfxSzEwXZgM2oZ3OwIyxW3OGyC 9DRWCabo6p+3o9OBIzZn63wIBADJqpGz6wVh5mzDh0RkJAypcGHFlF94ec8CdkJolRYtdrlBfj2 v/NJXZ7SmpaK7X8Y3ajWDvQqmpDRhzuT/fQ+YqFVspqXu1zsTluWAY2xjTtWkC+gfNBTyeJ5hb2 Cr8MgqsTMCrD0BSU6AYdByuVH2Q= X-Received: by 2002:a05:7300:6148:b0:36a:7bb7:4609 with SMTP id 5a478bee46e88-37967dd7e1dmr11471490eec.34.1794726811302; Sat, 14 Nov 2026 23:13:31 -0800 (PST) Received: from pve-server ([49.205.216.49]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-37956bad134sm27441185eec.27.2026.11.14.23.13.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2026 23:13:30 -0800 (PST) From: Ritesh Harjani (IBM) To: Mike Rapoport , "Christophe Leroy (CS GROUP)" Cc: linux-kernel@vger.kernel.org, Alexandre Ghiti , Andrew Morton , =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Catalin Marinas , "David S. Miller" , Dinh Nguyen , Donald Dutile , Eric Chanudet , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Liviu Dudau , Luis Chamberlain , Mark Rutland , Masami Hiramatsu , Michael Ellerman , Nadav Amit , Palmer Dabbelt , Peter Zijlstra , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Rick Edgecombe , Russell King , Sam Ravnborg , Song Liu , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , Will Deacon , bpf@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, netdev@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, Madhavan Srinivasan Subject: Re: [PATCH RESEND v8 11/16] powerpc: extend execmem_params for kprobes allocations In-Reply-To: Date: Sun, 15 Nov 2026 12:33:31 +0530 Message-ID: <4idi8tks.ritesh.list@gmail.com> References: <20240505160628.2323363-1-rppt@kernel.org> <20240505160628.2323363-12-rppt@kernel.org> <3f7af771-87a7-4ae7-9919-bc4c23bd31c9@kernel.org> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mike Rapoport writes: > Hi Christophe, > > On Fri, Nov 13, 2026 at 03:36:01PM +0100, Christophe Leroy (CS GROUP) wro= te: >> Hi Mike, >>=20 >> Looks like I missed this change ... >>=20 I didn't initially get what Christophe meant here. Then I came across this reply of from him[1]. So looks like somehow between v3 to v8, something got changed?=20 On powerpc book3s/32, vmalloc space is not executable. Only modules=20 space is executable. X/NX cannot be set on a per page basis, it can onl= y=20 be set on a 256 Mbytes segment basis. See commit c49643319715 ("powerpc/32s: Only leave NX unset on segments= =20 used for modules") and 6ca055322da8 ("powerpc/32s: Use dedicated segmen= t=20 for modules with STRICT_KERNEL_RWX") and 7bee31ad8e2f ("powerpc/32s: Fi= x=20 is_module_segment() when MODULES_VADDR is defined"). So if your intention is still to have an executable kprobes, then you=20 can't use vmalloc address space. [1]: https://lore.kernel.org/all/1cb41761-29d0-5d33-b7c1-0ca3acaa810d@csgro= up.eu/ >> Le 05/05/2024 =C3=A0 18:06, Mike Rapoport a =C3=A9crit=C2=A0: >> > From: "Mike Rapoport (IBM)" >> >=20 >> > powerpc overrides kprobes::alloc_insn_page() to remove writable >> > permissions when STRICT_MODULE_RWX is on. >> >=20 >> > Add definition of EXECMEM_KRPOBES to execmem_params to allow using the >> > generic kprobes::alloc_insn_page() with the desired permissions. >> >=20 >> > As powerpc uses breakpoint instructions to inject kprobes, it does not >> > need to constrain kprobe allocations to the modules area and can use t= he >> > entire vmalloc address space. >>=20 >> Using breakpoint means the segment must still be executable. >> On book3s/32 VMALLOC segment is not executable, while module segment is. >>=20 >> See commit 6ca055322da8 ("powerpc/32s: Use dedicated segment for modules >> with STRICT_KERNEL_RWX") >>=20 >> See report and fix at https://lore.kernel.org/all/ed03d290d440d579a81ae0= b7de5243721291d903.1794543909.git.ritesh.list@gmail.com/ > > I'll take a look, thanks! >=20=20 Thanks Mike for taking a look. Sorry, I should have ccd'd you there, I guess I missed it. However, the changes are these one here [2][3] [2]: https://lore.kernel.org/linuxppc-dev/82c4973addebd82923c460cb44221f5b7= 6146afe.1794572365.git.ritesh.list@gmail.com/ [3]: https://lore.kernel.org/linuxppc-dev/f75f2cf97f44375fd2c8820e0caeab703= cdb371c.1794572365.git.ritesh.list@gmail.com/ -ritesh