From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8FD4C433E3 for ; Fri, 24 Jul 2020 10:22:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7EFF52065C for ; Fri, 24 Jul 2020 10:22:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZKLPTe70" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EFF52065C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E14B18D0020; Fri, 24 Jul 2020 06:22:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D9D8F6B0036; Fri, 24 Jul 2020 06:22:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C3E988D0020; Fri, 24 Jul 2020 06:22:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0104.hostedemail.com [216.40.44.104]) by kanga.kvack.org (Postfix) with ESMTP id A9A066B0033 for ; Fri, 24 Jul 2020 06:22:51 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 620F18248076 for ; Fri, 24 Jul 2020 10:22:51 +0000 (UTC) X-FDA: 77072580942.19.pump71_16050a726f46 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 3B0E91A55A for ; Fri, 24 Jul 2020 10:22:51 +0000 (UTC) X-HE-Tag: pump71_16050a726f46 X-Filterd-Recvd-Size: 3479 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Fri, 24 Jul 2020 10:22:50 +0000 (UTC) Received: from kernel.org (unknown [87.71.40.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 85B212065C; Fri, 24 Jul 2020 10:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595586170; bh=UvxGq6yX6XuuylfuSDP/iXKMmYlEzY1kzhP4GwXlgVg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZKLPTe70/iq4UW4IJk8j7elpMr31458tZGyatUwi1KDyMq2meB2t/me1S8bgupPHD zSTgOW6xXP8dh6/A9Tgqec3jI5YC7LzyzItuia0ouAcePbAYivmWFBuBhVvv4tvpqI STctW7cGEeq3u2sl+5kvCVPV0OubAxwP1WquJ00Y= Date: Fri, 24 Jul 2020 13:22:43 +0300 From: Mike Rapoport To: Jarkko Sakkinen Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andi Kleen , Masami Hiramatsu , Peter Zijlstra , Andrew Morton Subject: Re: [PATCH v5 2/6] vmalloc: Add text_alloc() and text_free() Message-ID: <20200724102243.GA2831654@kernel.org> References: <20200724050553.1724168-1-jarkko.sakkinen@linux.intel.com> <20200724050553.1724168-3-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200724050553.1724168-3-jarkko.sakkinen@linux.intel.com> X-Rspamd-Queue-Id: 3B0E91A55A X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jul 24, 2020 at 08:05:49AM +0300, Jarkko Sakkinen wrote: > Introduce functions for allocating memory for dynamic trampolines, such > as kprobes. An arch can promote the availability of these functions with > CONFIG_ARCH_HAS_TEXT_ALLOC. As it was pointed out at the discussion on the previous version [1], text_alloc() alone won't necessarily suit other architectures. I don't see a point in defining a "generic" interface that apriory could not be imeplemented by several architectures. [1] https://lore.kernel.org/lkml/20200714094625.1443261-1-jarkko.sakkinen@linux.intel.com/ > Cc: linux-mm@kvack.org > Cc: Andi Kleen > Cc: Masami Hiramatsu > Suggested-by: Peter Zijlstra > Signed-off-by: Jarkko Sakkinen > --- > include/linux/vmalloc.h | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h > index 0221f852a7e1..6c151a0ac02a 100644 > --- a/include/linux/vmalloc.h > +++ b/include/linux/vmalloc.h > @@ -249,4 +249,21 @@ pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms) > int register_vmap_purge_notifier(struct notifier_block *nb); > int unregister_vmap_purge_notifier(struct notifier_block *nb); > > +/* > + * These functions can be optionally implemented by an arch in order to > + * provide specialized functions for allocating trampoline code. > + */ > + > +#ifdef CONFIG_ARCH_HAS_TEXT_ALLOC > +/* > + * Allocate memory to be used for trampoline code. > + */ > +void *text_alloc(unsigned long size); > + > +/* > + * Free memory returned from text_alloc(). > + */ > +void text_free(void *region); > +#endif /* CONFIG_ARCH_HAS_TEXT_ALLOC */ > + > #endif /* _LINUX_VMALLOC_H */ > -- > 2.25.1 > -- Sincerely yours, Mike.