[Qemu-devel] [PATCH] qapi: Fix potential NULL pointer segfault

2012-09-01 Thread Stefan Weil
Report from smatch: qapi-visit.c:1640 visit_type_BlockdevAction(8) error: we previously assumed 'obj' could be null (see line 1639) qapi-visit.c:2432 visit_type_NetClientOptions(8) error: we previously assumed 'obj' could be null (see line 2431) Signed-off-by: Stefan Weil --- scripts/qapi-vis

[Qemu-devel] [PATCH] qemu-ga: Remove unreachable code after g_error

2012-09-01 Thread Stefan Weil
Report from smatch: qemu-ga.c:117 register_signal_handlers(11) info: ignoring unreachable code. qemu-ga.c:122 register_signal_handlers(16) info: ignoring unreachable code. g_error calls abort which terminates the program. Signed-off-by: Stefan Weil --- qemu-ga.c |2 -- 1 file changed, 2 del

[Qemu-devel] [PATCH] qemu-sockets: Fix potential memory leak

2012-09-01 Thread Stefan Weil
The old code leaks variable 'peer'. Signed-off-by: Stefan Weil --- qemu-sockets.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Report from smatch: qemu-sockets.c:404 inet_dgram_opts(101) warn: variable dereferenced before check 'peer' (see line 401) It looks like this warning does

Re: [Qemu-devel] [PATCH V6 2/8] hw/acpi_piix4.c: replace register_ioport*

2012-09-01 Thread Jan Kiszka
On 2012-08-29 05:01, Julien Grall wrote: > This patch replaces all register_ioport* with the new memory API. It permits > to use the new Memory stuff like listener. Doesn't build. Jan > > Signed-off-by: Julien Grall > --- > hw/acpi_piix4.c | 170 > +++

Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem

2012-09-01 Thread Avi Kivity
On 08/29/2012 10:49 AM, Jan Kiszka wrote: > > > > Let's experiment with refcounting MemoryRegion. We can move the entire > > contents of MemoryRegion to MemoryRegionImpl, add a reference count (to > > MemoryRegionImpl), and change MemoryRegion to contain a pointer to the > > refcounted MemoryRegi

Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem

2012-09-01 Thread Avi Kivity
On 08/30/2012 12:08 AM, Jan Kiszka wrote: > >>> > >>> We are dispatching according to the memory region (parameters, op > >>> handlers, opaques). If we end up in device object is not decided at this > >>> level. A memory region describes a dispatchable area - not to confuse > >>> with a device that

Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem

2012-09-01 Thread Jan Kiszka
On 2012-09-01 10:31, Avi Kivity wrote: > On 08/29/2012 10:49 AM, Jan Kiszka wrote: >>> >>> Let's experiment with refcounting MemoryRegion. We can move the entire >>> contents of MemoryRegion to MemoryRegionImpl, add a reference count (to >>> MemoryRegionImpl), and change MemoryRegion to contain a

[Qemu-devel] [PATCH] block/curl: Fix wrong free statement

2012-09-01 Thread Stefan Weil
Report from smatch: block/curl.c:546 curl_close(21) info: redundant null check on s->url calling free() The check was redundant, and free was also wrong because the memory was allocated using g_strdup. Signed-off-by: Stefan Weil --- block/curl.c |3 +-- 1 file changed, 1 insertion(+), 2 de

[Qemu-devel] [PATCH] cadence_uart: Fix buffer overflow

2012-09-01 Thread Stefan Weil
Report from smatch: hw/cadence_uart.c:413 uart_read(13) error: buffer overflow 's->r' 18 <= 18 This fixes read access to s->r[R_MAX] which is behind the limits of s->r. Signed-off-by: Stefan Weil --- hw/cadence_uart.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/cad

Re: [Qemu-devel] [PATCH v4] configure: properly check if -lrt and -lm is needed

2012-09-01 Thread Blue Swirl
On Wed, Aug 29, 2012 at 6:41 AM, Natanael Copa wrote: > On Tue, 28 Aug 2012 17:16:18 + > Blue Swirl wrote: > >> On Tue, Aug 28, 2012 at 7:33 AM, Natanael Copa >> wrote: >> > On Tue, 21 Aug 2012 18:12:05 + >> > Blue Swirl wrote: >> >> >> >> Now I get this on mingw32: >> >> config-host.ma

Re: [Qemu-devel] [PATCH 4/4] kvm: i386: Add classic PCI device assignment

2012-09-01 Thread Blue Swirl
On Tue, Aug 28, 2012 at 9:51 PM, Anthony Liguori wrote: > Blue Swirl writes: > >> On Tue, Aug 28, 2012 at 7:31 PM, Anthony Liguori >> wrote: >>> Blue Swirl writes: >>> On Tue, Aug 28, 2012 at 5:28 PM, Michael S. Tsirkin wrote: > On Tue, Aug 28, 2012 at 05:01:55PM +, Blue Sw

Re: [Qemu-devel] External RAM

