Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp247531rdh; Sat, 23 Sep 2023 08:41:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFfsytiGkJ61/XpGvBidkB7wF+x0VG4BdN95C6iy/NBvPnlgOM+Sqb/Gf8aSHtkOZ/pT1Ou X-Received: by 2002:a17:902:6941:b0:1c3:758d:32de with SMTP id k1-20020a170902694100b001c3758d32demr2425237plt.12.1695483717302; Sat, 23 Sep 2023 08:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695483717; cv=none; d=google.com; s=arc-20160816; b=OFXfyTSxubk3sUltJ27yYqCc2EoIBRhvZKJ7zHt86frLpSlsvfnkYT/Y/Ps652jeX4 feWwSWIqKJ/Ou1V1l9bcp+ePOo0tJHkCx0jAKkb7NrKAyetg0KsjLV7vOaRWtrnE1mXb X7wm7brkcvCAKB+kwtQwHFQ2P5ajv4GrayAwVKnKrENdWbzYoPvgyS2D5wbZE6jU87xZ 9Uhv+OKr2wNinB6XYgznVCqSAaTchS1JckXLKVw+5i+4wTgTFtNjxUJcFuUgX2/4+IVI BcD9CQI2odbqrEDPeVJOHZcwDMR7fWkfKLG6hg0cuuckOrZLQ3/k8sEd0aKJ3TcLbm5N 92kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qt+QAoQKTlG31ZR4MUI0U3JAmdt74xDeiw+evrw3oyU=; fh=LLxVw4x/YA0p2nrisYkbRBF7OIGhT8MrMihKmdCsSWw=; b=gj5MH8T9eKbbMLeIbXOwSVyPt3mPBWEfB62UpkoMiDVS3qvEewBr0gJjta2HKwbact j1kDDN6XDhEvgPakvAGU8gYS62obyrLV8eiNEHHoW/rZPWkru+UmvOws+8JOD8Z3JRJ/ TRrZZb8xNMlf3fr5SUGeAZueR0k2hyNKTmmtZx9Dj83N0pim88IxqlB6tv3dtnhhNT5h SXi9gDTRpqN0+b7vSf+b6yjBE8YS3nB1iVXZki3ZU6kjBO1FVgFQIHTttsjG3VbhFYVn EkE60qAZL6C4OW1u8+fetQwfb4rafUqovyLWoH6+htRYqiaoJKcP7s7TIc79/mQS5sWp ctpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fw2A/tcO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u16-20020a170902e81000b001c5bab14164si6635207plg.60.2023.09.23.08.41.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 08:41:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fw2A/tcO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id E62CC85BE6E4; Sat, 23 Sep 2023 08:39:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231923AbjIWPjL (ORCPT + 99 others); Sat, 23 Sep 2023 11:39:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjIWPjK (ORCPT ); Sat, 23 Sep 2023 11:39:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51EE8100; Sat, 23 Sep 2023 08:39:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2139BC433C8; Sat, 23 Sep 2023 15:38:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695483543; bh=44aW6DcKJaHGXelf02UJMtFK5RbIa4QmGjb00e/7p/A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fw2A/tcOcobQiglJay8dvPT5bEfVdzbbmq0FwMYYkRDEvMMNze6l5vdxXC61b2ule JFCwMCsxrAuMW6D9gVnh2enWSeUtDeXGmVEjWBDuVv9KbPW1MRt9tzybn9NNKJQMj2 y3Lc/W+nmmCK2KsTrqRVvz29GuwFbt1mGULYw6jBfPPwRcYXpuSga9okI5ya4zHkUD tynDeAbBph8ozw0L4VOesv/AFGSBeSrp7QqXSV98fLRWfSHzHFilN6nNqox4/XsFqb GBdnrmPrEZw+uXG8gLcDpColobXRcu9WsCK8bgQKX9ms+oqH3fV0ph2eOZh795NWNU moLZ9gWnlnDaA== Date: Sat, 23 Sep 2023 18:38:08 +0300 From: Mike Rapoport To: Song Liu Cc: linux-kernel@vger.kernel.org, Andrew Morton , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , 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 Subject: Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free() Message-ID: <20230923153808.GI3303@kernel.org> References: <20230918072955.2507221-1-rppt@kernel.org> <20230918072955.2507221-3-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 23 Sep 2023 08:39:08 -0700 (PDT) On Thu, Sep 21, 2023 at 03:34:18PM -0700, Song Liu wrote: > On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > > > > [...] > > > 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(struct module *me, > > > > size = FTRACE_HOTPATCH_TRAMPOLINES_SIZE(s->sh_size); > > numpages = DIV_ROUND_UP(size, PAGE_SIZE); > > - start = module_alloc(numpages * PAGE_SIZE); > > + start = execmem_text_alloc(EXECMEM_FTRACE, numpages * PAGE_SIZE); > > This should be EXECMEM_MODULE_TEXT? This is an ftrace trampoline, so I think it should be FTRACE type of allocation. > Thanks, > Song > > > if (!start) > > return -ENOMEM; > > set_memory_rox((unsigned long)start, numpages); > [...] -- Sincerely yours, Mike.