Skip to contentSkip to conversation

libkvm: fix stack underflow in MMIO read write calls

PATCH Applied Carlo Marcelo Arenas Belon 2 participants 2 messages Dec 28, 2007 – Dec 30, 2007 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libkvm: fix stack underflow in MMIO read write calls

This patch complement 6eabe2ba30a673c4280df75b28520e0e1f4a2171 so that all callbacks used for MMIO read/write use the ABI exported in libkvm.h.

This fixes the following warnings was reported at compile time :

main.c:392: warning: initialization from incompatible pointer type main.c:393: warning: initialization from incompatible pointer type qemu/qemu-kvm.c:532: warning: initialization from incompatible pointer type qemu/qemu-kvm.c:533: warning: initialization from incompatible pointer type

---
 qemu/qemu-kvm.c |    6 ++----
 user/main.c     |    4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)
qemu/qemu-kvm.c +2 -4
index a61b95c..9aee903 100644
@@ -483,15 +483,13 @@ static int kvm_outl(void *opaque, uint16_t addr, uint32_t data)
     return 0;
 }
 
-static int kvm_mmio_read(void *opaque, uint64_t addr,
-					uint8_t *data, int len, int is_write)
+static int kvm_mmio_read(void *opaque, uint64_t addr, uint8_t *data, int len)
 {
 	cpu_physical_memory_rw(addr, data, len, 0);
 	return 0;
 }
 
-static int kvm_mmio_write(void *opaque, uint64_t addr,
-					uint8_t *data, int len, int is_write)
+static int kvm_mmio_write(void *opaque, uint64_t addr, uint8_t *data, int len)
 {
 	cpu_physical_memory_rw(addr, data, len, 1);
 	return 0;
user/main.c +2 -2
index 4d870fa..a2d6b8b 100644
@@ -366,7 +366,7 @@ static int test_pre_kvm_run(void *opaque, int vcpu)
 	return 0;
 }
 
-static int test_mem_read(void *opaque, uint64_t addr, void *data, unsigned len)
+static int test_mem_read(void *opaque, uint64_t addr, uint8_t *data, int len)
 {
 	if (addr < IORAM_BASE_PHYS || addr + len > IORAM_BASE_PHYS + IORAM_LEN)
 		return 1;
@@ -374,7 +374,7 @@ static int test_mem_read(void *opaque, uint64_t addr, void *data, unsigned len)
 	return 0;
 }
 
-static int test_mem_write(void *opaque, uint64_t addr, void *data, unsigned len)
+static int test_mem_write(void *opaque, uint64_t addr, uint8_t *data, int len)
 {
 	if (addr < IORAM_BASE_PHYS || addr + len > IORAM_BASE_PHYS + IORAM_LEN)
 		return 1;
Signature · 7 lines
1.5.2.5


-------------------------------------------------------------------------
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/
Applied
#1 lore raw
Quoted 10 lines · Carlo Marcelo Arenas Belon

This patch complement 6eabe2ba30a673c4280df75b28520e0e1f4a2171 so that all callbacks used for MMIO read/write use the ABI exported in libkvm.h.

This fixes the following warnings was reported at compile time :

main.c:392: warning: initialization from incompatible pointer type main.c:393: warning: initialization from incompatible pointer type qemu/qemu-kvm.c:532: warning: initialization from incompatible pointer type qemu/qemu-kvm.c:533: warning: initialization from incompatible pointer type

Applied, thanks (though that's just a signature mismatch, not a stack underflow).

Signature · 7 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
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/