Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1891401ybh; Thu, 23 Jul 2020 22:07:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxrqsGWK2y1tXTVobrF3yAOmZZbEq8OTHtyIeAbBZ+e7F/13RykWaZraUMXwR+hN5MIFTP X-Received: by 2002:a17:906:4f0f:: with SMTP id t15mr1772058eju.337.1595567263785; Thu, 23 Jul 2020 22:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595567263; cv=none; d=google.com; s=arc-20160816; b=DCUMMWEoWNsNGDhWceZGzXrPfPVxqJjabrfUNnl1vJ5dFNQjnX7l/l6hxhJSSmgoLG qpv5aTXb6a4h8OhtmSndyG8QpWrZ8/4xjjbXdwVELYjmxN6u8B9ATIBGuD25QY0OgShO V6F+Rx6KysUXZCh4qUb86RDqwbFZ75/pfrkcBEcqrdQsxNMHwCFU4qDVlh87SWOM9zdS 88/fZMNzUBlg8T+0bPLhraqH3+uZzFUtZTkYfmIOpOGi1ee0zrMYVEox2jt3QTeoRxRK 8DEiGorjSQXE/zCjFNxOaaZzay3vu1xrLBdksEx3qjxoPubmHN+/J9jWAN4V6XEesp0E BrLA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=76gE4bnoWfB600W1BmKfJWckF5q9S80f2YMvsYuPrps=; b=XzvyJ5YVU0RNIA5oxuKCTsOjhxeRS3NSr9G+2wEUHMQ6QhhuP17gcbY8zN4EclNBsv hQsDl//F2s+f31Ko8sBOzT5VA79AM/AxG8C967bf1VufK93qVGvr07drjPPHwuEEIjRo jFWkNjP75QwyBozISfRgc4BTT1/hBOYnfLhXw0zaf9ZpP6xFampAPDb4mo2TzNdPAnQs +SU8fMPQ5bbujD7jQsRU4zG37FgaZAleHvW7xssaElFO/Vh3xP1z6fnHXFbTFUhIRXuq sEonKUGE6vO28s+iChW9Cmp9Zq2X5zKksnAVsRrPL11YPqei5cSHJvGyyxNc+aFG5yIW ZnMw== 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 l10si3122562ejh.673.2020.07.23.22.07.21; Thu, 23 Jul 2020 22:07: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 S1726814AbgGXFGd (ORCPT + 99 others); Fri, 24 Jul 2020 01:06:33 -0400 Received: from mga17.intel.com ([192.55.52.151]:61095 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725929AbgGXFGc (ORCPT ); Fri, 24 Jul 2020 01:06:32 -0400 IronPort-SDR: zg7IM0z+Die1b0DZB/or77PFuiVv1LaZoPt4dRenwPy/ZoyL5xg14s8fnISuJC4dYrHeZimyym ieiaKBhr1mCg== X-IronPort-AV: E=McAfee;i="6000,8403,9691"; a="130735402" X-IronPort-AV: E=Sophos;i="5.75,389,1589266800"; d="scan'208";a="130735402" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jul 2020 22:06:32 -0700 IronPort-SDR: gKq9JMMfAB1WTxb1B75Tr/Y0+VWnZYl7rXeqRKzkcyBP5cyyEa9WGOlGd4Xw57NlUJVfrBbHUQ TREnjshwbUrQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,389,1589266800"; d="scan'208";a="432970174" Received: from itopinsk-mobl1.ccr.corp.intel.com (HELO localhost) ([10.249.36.179]) by orsmga004.jf.intel.com with ESMTP; 23 Jul 2020 22:06:25 -0700 From: Jarkko Sakkinen To: linux-kernel@vger.kernel.org Cc: Jarkko Sakkinen , linux-mm@kvack.org, Andi Kleen , Masami Hiramatsu , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "H. Peter Anvin" , Andrew Morton , "Steven Rostedt (VMware)" , Mike Rapoport , Jiri Olsa Subject: [PATCH v5 4/6] arch/x86: kprobes: Use text_alloc() and text_free() Date: Fri, 24 Jul 2020 08:05:51 +0300 Message-Id: <20200724050553.1724168-5-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200724050553.1724168-1-jarkko.sakkinen@linux.intel.com> References: <20200724050553.1724168-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() and text_free() to implement alloc_insn_page() and free_insn_page(). Cc: linux-mm@kvack.org Cc: Andi Kleen Cc: Masami Hiramatsu Cc: Peter Zijlstra Signed-off-by: Jarkko Sakkinen Im --- arch/x86/kernel/kprobes/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index ada39ddbc922..9e57452b3a51 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; @@ -446,7 +446,7 @@ void *alloc_insn_page(void) /* Recover page to RW mode before releasing it */ void free_insn_page(void *page) { - module_memfree(page); + text_free(page); } static int arch_copy_kprobe(struct kprobe *p) -- 2.25.1