Skip to contentSkip to conversation

kvm:vmx:changes in handle_io() for code cleanup.

PATCH New Stephen Zhang 1 participant 1 message Dec 11, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm:vmx:changes in handle_io() for code cleanup.

---
 arch/x86/kvm/vmx/vmx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kvm/vmx/vmx.c +3 -3
index 47b8357..e1954df 100644
@@ -4899,15 +4899,15 @@ static int handle_triple_fault(struct kvm_vcpu *vcpu)
 static int handle_io(struct kvm_vcpu *vcpu)
 {
 	unsigned long exit_qualification;
-	int size, in, string;
+	int size, in;
 	unsigned port;
 
 	exit_qualification = vmx_get_exit_qual(vcpu);
-	string = (exit_qualification & 16) != 0;
 
 	++vcpu->stat.io_exits;
 
-	if (string)
+	/* String instruction */
+	if (exit_qualification & BIT(4))
 		return kvm_emulate_instruction(vcpu, 0);
 
 	port = exit_qualification >> 16;
Signature · 1 line
1.8.3.1