Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp524923ybt; Fri, 10 Jul 2020 06:08:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIn3yAQ3wzx6Euf5C28FDnc/IhzlKC2YS3Ff6hbdtTW9Vlvk+sAObOHiTxFqnPQFWkh6lE X-Received: by 2002:a50:afa2:: with SMTP id h31mr24499549edd.303.1594386483792; Fri, 10 Jul 2020 06:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594386483; cv=none; d=google.com; s=arc-20160816; b=wHygSuaY2AgJU4EClFcuEnBXhYTV3XC5O8f0Yo6oE679Oys3vyFDEApOmm/L8aJZPw MOk9jJZaaufhCJXfZdSDol+enxoTJaeSoO4+z38cIr0+BHoL0jr3L8oLoM4FiA8FCIB7 rTcqNxJt+LcvQNlveUUHmtnvIP8rSIyVsKrCikVdLQ7W2SRbkBIBqmjlNyD7t30yeovq ZFeBIqn3tQAJenoZQmnF0GvmHN27fW8m1G/NL/2Fe3O+p8ytLZ3XzLn0fZEGBe4NMBP7 6FB+REbuuh1G2Mj0/v0vTcqUz1srTTly/5AZgLspPzMEnMhirjxajpf9L27nKc1TxC27 MQZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WbvAc/1MWfWZnZOOm0N+7GjoPyj/Te9SxIDTGJKW2NM=; b=HAfW2Vs/UwcK6pLYa0l+jaOKgQl30mscABhrFF2+/tJgpmFbhJh1qsCk8DD4ePRrEp UTBOFYzzLQtmSePa+z1B95Ug+nI2ith8rJDwOQQ3SUpAx0eCoR6b9pMHIgXD3GQOb+md CjiPB/dCuoB9PwpDaWJEaoneGjVpA2w0GZQwc6QSylSiWN3wIFOwFPCqhYcUNgrQS2lE +OmrQ0/o9FCwY2fgQago0c6pabc6YXPEIpHnjaJZM+rxskOQuyKrSrzrgtlHy28Y9Cwq QI3hDa0WFV2AiC+iTofQDHd0He/ghm/LuYPXrZy2GY5lZk/sfiTGBrHxM6bacHH+Zwtj SQtA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a19si4009366edy.575.2020.07.10.06.07.40; Fri, 10 Jul 2020 06:08:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726962AbgGJNEj (ORCPT + 99 others); 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.