Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2057119ybh; Fri, 24 Jul 2020 03:26:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKU605mW+fCh5voqNKyA6YGrebEhjEJ7hL6zpBv6NfpGl5pHKBfSDvKD5Fx8Z66rPJ2AVN X-Received: by 2002:a17:906:d92e:: with SMTP id rn14mr8959924ejb.314.1595586364451; Fri, 24 Jul 2020 03:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595586364; cv=none; d=google.com; s=arc-20160816; b=D7IsKsn8hQcpCbnL1kwPH0NC9/S8GD05XcbVsOD8zve0gMgTAYgLSFxTbkRpfG51Rf ZP8UM8oeX50rpGjkzH1JG9/cNb0hUBqwTR5lq/aXlZmtWSCpMXRD7kTdT1J2HcpQBmyU KTKS55zpLmJ4QdQSE7jqgc5rBzACBdU5eXlG7o+6Fcaz4rtuupuGGL/GYVtN8PqD2sNS kLZ60Uus6l9Gs0mJsR4FsTDiNGD6pjgmqqpX5r0ud5UrGluEaXMlwYkesCDjvIGCnOwd fnyu+JQuD3xBMLjsSzfC5fzKi5bQRWHh7dRgkApshlSeaCMLdb+jNKWznU1FgHtM0K37 Do4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Gijn9XxRRsXJPWrJLEwqhSP8ja8fc1QL9YCMorHebXI=; b=MNClMrsMWRJUuGtFBWp5N5Uq00DHDHp2jePQPi/fOKjCNqJwzTGoIhJ6tlpzd0S7YY J9ITLZQ/zETb2n0Dp5ogy7pqhebl+A3bKkWvo1TliSs1qK2qlxXWYHRJNAku/Q5WRhQ2 Xf2VAn+gvSc/uBG0Y5rD6T6HpaBEwsX6zRMOzC8TiO/btvMR4mkwzUSTF3BmzM5cq68J JauJcTf5ua3X6VUB32DiNyfUZdutfHttye6nrx3L3DDDhpT0Yerr0rPBb1A1g6vWCLFc +Hrdk3KEpgvVsO/OuOf+py7S2iWK3CsNFnH7SWGHTI0r6XIq2RNvRpA9/vHUm1OmJQwP UdaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZKLPTe70; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si287600ejb.631.2020.07.24.03.25.41; Fri, 24 Jul 2020 03:26:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZKLPTe70; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726643AbgGXKWu (ORCPT + 99 others); Fri, 24 Jul 2020 06:22:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:57638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726483AbgGXKWu (ORCPT ); Fri, 24 Jul 2020 06:22:50 -0400 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.