Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3077171rwd; Fri, 16 Jun 2023 11:53:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Tj1UQE4uQS/hOw74IDXESpeAV/1iRXwarodoAp+tTgEfOlWTQlMt3EiDj+6g2P5YMTpjM X-Received: by 2002:a17:90a:7b83:b0:25e:8fd9:8dc with SMTP id z3-20020a17090a7b8300b0025e8fd908dcmr2019980pjc.42.1686941627868; Fri, 16 Jun 2023 11:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686941627; cv=none; d=google.com; s=arc-20160816; b=kIh1PbXFm16hu8o+0T1O3X+PwCM2GuedWu7tlq8pUrw30g5TYudcQcRuWvJ7mHjdr/ 1+GaSE6vTbyRjHJ8hbTGgNZdhVQAWrOTXMg0ir4aebtlaYw5QzODZrYpcxfwfQl98EwM 19d4bI+eZwQdugfSBEE9mdQ/s9sFYelakfTkfrSqx7m6mgQui0fW+c3KFpNQTBJyT1ew ED/5z16+46/IdOE5OGmK8VWzyecuTI5JFmcrPHuCe8NkD2nbANBZjXsRVPSseRvG0qQt t+czgPGUGBX4LClaWmwd0TghW2fY6UqhGkSTURg/QQYBNHOkoZdSkFhQFINU1szB3sp7 2bsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=JGylOLwsDlnOC/7zFFXP8rSDvCyOTlCYNV6rWd4f8mw=; b=j/Mz32fBG9waKzSI5sNoe4W0SA16+g/5e5in4Coa7D6VA6f0WRn/DvvJ/Ax58Gm7fE 9YHcxxycxPZpXLPKOMooEPpGwe5pEQkwGDi9HA6JV0rGMvFuA/5XP0g701iDYYEhycIG 4q/5XfBhvVwAKLoCmpXhsd7kDubZ2pbApay5/JIvtedLYNBM/tIHvxmjdpYyZauUferI VO2uf/nSm+tp4X9DgdIDriGkHZZkWmEg26UYzJ9xsxHv77chNrur76lQJW+2PQCYtgwA i8aD2bYaaF6SL5FYfQ1zbO4R9XfG2cUR8Dx/hqEbZz3b2ia2Et075j5G6oemYLmvnonl nsxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="SeXeGZ/w"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v16-20020a63d550000000b0053084a794f0si15489061pgi.290.2023.06.16.11.53.34; Fri, 16 Jun 2023 11:53:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="SeXeGZ/w"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343977AbjFPSgt (ORCPT + 99 others); Fri, 16 Jun 2023 14:36:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjFPSgs (ORCPT ); Fri, 16 Jun 2023 14:36:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 791482119; Fri, 16 Jun 2023 11:36:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 141D7623F0; Fri, 16 Jun 2023 18:36:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71A86C433C9; Fri, 16 Jun 2023 18:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686940606; bh=JGylOLwsDlnOC/7zFFXP8rSDvCyOTlCYNV6rWd4f8mw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SeXeGZ/w86KmlurMiVm4UIF69ZGzlkmxJdFe2QmV6PX8IW+hDhUbuFBav3t/B8pWZ vEzDIgk/zKEW5stVwEtyb8WYKsD74Cn5N7O03rsyRz3LX2xGotPEbMmsM7IV3g9Dxd h5Uh6GrvB3LrnxzUUDOGdAi+YQl7sfLX58PmPPi1I/7ju04tDqO1xvj3P1oQrQvlEn mq1rf5Tcp0oheWCmaw6RaW+tUKVhYkG7a6qCHK2MLKMhdZ/TjBbzmfPfgUfEdkhdA/ QK30NJOharxczGBPm79t0v2LgrZqJ5TBlW/fXRzSrlgo6PvG8f6QCwr2oWnE+7+dKS y4wFdRFTvaw9Q== Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-4f84d70bf96so1327926e87.0; Fri, 16 Jun 2023 11:36:46 -0700 (PDT) X-Gm-Message-State: AC+VfDzfimA42RcpSaF9PTQlk2nNIJUxkYTv66oTFHA3L8Ny/CEgE78U bF83XCPAbg+H9PPaws+Kf354lKxf0BwZ8HemavA= X-Received: by 2002:a19:7913:0:b0:4f3:aa81:2a6e with SMTP id u19-20020a197913000000b004f3aa812a6emr797084lfc.19.1686940604495; Fri, 16 Jun 2023 11:36:44 -0700 (PDT) MIME-Version: 1.0 References: <20230616085038.4121892-1-rppt@kernel.org> <20230616085038.4121892-4-rppt@kernel.org> In-Reply-To: <20230616085038.4121892-4-rppt@kernel.org> From: Song Liu Date: Fri, 16 Jun 2023 11:36:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 03/12] mm/execmem, arch: convert simple overrides of module_alloc to execmem To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Andrew Morton , Catalin Marinas , Christophe Leroy , "David S. Miller" , Dinh Nguyen , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Luis Chamberlain , Mark Rutland , Michael Ellerman , Nadav Amit , "Naveen N. Rao" , Palmer Dabbelt , Puranjay Mohan , Rick Edgecombe , Russell King , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , Will Deacon , bpf@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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 16, 2023 at 1:51=E2=80=AFAM Mike Rapoport wro= te: > > From: "Mike Rapoport (IBM)" > > Several architectures override module_alloc() only to define address > range for code allocations different than VMALLOC address space. > > Provide a generic implementation in execmem that uses the parameters > for address space ranges, required alignment and page protections > provided by architectures. > > The architecures must fill execmem_params structure and implement > execmem_arch_params() that returns a pointer to that structure. This > way the execmem initialization won't be called from every architecure, > but rather from a central place, namely initialization of the core > memory management. > > The execmem provides execmem_text_alloc() API that wraps > __vmalloc_node_range() with the parameters defined by the architecures. > If an architeture does not implement execmem_arch_params(), > execmem_text_alloc() will fall back to module_alloc(). > > The name execmem_text_alloc() emphasizes that the allocated memory is > for executable code, the allocations of the associated data, like data > sections of a module will use execmem_data_alloc() interface that will > be added later. > > Signed-off-by: Mike Rapoport (IBM) Acked-by: Song Liu