Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2058955ybh; Fri, 24 Jul 2020 03:29:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnh1+XijPqXkI2W/nq+SP9frWH4F2VcoznIYVAJgWn02hqjdLi9VqA/bstCzAHKl6QyvJq X-Received: by 2002:a17:906:8489:: with SMTP id m9mr6191940ejx.94.1595586561640; Fri, 24 Jul 2020 03:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595586561; cv=none; d=google.com; s=arc-20160816; b=K/dAlkrrS6n8OW57Cgst4pSn7CGPRCTm8M7Mo0LYWs0+mo5QHvteiXGK66ONZT9Bl9 WyF21FqtTRqNkm/wXt8AkLk6tveef1UW57pZUV9eeCEcG4GCQGqSEkrEj+zVVJWgrrmC lrmjJeIDLeccN5ABIVsUUQrpBXwYLNPsOP8s1VoHA954nMw/u0WyYL4a95DYRRrO7fUO ynIWmJqnwRRghvmPtaloMimjGALOBFC4eO7YapnnqsTSCNMpjPEMnNTJqPZRATpmD0al laPGPdtM+8A0nod2AL5xoXv0mRa0qHJRmZ0Feyx74DZDpj/ggsPaVEMppLNq041seHm4 OHjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=OT5aH7xwj7gXQSSOeFH0Rj89iLlUEFImVn8Em7NIEmE=; b=N6fFzGDQEHcF6znFOf+M6ZqQAk042VxAj0qyJAZs7A0lElR96ka8FI/l6wkOqaDIV5 5gaQByK8dppPvsiz8R5s7Hih7bqQNGwghm26C3DMJV8JzCG4K6DPNOhWYIT75V5+NHlT J+0Wd1haHOoP8uhgYZwWzouPdogAud7U1MTIprZPwBUNYejRcom4v86wXhHDX1Fei0XZ HtxubOGm9c6ZPR8HHfzvNGozDZo9vu9WTOIH64VimjTvCxOPVeQ6uXRH3YBwGm4nVQkt qUoDTqNik2d7bIX2rOl1SQM+QuEDUB+2QI0W2Wn74e8V1AcAL10hTo3hHMF8F8G5Iq5v TQCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ISuPeAIl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si279245edn.287.2020.07.24.03.28.59; Fri, 24 Jul 2020 03:29:21 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ISuPeAIl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726702AbgGXK0v (ORCPT + 99 others); Fri, 24 Jul 2020 06:26:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:58582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbgGXK0v (ORCPT ); Fri, 24 Jul 2020 06:26:51 -0400 Received: from kernel.org (unknown [87.71.40.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3B46E2065C; Fri, 24 Jul 2020 10:26:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595586410; bh=rVdfRLF8yznNkp/wFEbFevU/Hg1CdRSyD1U/86auq+s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ISuPeAIlsG5DP6x+uysiGR64wgnZiwHi2/PlNEX4EJ5gZ6a2BsFtRlWen7/jtskTJ zqgCfl/IgqzipJSfqA0TnF6HXBXuCj05y2wR8foas1wGZPtTOT79Aom/l7w1yeygpI LD3rcZMAX69m9q/i8RFTqTuldH+yKRQg1n51312A= Date: Fri, 24 Jul 2020 13:26:41 +0300 From: Mike Rapoport To: Jarkko Sakkinen Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andi Kleen , Masami Hiramatsu , Peter Zijlstra , Russell King , Will Deacon , Ard Biesheuvel , Mark Rutland , Steven Rostedt , Jessica Yu , linux-arch@vger.kernel.org Subject: Re: [PATCH v5 0/6] arch/x86: kprobes: Remove MODULES dependency Message-ID: <20200724102641.GC2831654@kernel.org> 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (cc people whi particpaged in v2 disuccsion) 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 > -- Sincerely yours, Mike.