From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 700E815855E for ; Mon, 17 Nov 2025 09:32:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763371939; cv=none; b=fgQsiwUO94GEh3+HHw4yIYfqNx1USMZtYR66y37AYfC+Hli9SZiVQmRpV9EfyMB3C3hTSYv+CCqOiojCLYw+sV+BSlyUtkUyK3/S8Bva1cHOqXtxXMLU7pnmHruuroIy1nFHXjdFVvuxKh2+x4oz/nxy4orBwmK/Yxzu2rhHsR8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763371939; c=relaxed/simple; bh=QQwqjY5jqu4eGtkEpKbkY9Gnfql1GynsNzUzVJxZc0w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X1UOK6MrqM5tNfCZq+ijP6kc7mvzn73rQH+mXojNLQeu7reeFE4iEdNq8gPaGF1zuzgnq+rn+XieR9MPxN+3vE3MR4IlhiSp6J6XBQ5X082zaWvPPUDqH3NPhgq6Fqd5FCLBNrYC4SFubeVj+2JdKGtOQI4Z5D4eNUr41PKWwsM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DSFMiERu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DSFMiERu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F223EC2BC9E; Mon, 17 Nov 2025 09:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763371939; bh=QQwqjY5jqu4eGtkEpKbkY9Gnfql1GynsNzUzVJxZc0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DSFMiERuJVl8+LRzFkR9n2t4mVMrkTrm3LvkJxRLN3F3JDxESNY4MlH7GGJoAcVNy 6MjYPwd11juEXm4bSx70YgcW7FOQrLYBVg8sV2j7RnmI5X2+zEl4lUQ+Qz5/XX+/5P gX9pTlXN/fGgHd0r9Z3N7cYWoCYr+2a+qN3FOA32fQlkFIJZ1llsvuHWuXmRs3ROGj tkaawSlu5XNxw41/HN7PCeTaqlhMfs0owTZEmbzNShLye5DOqbJQON4QuXD70Jbd09 vRSkln5Rz1bY6bgsnzGO5f1MoDlYVgVxMsL8FYZcunjaT2jA5tYn7A2ONHk6Ov6bdy zreuAyzA/9luA== From: Jiri Olsa To: Thomas Gleixner , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Ingo Molnar , Borislav Petkov , Dave Hansen Subject: [PATCH 3/5] x86/insn-eval: Remove regs arg from insn_get_modrm_rm_off Date: Mon, 17 Nov 2025 10:31:35 +0100 Message-ID: <20251117093137.572132-4-jolsa@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251117093137.572132-1-jolsa@kernel.org> References: <20251117093137.572132-1-jolsa@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit It's not used, insn_get_modrm_rm_off returns only offset to struct pt_regs, not the actual register values. Signed-off-by: Jiri Olsa --- arch/x86/coco/sev/vc-handle.c | 2 +- arch/x86/include/asm/insn-eval.h | 2 +- arch/x86/kernel/cfi.c | 2 +- arch/x86/kernel/umip.c | 2 +- arch/x86/lib/insn-eval.c | 5 ++--- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/x86/coco/sev/vc-handle.c b/arch/x86/coco/sev/vc-handle.c index f08c7505ed82..fd81bbbd8af6 100644 --- a/arch/x86/coco/sev/vc-handle.c +++ b/arch/x86/coco/sev/vc-handle.c @@ -467,7 +467,7 @@ static long *vc_insn_get_rm(struct es_em_ctxt *ctxt) int offset; reg_array = (long *)ctxt->regs; - offset = insn_get_modrm_rm_off(&ctxt->insn, ctxt->regs); + offset = insn_get_modrm_rm_off(&ctxt->insn); if (offset < 0) return NULL; diff --git a/arch/x86/include/asm/insn-eval.h b/arch/x86/include/asm/insn-eval.h index 6b592040bda4..500654d9eaeb 100644 --- a/arch/x86/include/asm/insn-eval.h +++ b/arch/x86/include/asm/insn-eval.h @@ -19,7 +19,7 @@ int pt_regs_offset(int regno); bool insn_has_rep_prefix(struct insn *insn); void __user *insn_get_addr_ref(struct insn *insn, struct pt_regs *regs); -int insn_get_modrm_rm_off(struct insn *insn, struct pt_regs *regs); +int insn_get_modrm_rm_off(struct insn *insn); int insn_get_modrm_reg_off(struct insn *insn, struct pt_regs *regs); unsigned long *insn_get_modrm_reg_ptr(struct insn *insn, struct pt_regs *regs); unsigned long insn_get_seg_base(struct pt_regs *regs, int seg_reg_idx); diff --git a/arch/x86/kernel/cfi.c b/arch/x86/kernel/cfi.c index 638eb5c933e0..3cf944cbd7ef 100644 --- a/arch/x86/kernel/cfi.c +++ b/arch/x86/kernel/cfi.c @@ -52,7 +52,7 @@ static bool decode_cfi_insn(struct pt_regs *regs, unsigned long *target, return false; /* Read the target address from the register. */ - offset = insn_get_modrm_rm_off(&insn, regs); + offset = insn_get_modrm_rm_off(&insn); if (offset < 0) return false; diff --git a/arch/x86/kernel/umip.c b/arch/x86/kernel/umip.c index d432f3824f0c..7aeb405237ac 100644 --- a/arch/x86/kernel/umip.c +++ b/arch/x86/kernel/umip.c @@ -388,7 +388,7 @@ bool fixup_umip_exception(struct pt_regs *regs) * register. */ if (X86_MODRM_MOD(insn.modrm.value) == 3) { - reg_offset = insn_get_modrm_rm_off(&insn, regs); + reg_offset = insn_get_modrm_rm_off(&insn); /* * Negative values are usually errors. In memory addressing, diff --git a/arch/x86/lib/insn-eval.c b/arch/x86/lib/insn-eval.c index 8b9c2b90d66e..71f58d437253 100644 --- a/arch/x86/lib/insn-eval.c +++ b/arch/x86/lib/insn-eval.c @@ -581,7 +581,7 @@ static int get_reg_offset_16(struct insn *insn, struct pt_regs *regs, /* Operand is a register, use the generic function. */ if (X86_MODRM_MOD(insn->modrm.value) == 3) { - *offs1 = insn_get_modrm_rm_off(insn, regs); + *offs1 = insn_get_modrm_rm_off(insn); *offs2 = -EDOM; return 0; } @@ -849,7 +849,6 @@ int insn_get_code_seg_params(struct pt_regs *regs) /** * insn_get_modrm_rm_off() - Obtain register in r/m part of the ModRM byte * @insn: Instruction containing the ModRM byte - * @regs: Register values as seen when entering kernel mode * * Returns: * @@ -858,7 +857,7 @@ int insn_get_code_seg_params(struct pt_regs *regs) * cases, the returned value can be -EDOM to indicate that the particular value * of ModRM does not refer to a register and shall be ignored. */ -int insn_get_modrm_rm_off(struct insn *insn, struct pt_regs *regs) +int insn_get_modrm_rm_off(struct insn *insn) { return get_reg_offset(insn, REG_TYPE_RM); } -- 2.51.1