Skip to contentSkip to conversation

: KVM: Fix cmpxchg for writeback changes

PATCH Applied Aurelien Jarno 2 participants 4 messages Jul 25, 2007 3 messages not in the archive KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : KVM: Fix cmpxchg for writeback changes

KVM: Fix writeback for cmpxchg instruction

The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) broke cmpxchg emulation. The patch below fixes that.

drivers/kvm/x86_emulate.c +1 -1
index 21ce977..9d30d10 100644
@@ -1275,7 +1275,7 @@ twobyte_insn:
 		src.val = _regs[VCPU_REGS_RAX];
 		emulate_2op_SrcV("cmp", src, dst, _eflags);
 		/* Always write back. The question is: where to? */
-		d |= Mov;
+		no_wb = 0;
 		if (_eflags & EFLG_ZF) {
 			/* Success: write back to memory. */
 			dst.val = src.orig_val;
Signature · 10 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 14 lines · Aurelien Jarno

KVM: Fix writeback for cmpxchg instruction

The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) broke cmpxchg emulation. The patch below fixes that.

drivers/kvm/x86_emulate.c +0 -0
index 21ce977..9d30d10 100644

drivers/kvm/x86_emulate.c twobyte_insn: · line 1281

Quoted 8 lines
drivers/kvm/x86_emulate.c +1 -1
@@ -1275,7 +1275,7 @@ twobyte_insn:
 		src.val = _regs[VCPU_REGS_RAX];
 		emulate_2op_SrcV("cmp", src, dst, _eflags);
 		/* Always write back. The question is: where to? */
-		d |= Mov;
+		no_wb = 0;
 		if (_eflags & EFLG_ZF) {
 			/* Success: write back to memory. */
 			dst.val = src.orig_val;

But no_wb defaults to zero?

Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

A message that is not in the archive (sent off-list or not yet received): 46A7190A.3080500-atKUWr5tajBWk0Htik3J/[email protected]

#4 lore raw
Quoted 8 lines · Avi Kivity
Quoted 7 lines · Aurelien Jarno

KVM: Fix writeback for cmpxchg instruction

The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) broke cmpxchg emulation. The patch below fixes that.

[snip]

Quoted 1 line

But no_wb defaults to zero?

Oops right. So please find a new patch below.

KVM: Remove dead code in the cmpxchg instruction emulation

The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) let some dead code in the cmpxchg instruction emulation. Remove it.

drivers/kvm/x86_emulate.c +0 -2
index 21ce977..7b1baec 100644
@@ -1274,8 +1274,6 @@ twobyte_insn:
 		src.orig_val = src.val;
 		src.val = _regs[VCPU_REGS_RAX];
 		emulate_2op_SrcV("cmp", src, dst, _eflags);
-		/* Always write back. The question is: where to? */
-		d |= Mov;
 		if (_eflags & EFLG_ZF) {
 			/* Success: write back to memory. */
 			dst.val = src.orig_val;
Signature · 10 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

Applied
#6 lore raw
Quoted 8 lines · Aurelien Jarno

KVM: Remove dead code in the cmpxchg instruction emulation

The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) let some dead code in the cmpxchg instruction emulation. Remove it.

Applied, thanks.

Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/