Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp346970pxb; Wed, 14 Apr 2021 17:24:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGGkTk8plFEQuiU9iqH6YURRNzNOyL4LGTKNGgI+swQjwViuf2snza3zU0IZGzCu8P1nhM X-Received: by 2002:a17:90a:420d:: with SMTP id o13mr792908pjg.61.1618446288281; Wed, 14 Apr 2021 17:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618446288; cv=none; d=google.com; s=arc-20160816; b=Bbm1gMuPMX5HYzSF4lf2GCVrwDZ/VX4pv2NstHV8u68i9ESoRbjWbxuXXIq1Fz0EEv RCm5XaEJSpbiUd580RgGV/S3iKqwHmdgQ1s8QbQ3k9Vy8K4Gj5qu1flFnEB6BtB93w/U B1Vu0kt9Vo/q97deqpFR/Oun90qLlJosAbP0k0QIqGRSXSYXm5WwvUnS1Nt1r0WH7R0Z FawoWpexBRoSjCks9Q8h6xwde0ONmIkCXk93xX8MD24Va2fx2vBiaQQIIp6w4F+L2Ioc MvYUqP2DHimTZwQgfbzXf6lw15Roun8bB47eXuWM4AqW1SL/oMUTAn5RWlMfZibp2ecy OOmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:message-id; bh=tk0qiu4NcWrMYSztxWJikTOFBk+YKOspnYU6wTEa2r0=; b=Y+1D12EQ08vSVaI0eIihUxdY7uGLOMVHseYG6hTuBDiSZgP7dpRO7L1/EEfl9VrnkN 4eBOFxJ3j/z5hHSNui6bzzQ0CVwX3AqbJZYgtWFp0uvU5GZVjmY9AZB2XXfswIeF5AUs iGP/UPQcev3Gx9ROs2zBWivT8mC4YnxCNKii3lB6nSS3u/082OGXjPmwv/TyrqLbNfqM ofY2cmi4d3PrOMJmX5WYQuOLVxIVON+S/SZA5eEQHoRVTTUD7N0ZfeeE4d1WVs9Rj/9o E00cDtbY7Q68SG5y4LwxGZo15EOE80uqcekhY7bkfoCiV6d+kd8RuxWuSpfMynFuxHDI 9UbA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id me18si1166005pjb.147.2021.04.14.17.24.36; Wed, 14 Apr 2021 17:24:48 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351137AbhDNNJK (ORCPT + 99 others); Wed, 14 Apr 2021 09:09:10 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:14011 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351127AbhDNNJD (ORCPT ); Wed, 14 Apr 2021 09:09:03 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FL2pv5Rq2zB09bJ; Wed, 14 Apr 2021 15:08:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 0m0rSe163YDQ; Wed, 14 Apr 2021 15:08:39 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4FL2pv4QNBzB09ZY; Wed, 14 Apr 2021 15:08:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1A5288B7C6; Wed, 14 Apr 2021 15:08:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 67Kzm74JUhAW; Wed, 14 Apr 2021 15:08:41 +0200 (CEST) Received: from po16121vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CD1748B7C4; Wed, 14 Apr 2021 15:08:40 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id A0F6F679D8; Wed, 14 Apr 2021 13:08:40 +0000 (UTC) Message-Id: <5f6f82572242a59bfee1e19a71194d8f7ef5fca4.1618405715.git.christophe.leroy@csgroup.eu> From: Christophe Leroy Subject: [PATCH v3 1/4] powerpc: Remove probe_user_read_inst() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , jniethe5@gmail.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 14 Apr 2021 13:08:40 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Its name comes from former probe_user_read() function. That function is now called copy_from_user_nofault(). probe_user_read_inst() uses copy_from_user_nofault() to read only a few bytes. It is suboptimal. It does the same as get_user_inst() but in addition disables page faults. But on the other hand, it is not used for the time being. So remove it for now. If one day it is really needed, we can give it a new name more in line with today's naming, and implement it using get_user_inst() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/inst.h | 3 --- arch/powerpc/lib/inst.c | 31 ------------------------------- 2 files changed, 34 deletions(-) diff --git a/arch/powerpc/include/asm/inst.h b/arch/powerpc/include/asm/inst.h index 19e18af2fac9..2902d4e6a363 100644 --- a/arch/powerpc/include/asm/inst.h +++ b/arch/powerpc/include/asm/inst.h @@ -175,9 +175,6 @@ static inline char *__ppc_inst_as_str(char str[PPC_INST_STR_LEN], struct ppc_ins __str; \ }) -int probe_user_read_inst(struct ppc_inst *inst, - struct ppc_inst __user *nip); - int probe_kernel_read_inst(struct ppc_inst *inst, struct ppc_inst *src); diff --git a/arch/powerpc/lib/inst.c b/arch/powerpc/lib/inst.c index 9cc17eb62462..c57b3548de37 100644 --- a/arch/powerpc/lib/inst.c +++ b/arch/powerpc/lib/inst.c @@ -9,24 +9,6 @@ #include #ifdef CONFIG_PPC64 -int probe_user_read_inst(struct ppc_inst *inst, - struct ppc_inst __user *nip) -{ - unsigned int val, suffix; - int err; - - err = copy_from_user_nofault(&val, nip, sizeof(val)); - if (err) - return err; - if (get_op(val) == OP_PREFIX) { - err = copy_from_user_nofault(&suffix, (void __user *)nip + 4, 4); - *inst = ppc_inst_prefix(val, suffix); - } else { - *inst = ppc_inst(val); - } - return err; -} - int probe_kernel_read_inst(struct ppc_inst *inst, struct ppc_inst *src) { @@ -45,19 +27,6 @@ int probe_kernel_read_inst(struct ppc_inst *inst, return err; } #else /* !CONFIG_PPC64 */ -int probe_user_read_inst(struct ppc_inst *inst, - struct ppc_inst __user *nip) -{ - unsigned int val; - int err; - - err = copy_from_user_nofault(&val, nip, sizeof(val)); - if (!err) - *inst = ppc_inst(val); - - return err; -} - int probe_kernel_read_inst(struct ppc_inst *inst, struct ppc_inst *src) { -- 2.25.0