Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2353772rdb; Thu, 21 Sep 2023 16:43:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGS8Qzf/52zR1eyMmvHuIWaknomLqFpEznQC8AOJ8ryODIzqpaC3nTvzOgKzbL0xpId2by/ X-Received: by 2002:a17:903:2303:b0:1bb:d7d4:e2b with SMTP id d3-20020a170903230300b001bbd7d40e2bmr7045976plh.0.1695339825403; Thu, 21 Sep 2023 16:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695339825; cv=none; d=google.com; s=arc-20160816; b=d6d1EZIAZkkWlnagoySJMy9I6YzNErV9rFdbJBut0MjGpuKgprq790Y4pzyUO0wVxs /nX1LmMFvUciVDd//2jVJ+y0qTy1fWcqZb9+gp8Bv7220fRQloP08N08E5ElAdUOplzn FdvIz1F4CfgjVqvOaRA+TObT3ttEoJc39XQAh3SFVcztyILLZorSCJze+Qyujs20lQHr +49VmDJo6F9xPWT44Qm8os++KF5EBQ+lBVkO0yE0K1Ed8CYEs58MnhPDJbA8/6DA2yXI sgpnrAP+CQ/aSUDUJEBVpbHltvK1wGrEvCW6DrZWtXfBICVAxfdOOO4jr44TJVLIPB1f 5RiQ== 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=BYmc+5Z1d3gETvzBA6uUCzub3QPVVnay5rzsMEs5J6k=; fh=nux99dLKaQZPtWtkuy2/AW/ozv3Qzao1Xyv3eoLFGu0=; b=txiNAtAd68MD5nlDWxL/fGRr0D1kl0+7HZ6UmR3OB52PAiFmAdtQBXoMKIhA2zV4F0 YrVsDhMreNpbDEPVCnOKPt/o2iteXxVCQYek9Rw7d4A0uwCzxedHGdyXpX1rL9dF+EPG t8iszR3Jg+DA/rkyGr4XDHUQTbRCKmpyniEh1UcYS4jluroaXhYBby1lPJJhpb1L1mrN /MOMTF2IWc7UwjrJth/v9r69xHH6thXO4QdLkSEz9fkz5UdSLgS+cxOf5Cpk+yqyt+gP 2x4XeV3/FL885KQcH3iqw/lhD2xTSrQ7xZn9IsqztAb9evUgUm+ViQehthXtEUD57en8 6lmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mfa0wr7Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id q15-20020a17090311cf00b001b7ecbbaa13si2754870plh.152.2023.09.21.16.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 16:43:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mfa0wr7Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 01DA083337CB; Thu, 21 Sep 2023 15:35:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230322AbjIUWex (ORCPT + 99 others); Thu, 21 Sep 2023 18:34:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbjIUWei (ORCPT ); Thu, 21 Sep 2023 18:34:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DC9E91; Thu, 21 Sep 2023 15:34:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B96F8C433B7; Thu, 21 Sep 2023 22:34:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695335672; bh=fncpICFIZJhs+CFipAysf+2ViMsb5Ntfqci2xnszhTI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mfa0wr7Z0lJ3IA4HjAqOtrk9SSrWWB+YGbaJc16KYeVVOnawrEHs3dy+iDauvghvS XAHLDo1Oga4nzW8Yi1caKnTTFJMqd7AtLKV54l/hFjnIDnOa7YaUJG8OwSNQt6PDO1 7A+xKgOCxHubIbnNN8HZ22TUVPtwpthTbmR6DHRJsZoaCg1nFEuNlqOAO63MKUXx9I SVjAKnxkUVKeWQXgqE8UM2tHBIJCB/eo8eJdbedgXyDGRo4W6Xudl4FTLuPEDPrLWB k28dHj46DhheR/Wrwnz4X+g5x8ZjJWpuI68P2lkJi7EwbKR/MM3KSc5SviEdI3D0pl RSPtrB9bT5Klg== Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-502b1bbe5c3so2475989e87.1; Thu, 21 Sep 2023 15:34:32 -0700 (PDT) X-Gm-Message-State: AOJu0YxkPH9yPeEzUjolYs2nLgmIYm5KeOqZ5uYnB5mOKuU+CKwC7sG8 LVNp9039AwQpDHQGRruHF22jJea51vSNxJYxToc= X-Received: by 2002:a19:6445:0:b0:503:3446:8ef5 with SMTP id b5-20020a196445000000b0050334468ef5mr4362567lfj.10.1695335670837; Thu, 21 Sep 2023 15:34:30 -0700 (PDT) MIME-Version: 1.0 References: <20230918072955.2507221-1-rppt@kernel.org> <20230918072955.2507221-3-rppt@kernel.org> In-Reply-To: <20230918072955.2507221-3-rppt@kernel.org> From: Song Liu Date: Thu, 21 Sep 2023 15:34:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free() To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Andrew Morton , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , 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=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 21 Sep 2023 15:35:05 -0700 (PDT) On Mon, Sep 18, 2023 at 12:30=E2=80=AFAM Mike Rapoport wr= ote: > [...] > diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c > index 42215f9404af..db5561d0c233 100644 > --- a/arch/s390/kernel/module.c > +++ b/arch/s390/kernel/module.c > @@ -21,6 +21,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -76,7 +77,7 @@ void *module_alloc(unsigned long size) > #ifdef CONFIG_FUNCTION_TRACER > void module_arch_cleanup(struct module *mod) > { > - module_memfree(mod->arch.trampolines_start); > + execmem_free(mod->arch.trampolines_start); > } > #endif > > @@ -510,7 +511,7 @@ static int module_alloc_ftrace_hotpatch_trampolines(s= truct module *me, > > size =3D FTRACE_HOTPATCH_TRAMPOLINES_SIZE(s->sh_size); > numpages =3D DIV_ROUND_UP(size, PAGE_SIZE); > - start =3D module_alloc(numpages * PAGE_SIZE); > + start =3D execmem_text_alloc(EXECMEM_FTRACE, numpages * PAGE_SIZE= ); This should be EXECMEM_MODULE_TEXT? Thanks, Song > if (!start) > return -ENOMEM; > set_memory_rox((unsigned long)start, numpages); [...]