Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp623ybh; Tue, 14 Jul 2020 15:59:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlG5lhxoKVSS7t7ZU714uv+/Yt5jhsNVqr/uhYer4EkbJS16JqhqpCm+sXvQqWCUmqsd3J X-Received: by 2002:a17:907:9484:: with SMTP id dm4mr6980183ejc.56.1594767593239; Tue, 14 Jul 2020 15:59:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594767593; cv=none; d=google.com; s=arc-20160816; b=SFrQRWmbGcMUkZqRgFskXHivSNFTRsNglAhWE7fIfnf70EFghH5QSaCTUQx9rjS5Xi OpmQOrQJKZJvwR2V+hGsIsvmuNKMboPMnMZJ2vSvx3+p3EH/p6a8I5D+JlGBHY+1cy37 T+uuZJBV2CKW79F7hMb9pyst2sRrRiopVhrTcU2vTxPjy/HNiTYV4tppUoTUNmDTZB82 jyAShKLvep/56WmofmUaDRtYndBsRlikwAM1B2McC6TUGxHcz/80Y79b1D+hfyhHqw88 C51vfv+yjCCgSCXukoZZkyXEUuPOGBpdEX8AaTbH0X6fm2SvsZFt0x7MCh0jWFmTQUT3 SsKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=vsgIzNNKPZ+APQVMwsnnSSSflSfbT0A+5PQPb9RryyA=; b=dYysGw0JVNe72Kb2OXM/Rg+PKkl6mn56dn1/Bk+67W7BnhsBXsD73LndNp3mdQ+Q1E pt0Fy1pyvJ3zv2ClrvHEz07k+ORYaHiJrx/PoBIpWCjPrNTKFU0GfTvm9UjsK5nNaKRV 0AewZ+ZexFQ6H51BN9HiElFnTVM3CZiKf5E7TSU3xk50RpTmMWeLWvyzjvt4pO5bjrsj yiUVOjnWTq1APpp3HLK7Pzjq9wcVY/NUTVWsy1wefzvw/dhnQ8ygOumfhyzWO2zo6am8 2yjj3b9TOePtdLnQHgxzVOcYykvk94liF2Od9lR5NrZTU3J6uk/wrvsBgbnUFDG20TK4 4vjA== 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 88si121142edr.154.2020.07.14.15.59.14; Tue, 14 Jul 2020 15:59:53 -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 S1728240AbgGNWc7 (ORCPT + 99 others); Tue, 14 Jul 2020 18:32:59 -0400 Received: from mga04.intel.com ([192.55.52.120]:16030 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726187AbgGNWc6 (ORCPT ); Tue, 14 Jul 2020 18:32:58 -0400 IronPort-SDR: 9I80EAYwOfu6kKh/k+qX2gZBbPWBhtLM6LFV4Nz+JFbmUP63LraV3zaHewylgOLvvJKu7N07Xj PuqZwIffLFIg== X-IronPort-AV: E=McAfee;i="6000,8403,9682"; a="146547481" X-IronPort-AV: E=Sophos;i="5.75,353,1589266800"; d="scan'208";a="146547481" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2020 15:32:54 -0700 IronPort-SDR: Q1zB95eOaThLhwVPy2NGGLqkvn4J8UgIcPgQJjwzOZjaMbkRL4QNjUH5qwYcGLPa0vcdiO6hPl Jazij6bo7xKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,353,1589266800"; d="scan'208";a="486037143" Received: from pipper-mobl1.ger.corp.intel.com (HELO localhost) ([10.249.46.185]) by fmsmga005.fm.intel.com with ESMTP; 14 Jul 2020 15:32:43 -0700 From: Jarkko Sakkinen To: linux-kernel@vger.kernel.org Cc: x86@vger.kernel.org, Jarkko Sakkinen , Alexandre Ghiti , Andrew Morton , Andy Lutomirski , "Aneesh Kumar K.V" , Arnd Bergmann , Babu Moger , Borislav Petkov , Brian Gerst , "H. Peter Anvin" , Jiri Kosina , Joe Lawrence , Josh Poimboeuf , Kees Cook , Krzysztof Kozlowski , live-patching@vger.kernel.org (open list:LIVE PATCHING), Marco Elver , Masahiro Yamada , Mike Rapoport , Miroslav Benes , Nayna Jain , Omar Sandoval , "Paul E. McKenney" , Peter Collingbourne , Peter Zijlstra , Sami Tolvanen , Stephen Boyd , Thomas Gleixner , Will Deacon Subject: [PATCH v3 0/3] kprobes: Remove MODULES dependency Date: Wed, 15 Jul 2020 01:32:26 +0300 Message-Id: <20200714223239.1543716-1-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove MODULES dependency and migrate from module_alloc to the new text_alloc() API Right now one has to compile LKM support only to enable kprobes. With this change applied, it is somewhat easier to create custom test kernel's with a proper debugging capabilities, thus making Linux more developer friendly. Jarkko Sakkinen (3): kprobes: Add text_alloc() and text_free() module: Add lock_modules() and unlock_modules() kprobes: Flag out CONFIG_MODULES dependent code arch/Kconfig | 2 +- arch/x86/Kconfig | 3 ++ arch/x86/kernel/Makefile | 1 + arch/x86/kernel/module.c | 49 ------------------------- arch/x86/kernel/text.c | 71 +++++++++++++++++++++++++++++++++++++ include/linux/module.h | 29 +++++++++++---- include/linux/text.h | 17 +++++++++ kernel/kprobes.c | 22 ++++++++++-- kernel/livepatch/core.c | 8 ++--- kernel/module.c | 70 ++++++++++++++++++++---------------- kernel/trace/trace_kprobe.c | 20 +++++++++-- 11 files changed, 196 insertions(+), 96 deletions(-) create mode 100644 arch/x86/kernel/text.c create mode 100644 include/linux/text.h -- 2.25.1