Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3125239pxj; Mon, 31 May 2021 21:20:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/Bp6AoNMDv4B9YIm5s+xNE6kUt7E1CTXsebq4HRsfEl7deICAgOI7R2aiMYReb+f02Q+n X-Received: by 2002:a5e:a604:: with SMTP id q4mr20044239ioi.178.1622521217537; Mon, 31 May 2021 21:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622521217; cv=none; d=google.com; s=arc-20160816; b=jSArWLvpl3W6toUHFOoEAoeka22cyTxYdAL5JA72nRqsGGLCfA1vLCdShk5I9sPXAf js3WlXgks511iLGaBIy8s/9uO9UPKjRAvYX+GINe72zlHlH3GRhsPyxU9HnebNtbxVpo lYlcqEbJSyA7plovsbL6zkDxLJQid1BfNqVmv5spkPlaTWKjMY7uf0sxG1tfG5G0c4kC E2V6X4LY1IABCsuZApbyvJcFhcvmRrdrj1uRmaLVu59hzhMoIWQECx2VP+UGJYArn9Vp oQpIueefrG/bRRrEtMQoYqg+GirCoJy8Q58HnJ2dRLXHJROtrWBUxkAv9jdbIHi7WZgA cF1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=YRKLOS04qjk9hBE6xQOF4s/xzxec5M6W0FP1cbb7m3M=; b=MqU1moPEAMVQNvPMmLYoeCbSmCPOWoGf0AQcYKPyPn4FhXciMxn3eID9v0WDCrHeki j5A/AqgHD5K1NDKt5F3vzpXZXxlx+ecBdXUO9FpAc5Uyh2ZG6kOFnFTkssS76zaJls2g od+wY6YsOzN8g8k+FqczdHuzP6QFYI/0P9oWOczAOjLg8gFFnTiO/ElMK7ZVKne4LPxw 1q4X3+pVXSxLG2g0pdkiFiE6kdimKjlOF5vSAee4h95xdDAUedXSevYlQkBuAyw3/QK/ rRi3LKN2U4Zc1exwhBG1dDo3xLK/HUTdxhczHtVNxnxoyTycyNH8jWjqs50YSwfpVLhZ GC9g== 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=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si5551678jaj.69.2021.05.31.21.20.03; Mon, 31 May 2021 21:20:17 -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=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230329AbhFAESY (ORCPT + 99 others); Tue, 1 Jun 2021 00:18:24 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:3362 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbhFAESX (ORCPT ); Tue, 1 Jun 2021 00:18:23 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4FvJfd6t4gz630D; Tue, 1 Jun 2021 12:12:57 +0800 (CST) Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Tue, 1 Jun 2021 12:16:35 +0800 Received: from SWX921481.china.huawei.com (10.126.201.217) by dggemi761-chm.china.huawei.com (10.1.198.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 1 Jun 2021 12:16:32 +0800 From: Barry Song To: , , , , CC: , Barry Song Subject: [PATCH] x86/kprobes: remove free_insn_page since it is same with the common weak function Date: Tue, 1 Jun 2021 16:08:56 +1200 Message-ID: <20210601040856.22080-1-song.bao.hua@hisilicon.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.126.201.217] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggemi761-chm.china.huawei.com (10.1.198.147) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org free_insn_page() in x86 is same with the common weak function in kernel/kprobes.c. Plus, its comment "Recover page to RW mode before releasing it" seems insensible to be there since resetting mapping is done by common code in vfree() of module_memfree(). So drop the strong function and its comment in x86 totally. Signed-off-by: Barry Song --- arch/x86/kernel/kprobes/core.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index d3d65545cb8b..3bce67d3a03c 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -422,12 +422,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); -} - /* Kprobe x86 instruction emulation - only regs->ip or IF flag modifiers */ static void kprobe_emulate_ifmodifiers(struct kprobe *p, struct pt_regs *regs) -- 2.25.1