Commit c0b49b0d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

kvm: i386 fix

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

Is true.  Local variable `addr' shadows incoming arg `addr'.  Avi is on
vacation for a while, so...

Cc: Avi Kivity <avi@qumranet.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9ef9dc69
...@@ -1739,7 +1739,7 @@ static int emulator_cmpxchg_emulated(unsigned long addr, ...@@ -1739,7 +1739,7 @@ static int emulator_cmpxchg_emulated(unsigned long addr,
if (bytes == 8) { if (bytes == 8) {
gpa_t gpa; gpa_t gpa;
struct page *page; struct page *page;
char *addr; char *kaddr;
u64 val; u64 val;
down_read(&current->mm->mmap_sem); down_read(&current->mm->mmap_sem);
...@@ -1754,9 +1754,9 @@ static int emulator_cmpxchg_emulated(unsigned long addr, ...@@ -1754,9 +1754,9 @@ static int emulator_cmpxchg_emulated(unsigned long addr,
val = *(u64 *)new; val = *(u64 *)new;
page = gfn_to_page(vcpu->kvm, gpa >> PAGE_SHIFT); page = gfn_to_page(vcpu->kvm, gpa >> PAGE_SHIFT);
addr = kmap_atomic(page, KM_USER0); kaddr = kmap_atomic(page, KM_USER0);
set_64bit((u64 *)(addr + offset_in_page(gpa)), val); set_64bit((u64 *)(kaddr + offset_in_page(gpa)), val);
kunmap_atomic(addr, KM_USER0); kunmap_atomic(kaddr, KM_USER0);
kvm_release_page_dirty(page); kvm_release_page_dirty(page);
emul_write: emul_write:
up_read(&current->mm->mmap_sem); up_read(&current->mm->mmap_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment