Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp737895ybh; Sun, 12 Jul 2020 22:55:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMpSuxlJ3neQeA0JwWXKzI1RBz4+liUCn0So/POeIZrc9+cM/yODwI3eY4M0IynX3ymACL X-Received: by 2002:a17:906:38d6:: with SMTP id r22mr70493396ejd.219.1594619743454; Sun, 12 Jul 2020 22:55:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594619743; cv=none; d=google.com; s=arc-20160816; b=emCTBAEO09UU8gJj4ZS55BPIkrLIPq8B4wrkYfwRwjFeCkNB1K1zuMck7gT07FufV/ 3S6xdUe/YYHIW6t4rjxRc5FiIr219x+X4KZnFbZp/yM2llKNkh40a+zHsM7SKQbZGd3L mPYhQU7H9n2fnOKUmU7eP1b3pAprDxr+5ogYOxS2o36XEsJ9YW1BmP8TSzpQW3NXQMFN UgFj2c4i8m2kh/xdAnWluQxCSRog84EotnC64zJWd42kOyI3SMfHTbZu8S8qGe8iDkvX N4JB8ocu6iqD6opcYNE3QDAaW0KtPT0WfOqlxlnKgQyrxhOxAUx96151BF2GH9BeWZwL 6uVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=ijqXh9EONrCLbYKev/Zi9ntf2yY/FbOtRINM9zV5jto=; b=uxyRkSAUrihINDkbzIrjh+bhBME1NkCGVFzT7e/gtfLmCCgvznvjS9QKlaogATZGd1 b9lyqId/gGS0awSz+uRmSSWMwImeDEZ1rjZD+oGQFIT3ZecgXxvjVE+uWRTffkIOGG8m o982BRGq+nfUDTUORQQ0zt7l7uSe1MebwByR2ZnvbxyJB+YsMwVKNvdI1HoZgVyNbKxe BoBPo3Ts9RlDT1YySe8udwZllMBm66O+hXAvTbmvoGZCT/XEwS4rtqAQL0f6imADnh35 qOrdPL1/fO1q1vWYTWB5KZMte2KTVHH14TC6RPwqnv4KfITK1DEbTQAbqLWJHQtX1+LG 6j8g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si8821114edz.443.2020.07.12.22.55.21; Sun, 12 Jul 2020 22:55:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728866AbgGMFwy (ORCPT + 99 others); Mon, 13 Jul 2020 01:52:54 -0400 Received: from mga07.intel.com ([134.134.136.100]:29760 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbgGMFwx (ORCPT ); Mon, 13 Jul 2020 01:52:53 -0400 IronPort-SDR: Wr+Wj6Y0ocSbIR9yAO92WNuh/YGLbyobEvHDXiG1ZexwGov45LOfcQQmE2Q2a1bCQ5XDZg/i0L Z2c/F8ybzlRw== X-IronPort-AV: E=McAfee;i="6000,8403,9680"; a="213401065" X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="213401065" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2020 22:52:53 -0700 IronPort-SDR: 3NBT5Xwb6SEKRo45jGptQA52qwK8aymWmWJkzOuVO7mj+KHu+sIDPD98SAV3q69rlVSl8og9gI Y6u8Hiyq+EZg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="307334400" Received: from lgrunert-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.52.195]) by fmsmga004.fm.intel.com with ESMTP; 12 Jul 2020 22:52:41 -0700 Date: Mon, 13 Jul 2020 08:52:40 +0300 From: Jarkko Sakkinen To: Christoph Hellwig Cc: Peter Zijlstra , Masami Hiramatsu , 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 Subject: Re: [PATCH RFC] kprobes: Remove MODULES dependency Message-ID: <20200713055240.GD956284@linux.intel.com> References: <20200709234521.194005-1-jarkko.sakkinen@linux.intel.com> <20200710193257.4eeb19e9cd042d99cbca7f9a@kernel.org> <20200710113238.GH4800@hirez.programming.kicks-ass.net> <20200710130429.GA8619@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200710130429.GA8619@lst.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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 03:04:29PM +0200, Christoph Hellwig wrote: > 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. Given that they are simple wrappers, would it be too much harmo to have inline functions for text_alloc() and text_memfree() and use them inside module_alloc() and alloc_memfree() in order not to initially turn things over too much? /Jarkko