Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp820414lqp; Sun, 14 Apr 2024 00:37:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcg9e0n1ApNLpkTA566FprUsMYZtBChMP4oiG7XgrobY0rQ7cf9HR445Zc34FIpmY/EDDaRccOnl/3JCm0WOAuMMURduiV5jjOBD/KXA== X-Google-Smtp-Source: AGHT+IGDIZNmPiTr8pu4bfsyuLxzNhrbym8x0pZjZNPZi2IBno9TdGsKCu5OG2YI855kwrnqIcGZ X-Received: by 2002:a17:906:4917:b0:a52:5925:2a31 with SMTP id b23-20020a170906491700b00a5259252a31mr719370ejq.29.1713080226300; Sun, 14 Apr 2024 00:37:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713080226; cv=pass; d=google.com; s=arc-20160816; b=srksxs91+t+wS847VRzDOZOk8//6/ix/oEYGQtOhlDULMSIVNDtd2UMh1iZ9TpdlWV ns9mXQJn+5NCqlFHGFcFpK5/7UCo/uGCHYOh04ymUY7VmHr78n9QjDCR7LYTBkCx6x1V IRLc+rl0/Pb4PaaK8MSsyYWvZvU/h2yiq/6Pny3p8GM2p597LjrMSzC6AZYZEdno4AWE D1NEoN01QJMwNPYjKXH2POWqaFGTCknGaEd6P91lV5BDnqLhMrWcEf79y+WpPbVy+GIt 0+WDlQbiFXQUMJD0NEySoDlDPfPVUb0dkETeWBtrVidxYvml758UmsG1sP5QpjHo+6oB kUPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9GAl8KEQWWDciDS+mXgmUfQFnQ5he89apNrOueKCTsE=; fh=mpPf6DMV3GsMloPTfeY6Qx91I3qG+ojvxTW2pAm6Bp0=; b=Br51EWGsVLn+XIGH+rmdCk0rY5bhYh1y0tWGQOD7rgvBJM48k6DIncQStTGDhYY6+1 D9NgStuN3KgmOR2HharKyTDwAFDWEpp7bLJDidbIapFKRn81Z+B15mUTctPqo3R1yeQy HUE1FQncX7X5Q8ZTKfXeAUGyd1ITZyD942cfSdZHcVHZb/XaI2jxlmVSJS5qdbx0iRxq F/8/XKM7d+jusZrl0kHhx9k8IZuRTiwKgxrPPlkqz3lU05DnhXOKIY8yl5P113snrKf4 uOSVbKRZvJ1zvpDa4HAVhp54qF1NxaxPPMKtOXYv9/uT3MqRHQ8p9bsguQmeFkmfV5wE kTMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pmbOtwx+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-144025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id sh40-20020a1709076ea800b00a520030ee61si3483951ejc.589.2024.04.14.00.37.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Apr 2024 00:37:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pmbOtwx+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-144025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0B5671F21453 for ; Sun, 14 Apr 2024 07:37:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD38220DFF; Sun, 14 Apr 2024 07:36:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pmbOtwx+" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D287918AEA; Sun, 14 Apr 2024 07:36:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713080216; cv=none; b=DKld9Pp49zF9Te/Svggjw8BLiGFZCOz7u0rHe2U8qj2XnDbQHkUVHehhtCUgsz8JXZ+VgAvNBOWNaPf0dUS9yw+lXrSWGWFA3V3oafYA2thwmSrVg/OEtza6mUfFrvKU6ob+mk9FlzS2/jiIgWnazny2j7vTK1g6FcANOl2JEzc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713080216; c=relaxed/simple; bh=BR4ur7se43kPXCUVLf6Y0OP7MVR1Rv+aJKN+ghbILUI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kyhNf6CF5wc2xDNZ24qXst0+eDciVjc6ncR+gJxvUiu2HYEv/CWrcH7LyIxfwsUrPFDC9S+Y/+yWOQmIBIWuauWVSKzBaQ87maGyBuarWHMsQphNOs6LkNIUFEOeQYnKAFCsBnpJq4sXLaS06SRm5kCPgQ6SuL/H5xJjEj9CcbA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pmbOtwx+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AE94C072AA; Sun, 14 Apr 2024 07:36:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713080215; bh=BR4ur7se43kPXCUVLf6Y0OP7MVR1Rv+aJKN+ghbILUI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pmbOtwx+uhP9H/utYH9BcUL2xj/Ka1KVJK6b6TlmVmh5wUN7RShrmZqV3fElednNr PLo23bk1pmangeGEqKrrJDDbzSUKdOzPxLiI6z2Iv0Oqmq0sxdrHrCLrAzh28co+BJ bbmel8ioD6s7h8xAsEjrBLYjbfLdAea51klVDqMWT34WOMNgeL1cFP32fZOxdlRVJd dArt+DeqqoJkVwora/vo+eApqnXKwkDrxmR4m2ImVxkqhTucJm4Z8bchhp91LsvSAl CS1YOGLHOkOTp2BnI7lfvt/mhQnS3DMYKllAZRqZvCg/EMbqu21/uaEQilGMpGUDUw GnSi9UsVWFWxg== Date: Sun, 14 Apr 2024 10:35:43 +0300 From: Mike Rapoport To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Andrew Morton , Andy Lutomirski , Arnd Bergmann , Catalin Marinas , Christoph Hellwig , Helge Deller , Lorenzo Stoakes , Luis Chamberlain , Mark Rutland , Masami Hiramatsu , Mathieu Desnoyers , Michael Ellerman , Palmer Dabbelt , Peter Zijlstra , Russell King , Song Liu , Steven Rostedt , Thomas Gleixner , Uladzislau Rezki , Will Deacon , bpf@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-trace-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: Re: [RFC PATCH 5/7] x86/module: perpare module loading for ROX allocations of text Message-ID: References: <20240411160526.2093408-1-rppt@kernel.org> <20240411160526.2093408-6-rppt@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Apr 12, 2024 at 11:08:00AM +0200, Ingo Molnar wrote: > > * Mike Rapoport wrote: > > > for (s = start; s < end; s++) { > > void *addr = (void *)s + *s; > > + void *wr_addr = addr + module_writable_offset(mod, addr); > > So instead of repeating this pattern in a dozen of places, why not use a > simpler method: > > void *wr_addr = module_writable_address(mod, addr); > > or so, since we have to pass 'addr' to the module code anyway. Agree. > The text patching code is pretty complex already. > > Thanks, > > Ingo -- Sincerely yours, Mike.