Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1370116imi; Sat, 23 Jul 2022 03:57:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uZGAvfynCpQwjyzIFHv8loliTGlIfkvt0tl0D/iBwVHel/Zjf1jBOGIx6cLjKzNXCpoort X-Received: by 2002:a17:90a:73ca:b0:1f2:2989:b92d with SMTP id n10-20020a17090a73ca00b001f22989b92dmr4315295pjk.182.1658573849612; Sat, 23 Jul 2022 03:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658573849; cv=none; d=google.com; s=arc-20160816; b=b6/+or7Jmd0SXST3IV6sUTlzUji17dzmIo3wupAUOg0HLUotHnoxxHa3EFTZlfxk2E ifDhHsSa8k7xHPhi4A6RYKV4pMgSKu7qDZYuOB2FWOQM95noPB4mUmL7tYcZJJt7gGO/ m56++UOm5ne3Tl6/ijL8By4V+NXc0OusF+fPYegwPgXlT1VjVGu6D+yCqOquKxdU+9X9 svL+cJoqPC9WascKrKP7xj2FlTAz7eRrii3X/EOjMx3d1GQNcGqxdGqo/OKCdsCgyxpe na/rBuV5E9++IM3Tgm5++OEAR4++DQKFZB6mLZl/lob3MxCE2fX+0DL/PR+hIMLtA+Vm hQ5A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4JBjObuGDT3PCBz02vAfZHWij/3nkPUzRE36JAUZObQ=; b=x8+KOW2swItUO2ls7MpEhKP5T49VDZNmUczmAi/V8jvYyhyT7QGULUchfrHAGmbq2q 7PHghKAmRgqR3LQqEYNKwlbtYNuvLeIlw0lb27Ez6kkJxO4MNdfRMUM9J7vLC4ldY2zl q1Ix4LV/P/96FzsKqZ3TUv1/1KpeV8s2U1PmCvnJ5yMuQh3cAYOpRUimi17LKt2ApWYj K2WO8lXx6wd52Ymxm1pVzGTx1gs7ppQBrRM502sQWM7S8Vk4dxVArtYrvOtlV8wKixvl xtc7ZB7DQUpG2/aPDuNo0qbvSxzRAT+4ObR7FOhpDaPA3WiLcIVWF0zMTr7N9jUkBv6/ siMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wWtDoMNJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e11-20020a170903240b00b0016252715440si196294plo.494.2022.07.23.03.57.14; Sat, 23 Jul 2022 03:57:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wWtDoMNJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237656AbiGWJ63 (ORCPT + 99 others); Sat, 23 Jul 2022 05:58:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237426AbiGWJ5c (ORCPT ); Sat, 23 Jul 2022 05:57:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AC023AE79; Sat, 23 Jul 2022 02:57:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EC690611BD; Sat, 23 Jul 2022 09:57:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06C18C341C0; Sat, 23 Jul 2022 09:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658570235; bh=9b44PqloIFpmblyMUGGLSuLs+WWjcV6QDufCaUVInTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wWtDoMNJznnV/PMO/6SeAuVUKqnMWENpkPLgShTV/6pYtQ0HcXVcnSh3nqOWK4kN0 xt98epCzfr7oE1+gosKqlcHFjSBEKBq933Fzq985b4xZHMrcywX5cV/XHKlKmrOXfy szTGqnl9VZNRuimpd982U8ns91/Wko4mVYKr4+yc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Ben Hutchings Subject: [PATCH 5.10 015/148] x86/insn: Rename insn_decode() to insn_decode_from_regs() Date: Sat, 23 Jul 2022 11:53:47 +0200 Message-Id: <20220723095228.677502278@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220723095224.302504400@linuxfoundation.org> References: <20220723095224.302504400@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov commit 9e761296c52dcdb1aaa151b65bd39accb05740d9 upstream. Rename insn_decode() to insn_decode_from_regs() to denote that it receives regs as param and uses registers from there during decoding. Free the former name for a more generic version of the function. No functional changes. Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20210304174237.31945-2-bp@alien8.de Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/insn-eval.h | 4 ++-- arch/x86/kernel/sev-es.c | 2 +- arch/x86/kernel/umip.c | 2 +- arch/x86/lib/insn-eval.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) --- a/arch/x86/include/asm/insn-eval.h +++ b/arch/x86/include/asm/insn-eval.h @@ -26,7 +26,7 @@ int insn_fetch_from_user(struct pt_regs unsigned char buf[MAX_INSN_SIZE]); int insn_fetch_from_user_inatomic(struct pt_regs *regs, unsigned char buf[MAX_INSN_SIZE]); -bool insn_decode(struct insn *insn, struct pt_regs *regs, - unsigned char buf[MAX_INSN_SIZE], int buf_size); +bool insn_decode_from_regs(struct insn *insn, struct pt_regs *regs, + unsigned char buf[MAX_INSN_SIZE], int buf_size); #endif /* _ASM_X86_INSN_EVAL_H */ --- a/arch/x86/kernel/sev-es.c +++ b/arch/x86/kernel/sev-es.c @@ -236,7 +236,7 @@ static enum es_result vc_decode_insn(str return ES_EXCEPTION; } - if (!insn_decode(&ctxt->insn, ctxt->regs, buffer, res)) + if (!insn_decode_from_regs(&ctxt->insn, ctxt->regs, buffer, res)) return ES_DECODE_FAILED; } else { res = vc_fetch_insn_kernel(ctxt, buffer); --- a/arch/x86/kernel/umip.c +++ b/arch/x86/kernel/umip.c @@ -356,7 +356,7 @@ bool fixup_umip_exception(struct pt_regs if (!nr_copied) return false; - if (!insn_decode(&insn, regs, buf, nr_copied)) + if (!insn_decode_from_regs(&insn, regs, buf, nr_copied)) return false; umip_inst = identify_insn(&insn); --- a/arch/x86/lib/insn-eval.c +++ b/arch/x86/lib/insn-eval.c @@ -1492,7 +1492,7 @@ int insn_fetch_from_user_inatomic(struct } /** - * insn_decode() - Decode an instruction + * insn_decode_from_regs() - Decode an instruction * @insn: Structure to store decoded instruction * @regs: Structure with register values as seen when entering kernel mode * @buf: Buffer containing the instruction bytes @@ -1505,8 +1505,8 @@ int insn_fetch_from_user_inatomic(struct * * True if instruction was decoded, False otherwise. */ -bool insn_decode(struct insn *insn, struct pt_regs *regs, - unsigned char buf[MAX_INSN_SIZE], int buf_size) +bool insn_decode_from_regs(struct insn *insn, struct pt_regs *regs, + unsigned char buf[MAX_INSN_SIZE], int buf_size) { int seg_defs;