2012-09-01 Thread Blue Swirl
On Wed, Aug 29, 2012 at 1:38 PM, Brian Roantree wrote: > Hi, I’m not sure which list this belongs in and was unable to find anything > like it so here goes, > > > > I am using QEMU 0.15.90 to emulate a processor and have currently got it > running in a loosely timed simulation with a systemC kerne

Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem

2012-09-01 Thread Avi Kivity
On 09/01/2012 01:57 AM, Jan Kiszka wrote: > On 2012-09-01 10:31, Avi Kivity wrote: > > On 08/29/2012 10:49 AM, Jan Kiszka wrote: > >>> > >>> Let's experiment with refcounting MemoryRegion. We can move the entire > >>> contents of MemoryRegion to MemoryRegionImpl, add a reference count (to > >>> Me

Re: [Qemu-devel] Adding support for Stateless Static NAT for TAP devices

2012-09-01 Thread Blue Swirl
On Thu, Aug 30, 2012 at 6:12 AM, John Basila wrote: > When running multiple instances of QEMU from the same image file > (using -snapshot) and connecting each instance to a dedicated TAP > device, the Guest OS will most likely not be able to communicate > with the outside world as all packets leav

Re: [Qemu-devel] [PATCH for-1.2 02/11] usb: Halt ep queue en cancel pending packets on a packet error

2012-09-01 Thread Blue Swirl
On Fri, Aug 31, 2012 at 2:19 PM, Gerd Hoffmann wrote: > From: Hans de Goede > > For controllers which queue up more then 1 packet at a time, we must halt the > ep queue, and inside the controller code cancel all pending packets on an > error. > > There are multiple reasons for this: > 1) Guests e

[Qemu-devel] [PATCH] lm4549: Fix buffer overflow

2012-09-01 Thread Stefan Weil
Report from smatch: lm4549.c:234 lm4549_write_samples(14) error: buffer overflow 's->buffer' 1024 <= 1024 There must be enough space to add two entries starting with index s->buffer_level, therefore the old check was wrong. Signed-off-by: Stefan Weil --- hw/lm4549.c |2 +- 1 file changed,

[Qemu-devel] [PATCH] json-parser: Fix potential NULL pointer segfault

2012-09-01 Thread Stefan Weil
Report from smatch: json-parser.c:474 parse_object(62) error: potential null derefence 'dict'. json-parser.c:553 parse_array(75) error: potential null derefence 'list'. Label out can be called with list == NULL. Signed-off-by: Stefan Weil --- json-parser.c |8 ++-- 1 file changed, 6 ins

[Qemu-devel] [PATCH] ioh3420: Remove unreachable code

2012-09-01 Thread Stefan Weil
Report from smatch: hw/ioh3420.c:128 ioh3420_initfn(35) info: ignoring unreachable code. Signed-off-by: Stefan Weil --- hw/ioh3420.c |1 - 1 file changed, 1 deletion(-) diff --git a/hw/ioh3420.c b/hw/ioh3420.c index 94a537c..4d31473 100644 --- a/hw/ioh3420.c +++ b/hw/ioh3420.c @@ -125,7 +12

[Qemu-devel] [PATCH] pflash_cfi01: Fix warning caused by unreachable code

2012-09-01 Thread Stefan Weil
Report from smatch: hw/pflash_cfi01.c:431 pflash_write(180) info: ignoring unreachable code. Instead of removing the return statement after the switch statement, the patch replaces the return statements in the switch statement by break statements. Other switch statements in the same code do it als

Re: [Qemu-devel] [PATCH for-1.2 v2] target-xtensa: return ENOSYS for unimplemented simcalls

2012-09-01 Thread Blue Swirl
Thanks, applied. On Wed, Aug 22, 2012 at 6:03 PM, Max Filippov wrote: > This prevents guest from proceeding with uninitialised garbage returned > from unimplemented simcalls. > > Signed-off-by: Max Filippov > --- > target-xtensa/xtensa-semi.c |2 ++ > 1 files changed, 2 insertions(+), 0 del

Re: [Qemu-devel] [PATCH] lm4549: Fix buffer overflow

2012-09-01 Thread Peter Maydell
On 1 September 2012 11:43, Stefan Weil wrote: > Report from smatch: > lm4549.c:234 lm4549_write_samples(14) error: > buffer overflow 's->buffer' 1024 <= 1024 > > There must be enough space to add two entries starting with index > s->buffer_level, therefore the old check was wrong. > > Signed-off-

Re: [Qemu-devel] [PATCH] x86: enforce DPL checking on task gate switches invoked through IDT

2012-09-01 Thread Blue Swirl
On Fri, Aug 17, 2012 at 3:30 PM, Alex ZUEPKE wrote: > Hi, > > x86 software emulation (non-KVM mode) does not check privilege levels on > task gate switches ... so one can invoke a kernel's double fault handler > from user space -- very bad. > > Expected behaviour (testcase works with any linux dis

Re: [Qemu-devel] [PATCH for-1.2 02/11] usb: Halt ep queue en cancel pending packets on a packet error

