* [PATCH]: KVM: Fix cmpxchg for writeback changes
@ 2007-07-25 9:25 Aurelien Jarno
[not found] ` <20070725092506.GA19697-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Aurelien Jarno @ 2007-07-25 9:25 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
KVM: Fix writeback for cmpxchg instruction
The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) broke
cmpxchg emulation. The patch below fixes that.
Signed-off-by: Aurelien Jarno <aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org>
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 21ce977..9d30d10 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -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;
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org | aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org
`- 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/
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH]: KVM: Fix cmpxchg for writeback changes
[not found] ` <20070725092506.GA19697-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>
@ 2007-07-25 9:34 ` Avi Kivity
[not found] ` <46A7190A.3080500-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2007-07-25 9:34 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Aurelien Jarno wrote:
> KVM: Fix writeback for cmpxchg instruction
>
> The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) broke
> cmpxchg emulation. The patch below fixes that.
>
> Signed-off-by: Aurelien Jarno <aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org>
>
> diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
> index 21ce977..9d30d10 100644
> --- a/drivers/kvm/x86_emulate.c
> +++ b/drivers/kvm/x86_emulate.c
> @@ -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?
--
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/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH]: KVM: Fix cmpxchg for writeback changes
[not found] ` <46A7190A.3080500-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-07-25 9:41 ` Aurelien Jarno
[not found] ` <20070725094157.GA20665-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Aurelien Jarno @ 2007-07-25 9:41 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Wed, Jul 25, 2007 at 12:34:02PM +0300, Avi Kivity wrote:
> Aurelien Jarno wrote:
> > KVM: Fix writeback for cmpxchg instruction
> >
> > The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) broke
> > cmpxchg emulation. The patch below fixes that.
> >
> > Signed-off-by: Aurelien Jarno <aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org>
> >
[snip]
> 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.
Signed-off-by: Aurelien Jarno <aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org>
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 21ce977..7b1baec 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -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;
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org | aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org
`- 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/
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH]: KVM: Fix cmpxchg for writeback changes
[not found] ` <20070725094157.GA20665-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>
@ 2007-07-25 9:54 ` Avi Kivity
0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2007-07-25 9:54 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Aurelien Jarno wrote:
> KVM: Remove dead code in the cmpxchg instruction emulation
>
> The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) let
> some dead code in the cmpxchg instruction emulation. Remove it.
>
> Signed-off-by: Aurelien Jarno <aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org>
>
>
Applied, thanks.
--
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/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-07-25 9:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-25 9:25 [PATCH]: KVM: Fix cmpxchg for writeback changes Aurelien Jarno
[not found] ` <20070725092506.GA19697-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>
2007-07-25 9:34 ` Avi Kivity
[not found] ` <46A7190A.3080500-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-25 9:41 ` Aurelien Jarno
[not found] ` <20070725094157.GA20665-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>
2007-07-25 9:54 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox