lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220906153357.1362555-1-zhiguangni01@zhaoxin.com>
Date:   Tue,  6 Sep 2022 23:33:57 +0800
From:   Liam Ni <zhiguangni01@...il.com>
To:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org, x86@...nel.org
Cc:     seanjc@...gle.com, pbonzini@...hat.com, tglx@...utronix.de,
        dave.hansen@...ux.intel.com, zhiguangni01@...il.com
Subject: [PATCH] KVM: Reduce the execution of one instruction

From: Liam Ni <zhiguangni01@...il.com>

If the condition is met, reduce the execution of one instruction.

Signed-off-by: Liam Ni <zhiguangni01@...il.com>
---
 arch/x86/kvm/emulate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index f8382abe22ff..ebb95f3f9862 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1139,10 +1139,12 @@ static int em_fnstsw(struct x86_emulate_ctxt *ctxt)
 static void decode_register_operand(struct x86_emulate_ctxt *ctxt,
 				    struct operand *op)
 {
-	unsigned reg = ctxt->modrm_reg;
+	unsigned int reg;
 
 	if (!(ctxt->d & ModRM))
 		reg = (ctxt->b & 7) | ((ctxt->rex_prefix & 1) << 3);
+	else
+		reg = ctxt->modrm_reg;
 
 	if (ctxt->d & Sse) {
 		op->type = OP_XMM;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