Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1949985ybh; Fri, 24 Jul 2020 00:04:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAYfUpKj4Z9v++cA13NFfLUhmN9Hlc2Tu7nrXglxWGLZ2wbQkyOEtDAq/PXAL0fMTRgj9o X-Received: by 2002:a17:906:538e:: with SMTP id g14mr7866644ejo.300.1595574291542; Fri, 24 Jul 2020 00:04:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595574291; cv=none; d=google.com; s=arc-20160816; b=eTneS8HDYdigYwFpfRcBMIcVWAHNVtopMs5GLDRV11CTksO2vjT7uPLKdvPCo5UT0I Nm4owyxj8bSC8a0FU/wEeLeHnlHyBP+PCVByO9cRgoSMa4JC8HUUu3tw5gokatMiEJ0d 1P536cB07C3sAGIjRnbHyYw1/UT0FAqGg/aI1qigcUHzgHFBc6HaeHdQ78TwsmSRgcmt MpD/22pyIQLTRkcoNTaEV1PMQtcItfAihsNSoSHMdOG1A5ivSQNHA1pEovipcIrsnT/T Hbx8yASh5I+/wf8xQNhuHuvptFn23Wfy0/HoFtGWunigkKCcNIAjlANBcoAokkflsDf+ lXhg== 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=2JRJAaP95cesJ+cxCq/ql5RZB8jmVcx4JPE1looXugI=; b=Ex8cMujJVSv1yrSfD6hXhh1LF6nYPmzF8rKo0zCk85SYmdzV3s8kXLBVIiuHCh6TbT wBg3zVzt6xM3KbhNJcd9Sz6wkp4IhGiEy5OCR/Zh8K7WAFDw9DppoEN41nYERIOQL3uR /fg46KQrwqWi4bhnh5VwovPyFpyF8bgCzhwzWliel92VI3nYmErFTIbCpIOPDnwgVcG6 fhC66kJ6Mh7YeBvDNfYFANzoqrbFf9ORwBdTgTneusCzqf6/Q4eY2tzJR5V/TmMdVJ08 Vof3JkSeJLW5qs8FiUPSWyODDpGMnZTOfcZMSxR8RX/xuOE5jxHs5VP1Wnkn0ZANx6af I7FQ== 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 i22si58660eja.516.2020.07.24.00.04.29; Fri, 24 Jul 2020 00:04:51 -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 S1726990AbgGXHBW (ORCPT + 99 others); Fri, 24 Jul 2020 03:01:22 -0400 Received: from mga03.intel.com ([134.134.136.65]:50659 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726503AbgGXHBV (ORCPT ); Fri, 24 Jul 2020 03:01:21 -0400 IronPort-SDR: pFbzpoJiBnbDzraEPMyvnqH2OFySzKHeW2Wfv2VrA/mKFYXexUVGiejZuQ20ZGlKY4aeTwEUxb ztCdHjmvpRCQ== X-IronPort-AV: E=McAfee;i="6000,8403,9691"; a="150653763" X-IronPort-AV: E=Sophos;i="5.75,389,1589266800"; d="scan'208";a="150653763" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2020 00:01:21 -0700 IronPort-SDR: B2ZkeVsNbC1TL2UgERXWT+X+mLWOrsf2xDSTHXBt3soZPstyH/CXEcPindDaacqcnldLUK9Ohs LSQJcxn/K02A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,389,1589266800"; d="scan'208";a="284845692" Received: from cbuerkle-mobl1.ger.corp.intel.com (HELO localhost) ([10.249.36.184]) by orsmga003.jf.intel.com with ESMTP; 24 Jul 2020 00:01:18 -0700 Date: Fri, 24 Jul 2020 10:01:16 +0300 From: Jarkko Sakkinen To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Andi Kleen , Masami Hiramatsu , Peter Zijlstra Subject: Re: [PATCH v5 0/6] arch/x86: kprobes: Remove MODULES dependency Message-ID: <20200724070116.GA1872085@linux.intel.com> References: <20200724050553.1724168-1-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200724050553.1724168-1-jarkko.sakkinen@linux.intel.com> 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 24, 2020 at 08:05:47AM +0300, Jarkko Sakkinen wrote: > Remove MODULES dependency by migrating from module_alloc() to the new > text_alloc() API. Essentially these changes provide preliminaries for > allowing to compile a static kernel with a proper tracing support. > > The same API can be used later on in other sites that allocate space for > trampolines, and trivially scaled to other arch's. An arch can inform > with CONFIG_ARCH_HAS_TEXT_ALLOC that it's providing implementation for > text_alloc(). > > Cc: linux-mm@kvack.org > Cc: Andi Kleen > Cc: Masami Hiramatsu > Cc: Peter Zijlstra > > v4: > * Squash lock_modules() patches into one. > * Remove fallback versions of text_alloc() and text_free(). Instead, use > ARCH_HAS_TEXT_ALLOC at site when required. > * Use lockdep_assert_irqs_enabled() in text_free() instead of > WARN_ON(in_interrupt()). > > v3: > * Make text_alloc() API disjoint. > * Remove all the possible extra clutter not absolutely required and > split into more logical pieces. > > Jarkko Sakkinen (6): > kprobes: Remove dependency to the module_mutex > vmalloc: Add text_alloc() and text_free() > arch/x86: Implement text_alloc() and text_free() > arch/x86: kprobes: Use text_alloc() and text_free() > kprobes: Use text_alloc() and text_free() > kprobes: Remove CONFIG_MODULES dependency > > arch/Kconfig | 2 +- > arch/x86/Kconfig | 3 ++ > arch/x86/kernel/Makefile | 1 + > arch/x86/kernel/kprobes/core.c | 4 +-- > arch/x86/kernel/text_alloc.c | 41 +++++++++++++++++++++++ > include/linux/module.h | 32 ++++++++++++++---- > include/linux/vmalloc.h | 17 ++++++++++ > kernel/kprobes.c | 61 +++++++++++++++++++++++----------- > kernel/trace/trace_kprobe.c | 20 ++++++++--- > 9 files changed, 147 insertions(+), 34 deletions(-) > create mode 100644 arch/x86/kernel/text_alloc.c > > -- > 2.25.1 > Duplicates were caused by Internet connection breaking up in the middle. Apologies. /Jarkko