From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B188DC433E5 for ; Fri, 17 Jul 2020 03:05:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D1692070E for ; Fri, 17 Jul 2020 03:05:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727839AbgGQDFN (ORCPT ); Thu, 16 Jul 2020 23:05:13 -0400 Received: from mga03.intel.com ([134.134.136.65]:34469 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbgGQDFM (ORCPT ); Thu, 16 Jul 2020 23:05:12 -0400 IronPort-SDR: uEeyVVit1KbwV6T7ij/n6oMPPFnz14SWsZ4kmBEgm2a3L6PP3wC9dDS74kv+SkzfDe8pHITAJi uhtbMF2/dnLw== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="149517083" X-IronPort-AV: E=Sophos;i="5.75,361,1589266800"; d="scan'208";a="149517083" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 20:05:12 -0700 IronPort-SDR: bFLtGnUAwa5XPnqsnt4d75pSk3D4/7LOm3LLaVhGspktbfPaDJS7cAv12MUG07TNqWokdwL7/j WfR+CvNAN8lg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,361,1589266800"; d="scan'208";a="286687016" Received: from pgerasim-mobl1.ccr.corp.intel.com (HELO localhost) ([10.249.34.31]) by orsmga006.jf.intel.com with ESMTP; 16 Jul 2020 20:05:07 -0700 From: Jarkko Sakkinen To: linux-kernel@vger.kernel.org Cc: Jarkko Sakkinen , Andi Kleen , Masami Hiramatsu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "H. Peter Anvin" , Peter Zijlstra , Mike Rapoport , Jiri Olsa Subject: [PATCH v4 5/7] arch/x86: kprobes: Use text_alloc() in alloc_insn_page() Date: Fri, 17 Jul 2020 06:04:19 +0300 Message-Id: <20200717030422.679972-6-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200717030422.679972-1-jarkko.sakkinen@linux.intel.com> References: <20200717030422.679972-1-jarkko.sakkinen@linux.intel.com> 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 Use text_alloc() as part of the arch specific implementation for alloc_insn_page(). Cc: Andi Kleen Cc: Masami Hiramatsu Signed-off-by: Jarkko Sakkinen Im --- arch/x86/kernel/kprobes/core.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index ada39ddbc922..0f20a3e52a06 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -423,7 +423,7 @@ void *alloc_insn_page(void) { void *page; - page = module_alloc(PAGE_SIZE); + page = text_alloc(PAGE_SIZE); if (!page) return NULL; @@ -443,12 +443,6 @@ void *alloc_insn_page(void) return page; } -/* Recover page to RW mode before releasing it */ -void free_insn_page(void *page) -{ - module_memfree(page); -} - static int arch_copy_kprobe(struct kprobe *p) { struct insn insn; -- 2.25.1