public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MMU: fix cmpxchg8b emulation on i386 to use the right address
@ 2008-01-04  6:57 Carlo Marcelo Arenas Belon
  2008-01-04  7:42 ` Carlo Marcelo Arenas Belon
  0 siblings, 1 reply; 3+ messages in thread
From: Carlo Marcelo Arenas Belon @ 2008-01-04  6:57 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

change the function parameter to use vaddr instead of addr to avoid a
variable name redefinition from 9a5ee611ca79bec98e9d97e93f11df8083b8af6e
that resulted in :

  kernel/x86.c:1746: warning: passing argument 2 of 'vcpu->arch.mmu.gva_to_gpa' makes integer from pointer without a cast
  kernel/x86.c:1746: warning: 'addr' is used uninitialized in this function

Signed-off-by: Carlo Marcelo Arenas Belon <carenas-kLeDWSohozoJb6fo7hG9ng@public.gmane.org>
---
 arch/x86/kvm/x86.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c5b4825..abe08d1 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1722,7 +1722,7 @@ int emulator_write_emulated(unsigned long addr,
 }
 EXPORT_SYMBOL_GPL(emulator_write_emulated);
 
-static int emulator_cmpxchg_emulated(unsigned long addr,
+static int emulator_cmpxchg_emulated(unsigned long vaddr,
 				     const void *old,
 				     const void *new,
 				     unsigned int bytes,
@@ -1743,7 +1743,7 @@ static int emulator_cmpxchg_emulated(unsigned long addr,
 		u64 val;
 
 		down_read(&current->mm->mmap_sem);
-		gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, addr);
+		gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, vaddr);
 
 		if (gpa == UNMAPPED_GVA ||
 		   (gpa & PAGE_MASK) == APIC_DEFAULT_PHYS_BASE)
@@ -1763,7 +1763,7 @@ static int emulator_cmpxchg_emulated(unsigned long addr,
 	}
 #endif
 
-	return emulator_write_emulated(addr, new, bytes, vcpu);
+	return emulator_write_emulated(vaddr, new, bytes, vcpu);
 }
 
 static unsigned long get_segment_base(struct kvm_vcpu *vcpu, int seg)
-- 
1.5.3.7


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MMU: fix cmpxchg8b emulation on i386 to use the right address
  2008-01-04  6:57 [PATCH] MMU: fix cmpxchg8b emulation on i386 to use the right address Carlo Marcelo Arenas Belon
@ 2008-01-04  7:42 ` Carlo Marcelo Arenas Belon
  2008-01-04 12:09   ` Marcelo Tosatti
  0 siblings, 1 reply; 3+ messages in thread
From: Carlo Marcelo Arenas Belon @ 2008-01-04  7:42 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: mtosatti-H+wXaHxf7aLQT0dZR+AlfA

On Fri, Jan 04, 2008 at 12:57:49AM -0600, Carlo Marcelo Arenas Belon wrote:
> change the function parameter to use vaddr instead of addr to avoid a
> variable name redefinition from 9a5ee611ca79bec98e9d97e93f11df8083b8af6e

this implementation has been already patched 6 times (not including this one)
since it was originally introduced in Dec 12, including compilation and logic
fixes as can be seen by :

  24a673eb377069509e8dad5ff7fa146e363df739
  eb9270cee7061e5a985eb9eac559270292b1d7ec
  a5e8e8a4f7ddb211d856eb30e93e70af9d51b735
  d5855a0ec163afd591f272e13e1f2c366794306f
  9bfdd08f0a65e67d0842ca35516669bec523fbe0
  91051a4955255317cab0d09d8849ec12db85f924

it was meant to fix some sort of bug on i386 because it wasn't atomic but
with so many changes I am not sure if what it was meant to do has been really
preserved, so I think it would be better if anyone with more experience and a
better understanding of this patch could  sheed some light on this.

Carlo

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MMU: fix cmpxchg8b emulation on i386 to use the right address
  2008-01-04  7:42 ` Carlo Marcelo Arenas Belon
@ 2008-01-04 12:09   ` Marcelo Tosatti
  0 siblings, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2008-01-04 12:09 UTC (permalink / raw)
  To: Carlo Marcelo Arenas Belon; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Fri, Jan 04, 2008 at 01:42:04AM -0600, Carlo Marcelo Arenas Belon wrote:
> On Fri, Jan 04, 2008 at 12:57:49AM -0600, Carlo Marcelo Arenas Belon wrote:
> > change the function parameter to use vaddr instead of addr to avoid a
> > variable name redefinition from 9a5ee611ca79bec98e9d97e93f11df8083b8af6e
> 
> this implementation has been already patched 6 times (not including this one)
> since it was originally introduced in Dec 12, including compilation and logic
> fixes as can be seen by :
> 
>   24a673eb377069509e8dad5ff7fa146e363df739
>   eb9270cee7061e5a985eb9eac559270292b1d7ec
>   a5e8e8a4f7ddb211d856eb30e93e70af9d51b735
>   d5855a0ec163afd591f272e13e1f2c366794306f
>   9bfdd08f0a65e67d0842ca35516669bec523fbe0
>   91051a4955255317cab0d09d8849ec12db85f924
> 
> it was meant to fix some sort of bug on i386 because it wasn't atomic but
> with so many changes I am not sure if what it was meant to do has been really
> preserved, so I think it would be better if anyone with more experience and a
> better understanding of this patch could  sheed some light on this.

It is OK now. The first patch was quite broken, thus so many fixes :(


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-04 12:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-04  6:57 [PATCH] MMU: fix cmpxchg8b emulation on i386 to use the right address Carlo Marcelo Arenas Belon
2008-01-04  7:42 ` Carlo Marcelo Arenas Belon
2008-01-04 12:09   ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox