Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1681169ybh; Thu, 23 Jul 2020 15:17:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDDWAV5GaXE1uLRJQxiXZ4A+JkYGMnMjUZGaA8x1Ymakcs1uNbGeRno+xs21lCSy3aJTxy X-Received: by 2002:a05:6402:1c86:: with SMTP id cy6mr6186960edb.30.1595542661118; Thu, 23 Jul 2020 15:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595542661; cv=none; d=google.com; s=arc-20160816; b=avRt9DpI3EMgnTEFk4VoPurKAf05qja0FPKbIY6vk93xH3mja1uVp+6a4z193vKA41 dflKNmK8UeHC883uYsvCSeEEgcUG3v78DCCiBRUUgP+YcaMplQOi1RJacaKIcVryycDF OKVnNuHBlGHdU2RuX4YtkUUwaHcc988SDbi7eCLWi6axbkmN7RiPQN/wWG1mVkWLy68t Oy+a45yxvVh8C0Wtrp7X8R6cyLFrrgslRlYFnpjYNk9CGoKHjHniGPSbwOAJ6/Ov170n bbW55YDTd2x4eIPX0fRNjhV8iOeofgssMuL8P0P3IYxUfGXgvO67hVMbxkpJBQLeOD61 pm8g== 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=NvYojmSW7bt6uAvJrGp5Z02BSGPaJ4iMohRFQH5Fzgk=; b=oPa5B/HBSjGE06f5q8Bnv260RV6wKltvawdFUlwyzKvqmqCeEpN2OJBj0dRnow97kC 5enqA2BU394tihI7wiQuln/ATXUd2BXPPi0eQoZm7q5mikxH3llaNHDi1wUR7fipyKCa 9IdE6iEoGsRny4q26/aFP7x4lCGyiKiQGM1UQug0Hl8JMavxUIsO0nU7e/P0YyrPj4pW 8fBjYGrWucU298unRIy9FCyer377YFLENl6MUtANQVZKl+yXeFqoOTcJYOU90VVr4aqC Zmm9ZWXoVdbW3e+qXvVNBSEi2HN0lL5D/Gtddrfjzf+BZkh0zghrkiEAj8ZlNiQOMw3b a3FA== 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 c2si2868012edq.228.2020.07.23.15.17.18; Thu, 23 Jul 2020 15:17:41 -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 S1726861AbgGWWQr (ORCPT + 99 others); Thu, 23 Jul 2020 18:16:47 -0400 Received: from mga18.intel.com ([134.134.136.126]:10832 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbgGWWQr (ORCPT ); Thu, 23 Jul 2020 18:16:47 -0400 IronPort-SDR: nHUY36t2DcBT1yQrOzqVynsjkKZG21Z/LzoT3piXL3m+M0m9JHx79WE5Ml05hs4DY1EGSBzXdp hkX5RW0aSLRw== X-IronPort-AV: E=McAfee;i="6000,8403,9691"; a="138128464" X-IronPort-AV: E=Sophos;i="5.75,388,1589266800"; d="scan'208";a="138128464" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jul 2020 15:16:46 -0700 IronPort-SDR: V939IbIU7jgZMLRY5uUc3S7pa7nRtDFDXiaNUpI1sa39DjRWaFPV99BrskLU1+H7OriLgMPxCV SMAaJ/BbYxZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,388,1589266800"; d="scan'208";a="432889200" Received: from abdelh1x-mobl.amr.corp.intel.com (HELO localhost) ([10.249.38.107]) by orsmga004.jf.intel.com with ESMTP; 23 Jul 2020 15:16:42 -0700 Date: Fri, 24 Jul 2020 01:16:41 +0300 From: Jarkko Sakkinen To: linux-kernel@vger.kernel.org Cc: Andi Kleen , Masami Hiramatsu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Peter Zijlstra , Mike Rapoport , Jiri Olsa Subject: Re: [PATCH v4 5/7] arch/x86: kprobes: Use text_alloc() in alloc_insn_page() Message-ID: <20200723221641.GA12405@linux.intel.com> References: <20200717030422.679972-1-jarkko.sakkinen@linux.intel.com> <20200717030422.679972-6-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200717030422.679972-6-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 17, 2020 at 06:04:19AM +0300, Jarkko Sakkinen wrote: > 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); This must be a mistake. Should be just changed to call text_memfree(). Probably just my clumsiness when refactoring the series. > -} > - > static int arch_copy_kprobe(struct kprobe *p) > { > struct insn insn; > -- > 2.25.1 > /Jarkko