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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 1F255C433DF for ; Fri, 10 Jul 2020 13:04:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04CAA20720 for ; Fri, 10 Jul 2020 13:04:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727038AbgGJNEj (ORCPT ); Fri, 10 Jul 2020 09:04:39 -0400 Received: from verein.lst.de ([213.95.11.211]:43233 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726828AbgGJNEi (ORCPT ); Fri, 10 Jul 2020 09:04:38 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 99CC968AEF; Fri, 10 Jul 2020 15:04:30 +0200 (CEST) Date: Fri, 10 Jul 2020 15:04:29 +0200 From: Christoph Hellwig To: Peter Zijlstra Cc: Masami Hiramatsu , Jarkko Sakkinen , linux-kernel@vger.kernel.org, Andi Kleen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , "Naveen N. Rao" , Anil S Keshavamurthy , "David S. Miller" , Steven Rostedt , Andrew Morton , "Aneesh Kumar K.V" , Will Deacon , Kees Cook , Arnd Bergmann , Alexandre Ghiti , Masahiro Yamada , Sami Tolvanen , Peter Collingbourne , Krzysztof Kozlowski , Frederic Weisbecker , Stephen Boyd , Alexei Starovoitov , Mike Rapoport , Sean Christopherson , Jiri Olsa , hch@lst.de Subject: Re: [PATCH RFC] kprobes: Remove MODULES dependency Message-ID: <20200710130429.GA8619@lst.de> References: <20200709234521.194005-1-jarkko.sakkinen@linux.intel.com> <20200710193257.4eeb19e9cd042d99cbca7f9a@kernel.org> <20200710113238.GH4800@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200710113238.GH4800@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 10, 2020 at 01:32:38PM +0200, Peter Zijlstra wrote: > On Fri, Jul 10, 2020 at 07:32:57PM +0900, Masami Hiramatsu wrote: > > > - page = module_alloc(PAGE_SIZE); > > > + page = vmalloc(PAGE_SIZE); > > > > No, you can not use vmalloc here. The reason why we use module_alloc() > > is to allocate the executable memory for trampoline code. > > So, you need to use vmalloc_exec() instead. > > vmalloc_exec() would be broken too, also hch recently got rid of that > thing. > > module_alloc() really is the only sane choice here. > > We should make module_alloc() unconditionally available, and maybe even > rename it to text_alloc(). I think unconitionally might be a bit too much, but for MODULES || KRPOBES or a new symbol select by them makes sense. As does the rename.