2012-09-01 Thread Hans de Goede
Hi, On 09/01/2012 12:42 PM, Blue Swirl wrote: On Fri, Aug 31, 2012 at 2:19 PM, Gerd Hoffmann wrote: From: Hans de Goede For controllers which queue up more then 1 packet at a time, we must halt the ep queue, and inside the controller code cancel all pending packets on an error. There are mu

Re: [Qemu-devel] [PATCH for-1.2 02/11] usb: Halt ep queue en cancel pending packets on a packet error

2012-09-01 Thread Michael Roth
On Sat, Sep 01, 2012 at 03:37:03PM +0200, Hans de Goede wrote: > Hi, > > On 09/01/2012 12:42 PM, Blue Swirl wrote: > >On Fri, Aug 31, 2012 at 2:19 PM, Gerd Hoffmann wrote: > >>From: Hans de Goede > >> > >>For controllers which queue up more then 1 packet at a time, we must halt > >>the > >>ep q

[Qemu-devel] [Bug 1044727] [NEW] -kernel does not work for multiboot ELF kernels

2012-09-01 Thread Henning Schild
Public bug reported: The multiboot header of a kernel image can contain the entry point and memory segment information. If it does not the kernel should have an ELF header that describes the memory segments and contains the entry point. http://www.gnu.org/software/grub/manual/multiboot/multiboot.

[Qemu-devel] [PATCH] CHECKPATCH

2012-09-01 Thread Don Slutz
I took my best guess as to how to handle tabs and long lines in checkpatch.pl itself. So I get: ... total: 0 errors, 7 warnings, 131 lines checked I also did not figure out how to run a more complete test of the change. Any pointers as to how would be helpful. Don Slutz (1): CHECKPATCH: Add

[Qemu-devel] [PATCH] CHECKPATCH: Add warning for single else statement.

2012-09-01 Thread Don Slutz
Also add more debug options to find this issue. They were not listed in the help because the are not simple to understand the output of. For an example: WARNING: braces {} are necessary even for single statement blocks +} else +return env->regs[R_EAX]; total: 0 errors, 1 warnings, 4

Re: [Qemu-devel] [PATCH for-1.2 02/11] usb: Halt ep queue en cancel pending packets on a packet error

2012-09-01 Thread Hans de Goede
Hi, On 09/01/2012 04:12 PM, Michael Roth wrote: On Sat, Sep 01, 2012 at 03:37:03PM +0200, Hans de Goede wrote: Hi, On 09/01/2012 12:42 PM, Blue Swirl wrote: On Fri, Aug 31, 2012 at 2:19 PM, Gerd Hoffmann wrote: From: Hans de Goede For controllers which queue up more then 1 packet at a tim

Re: [Qemu-devel] [PATCH for-1.2 02/11] usb: Halt ep queue en cancel pending packets on a packet error

2012-09-01 Thread Peter Maydell
On 1 September 2012 19:47, Hans de Goede wrote: > Ok, so lets change it to a single underscore if people prefer that. Why does this function have any kind of starting-with-underscore name at all? The usual reason for a leading underscore is functions in header files or macros where you don't want

[Qemu-devel] Detecting context switch in QEMU

2012-09-01 Thread Xin Tong
I want to detect context switches in QEMU x86_64-softmmu. one of the ideas i have is to track the write to CR3. is this valid on QEMU ( i.e. are their any cases in which the assumption could break). Xin

Re: [Qemu-devel] [PATCH for-1.2 02/11] usb: Halt ep queue en cancel pending packets on a packet error

2012-09-01 Thread Michael Roth
On Sat, Sep 01, 2012 at 08:47:28PM +0200, Hans de Goede wrote: > Hi, > > On 09/01/2012 04:12 PM, Michael Roth wrote: > >On Sat, Sep 01, 2012 at 03:37:03PM +0200, Hans de Goede wrote: > >>Hi, > >> > >>On 09/01/2012 12:42 PM, Blue Swirl wrote: > >>>On Fri, Aug 31, 2012 at 2:19 PM, Gerd Hoffmann wro

[Qemu-devel] [PATCH] target-i386: Report on error during cpu_x86_register().

2012-09-01 Thread Don Slutz
Send it to stderr before free of the details. Signed-off-by: Don Slutz --- target-i386/cpu.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 57c064f..5c0fef1 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1352,6 +13

[Qemu-devel] [PATCH] dtrace backend: add function to reserved words

2012-09-01 Thread Alon Levy
Signed-off-by: Alon Levy --- scripts/tracetool/backend/dtrace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py index 9cab75c..6be7047 100644 --- a/scripts/tracetool/backend/dtrace.py +++ b/scripts/tra

Re: [Qemu-devel] Detecting context switch in QEMU

2012-09-01 Thread Mulyadi Santosa
On Sun, Sep 2, 2012 at 2:33 AM, Xin Tong wrote: > I want to detect context switches in QEMU x86_64-softmmu. one of the > ideas i have is to track the write to CR3. is this valid on QEMU ( > i.e. are their any cases in which the assumption could break). CMIIW, if context switch happen from a par