[Qemu-devel] [PATCH v9 0/7] monitor: let Monitor be thread safe

2018-05-28 Thread Peter Xu
v9: - two more patches to implement Markus's idea to init monitor earlier (which are patch 5 & 6) - touch up patch 7 to init the fdset lock in monitor_init_globals() v8: - some wording changes according to previous comments [Markus] - return -ENOENT too in stubs/fdset.c:monitor_fdset_get_fd()

[Qemu-devel] [PATCH v9 3/7] monitor: more comments on lock-free elements

2018-05-28 Thread Peter Xu
Add some explicit comments for both Readline and cpu_set/cpu_get helpers that they do not need the mon_lock protection. Signed-off-by: Peter Xu --- monitor.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index d6c3c08932..f23178951e 100644

[Qemu-devel] [PATCH v9 2/7] monitor: protect mon->fds with mon_lock

2018-05-28 Thread Peter Xu
mon->fds were protected by BQL. Now protect it by mon_lock so that it can even be used in monitor iothread. Reviewed-by: Stefan Hajnoczi Reviewed-by: Markus Armbruster Signed-off-by: Peter Xu --- monitor.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff

[Qemu-devel] [PATCH v9 1/7] monitor: rename out_lock to mon_lock

2018-05-28 Thread Peter Xu
The out_lock is protecting a few Monitor fields. In the future the monitor code will start to run in multiple threads. We are going to turn it into a bigger lock to protect not only the out buffer but also most of the rest. Since at it, rearrange the Monitor struct a bit. Reviewed-by: Stefan

Re: [Qemu-devel] [PATCH v7 4/4] monitor: add lock to protect mon_fdsets

2018-05-28 Thread Peter Xu
On Mon, May 28, 2018 at 05:19:08PM +0200, Markus Armbruster wrote: [...] > >> > >> > + * Meanwhile it can also be used even at the end of main. Let's keep > >> > + * it initialized for the whole lifecycle of QEMU. > >> > + */ > >> > >> Awkward question, since our main() is such a tangled

[Qemu-devel] [PATCH] pc-bios/s390-ccw: define loadparm length

2018-05-28 Thread Collin Walling
Loadparm is defined by the s390 architecture to be 8 bytes in length. Let's define this size in the s390-ccw bios. Suggested-by: Laszlo Ersek Signed-off-by: Collin Walling --- pc-bios/s390-ccw/iplb.h | 4 +++- pc-bios/s390-ccw/main.c | 8 pc-bios/s390-ccw/sclp.c | 2 +-

Re: [Qemu-devel] [PATCH v2] aspeed_scu: Implement RNG register

2018-05-28 Thread Joel Stanley
On 29 May 2018 at 01:37, Philippe Mathieu-Daudé wrote: > Hi Joel, > > On 05/28/2018 12:22 PM, Joel Stanley wrote: >> The ASPEED SoCs contain a single register that returns random data when >> read. This models that register so that guests can use it. >> >> The random number data register has a

[Qemu-devel] [PATCH v3] aspeed_scu: Implement RNG register

2018-05-28 Thread Joel Stanley
The ASPEED SoCs contain a single register that returns random data when read. This models that register so that guests can use it. The random number data register has a corresponding control register, however it returns data regardless of the state of the enabled bit, so the model follows this

Re: [Qemu-devel] [PATCH v6 04/10] qcow2: Implement copy offloading

2018-05-28 Thread Fam Zheng
On Mon, 05/28 11:36, Fam Zheng wrote: > The two callbacks are implemented quite similarly to the read/write > functions: bdrv_co_copy_range_from maps for read and calls into bs->file > or bs->backing depending on the allocation status; bdrv_co_copy_range_to > maps for write and calls into

[Qemu-devel] [PATCH v2] ARM: ACPI: Fix use-after-free due to memory realloc

2018-05-28 Thread Shannon Zhao
acpi_data_push uses g_array_set_size to resize the memory size. If there is no enough contiguous memory, the address will be changed. So previous pointer could not be used any more. It must update the pointer and use the new one. Reviewed-by: Eric Auger Reviewed-by: Philippe Mathieu-Daudé

[Qemu-devel] [PATCH] memory: bug 1720969: Make operations using MemoryRegionIoeventfd struct pass by pointer.

2018-05-28 Thread Tristan Burgess
This changes the functions memory_region_ioeventfd_equal, memory_region_ioeventfd_before, and their callers, to pass the MemoryRegionIoeventfd struct via pointer, instead of directly passing the struct. This saves on stack space and is considered safe practice. Signed-off-by: Tristan Burgess

[Qemu-devel] [PATCH] socket: dont't free msgfds if error equals EAGAIN

2018-05-28 Thread linzhecheng
Signed-off-by: linzhecheng diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 159e69c3b1..17519ec589 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -134,8 +134,8 @@ static int tcp_chr_write(Chardev *chr, const uint8_t *buf, int len)

[Qemu-devel] [Bug 1773753] Re: virsh start after virsh managed save hangs and vm goes to paused state with qemu version v2.12.0-813-g5a5c383b13-dirty on powerpc

2018-05-28 Thread Satheesh Rajendran
** Summary changed: - virsh managed save fails with qemu version v2.12.0-813-g5a5c383b13-dirty on powerpc + virsh start after virsh managed save hangs and vm goes to paused state with qemu version v2.12.0-813-g5a5c383b13-dirty on powerpc ** Summary changed: - virsh start after virsh managed

[Qemu-devel] [PATCH v2] vhost-blk: turn on pre-defined RO feature bit

2018-05-28 Thread Changpeng Liu
Read only feature shouldn't be negotiable, because if the backend device reported Read only feature supported, QEMU host driver shouldn't change backend's RO attribute. While here, also enable the vhost-user-blk test utility to test RO feature. Signed-off-by: Changpeng Liu ---

Re: [Qemu-devel] [PATCH v4 15/21] hw/block/nvme: Include "qemu/cutils.h" directly in the source file

2018-05-28 Thread Philippe Mathieu-Daudé
On 05/28/2018 08:27 PM, Philippe Mathieu-Daudé wrote: I forgot to add this commit description: "block/nvme.h" does not require any declaration of "qemu/cutils.h". Simplify dependencies by directly include it in the source file where the declarations are used. > Signed-off-by: Philippe

Re: [Qemu-devel] [PATCH v4 01/21] vfio: Include "exec/address-spaces.h" directly in the source file

2018-05-28 Thread Philippe Mathieu-Daudé
On 05/28/2018 09:06 PM, Michael S. Tsirkin wrote: > On Mon, May 28, 2018 at 05:48:05PM -0600, Alex Williamson wrote: >> On Mon, 28 May 2018 20:26:59 -0300 >> Philippe Mathieu-Daudé wrote: >> >> -ENOCOMMITLOG Oops sorry Alex, I meant to add some, but missed this while rebasing. >> Why? Tangible

Re: [Qemu-devel] [PATCH v4 00/21] Includes cleanup

2018-05-28 Thread Michael S. Tsirkin
On Mon, May 28, 2018 at 08:26:58PM -0300, Philippe Mathieu-Daudé wrote: > Hi, > > I split the previous series "Use the BYTE-based definitions when useful", > this is the first generic part, only headers cleanup, which is big enough. > > Many patches, but "12 insertions(+), 145 deletions(-)" \o/

Re: [Qemu-devel] [PATCH v4 01/21] vfio: Include "exec/address-spaces.h" directly in the source file

2018-05-28 Thread Michael S. Tsirkin
On Mon, May 28, 2018 at 05:48:05PM -0600, Alex Williamson wrote: > On Mon, 28 May 2018 20:26:59 -0300 > Philippe Mathieu-Daudé wrote: > > -ENOCOMMITLOG > > Why? Tangible benefit. Looks like noise. Thanks, > > Alex I agree it should have a commit log, but .c files should be self-sufficient

[Qemu-devel] [PATCH v4 12/21] hw: Do not include "sysemu/block-backend.h" if it is not necessary

2018-05-28 Thread Philippe Mathieu-Daudé
Remove those unneeded includes to speed up the compilation process a little bit. (Continue 7eceff5b5a1fa cleanup) Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/collie.c | 1 - hw/arm/gumstix.c | 1 - hw/arm/mainstone.c |

[Qemu-devel] [PATCH v4 08/21] target/hppa: Include "qemu/log.h" to use qemu_log()

2018-05-28 Thread Philippe Mathieu-Daudé
Since his inception in 61766fe9e2d, this file uses the qemu_log() API from "qemu/log.h". Include it to allow further includes cleanup. Signed-off-by: Philippe Mathieu-Daudé --- target/hppa/int_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/hppa/int_helper.c

[Qemu-devel] [PATCH v4 21/21] hw: Clean "hw/devices.h" includes

2018-05-28 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- This starts the slow process of getting rid of devices.h... --- include/hw/devices.h | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/hw/devices.h b/include/hw/devices.h index 861ddea8af..0e27feb0c2 100644 ---

[Qemu-devel] [PATCH v4 14/21] hw: Do not include "sysemu/blockdev.h" if it is not necessary

2018-05-28 Thread Philippe Mathieu-Daudé
Remove those unneeded includes to speed up the compilation process a little bit. Code change produced with: $ git grep '#include "sysemu/blockdev.h"' | \ cut -d: -f-1 | \ xargs egrep -L "(BlockInterfaceType|DriveInfo|drive_get|blk_legacy_dinfo|blockdev_mark_auto_del)" | \

[Qemu-devel] [PATCH v4 20/21] hw/ide: Remove unused include

2018-05-28 Thread Philippe Mathieu-Daudé
There is no need to include pci.h in this file. (Continue f23c81073a cleanup). Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 866c659498..cc9ca28c33 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@

[Qemu-devel] [PATCH v4 17/21] hw/misc/sga: Use the correct ISA include

2018-05-28 Thread Philippe Mathieu-Daudé
The SGA BIOS loader is an ISA device, it does not require the PCI header. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/sga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/sga.c b/hw/misc/sga.c index 97fd63f176..4a22a52a60 100644 --- a/hw/misc/sga.c +++

[Qemu-devel] [PATCH v4 19/21] hw/i386/pc: Remove unused include

2018-05-28 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index d768930d02..8b0803cb83 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -64,7 +64,6 @@ #include "hw/acpi/acpi.h" #include "hw/acpi/cpu_hotplug.h" #include

Re: [Qemu-devel] [PATCH v4 01/21] vfio: Include "exec/address-spaces.h" directly in the source file

2018-05-28 Thread Alex Williamson
On Mon, 28 May 2018 20:26:59 -0300 Philippe Mathieu-Daudé wrote: -ENOCOMMITLOG Why? Tangible benefit. Looks like noise. Thanks, Alex > Signed-off-by: Philippe Mathieu-Daudé > --- > include/hw/vfio/vfio-common.h | 1 - > hw/vfio/ccw.c | 1 + > hw/vfio/platform.c

[Qemu-devel] [PATCH v4 18/21] hw/hppa: Remove unused include

2018-05-28 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/hppa/hppa_sys.h | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/hppa/hppa_sys.h b/hw/hppa/hppa_sys.h index a182d1f34e..3f6c145120 100644 --- a/hw/hppa/hppa_sys.h +++ b/hw/hppa/hppa_sys.h @@ -3,7 +3,6 @@ #ifndef HW_HPPA_SYS_H #define

[Qemu-devel] [PATCH v4 15/21] hw/block/nvme: Include "qemu/cutils.h" directly in the source file

2018-05-28 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/block/nvme.h | 1 - hw/block/nvme.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme.h b/hw/block/nvme.h index 8f3981121d..cabcf20c32 100644 --- a/hw/block/nvme.h +++ b/hw/block/nvme.h @@ -1,6

[Qemu-devel] [PATCH v4 09/21] target: Do not include "exec/exec-all.h" if it is not necessary

2018-05-28 Thread Philippe Mathieu-Daudé
Code change produced with: $ git grep '#include "exec/exec-all.h"' | \ cut -d: -f-1 | \ xargs egrep -L "(cpu_address_space_init|cpu_loop_|tlb_|tb_|GETPC|singlestep|TranslationBlock)" | \ xargs sed -i.bak '/#include "exec\/exec-all.h"/d' Signed-off-by: Philippe

[Qemu-devel] [PATCH v4 10/21] hw: Do not include "exec/ioport.h" if it is not necessary

2018-05-28 Thread Philippe Mathieu-Daudé
Code change produced with: $ git grep '#include "exec/ioport.h"' hw | \ cut -d: -f-1 | \ xargs egrep -Li "(portio|cpu_(in|out).\()" | \ xargs sed -i.bak '/#include "exec\/ioport.h"/d' Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/pcihp.c | 1 - hw/acpi/piix4.c | 1 - 2

[Qemu-devel] [PATCH v4 13/21] hw: Do not include "sysemu/blockdev.h" if it is not necessary

2018-05-28 Thread Philippe Mathieu-Daudé
The header "hw/boards.h" already includes "sysemu/blockdev.h". Code change produced with: $ git grep '#include "sysemu/blockdev.h"' hw | \ cut -d: -f-1 | \ xargs fgrep -l '#include "hw/boards.h"' | \ xargs sed -i.bak '/#include "sysemu\/blockdev.h"/d' Signed-off-by:

[Qemu-devel] [PATCH v4 07/21] target/ppc: Include "exec/exec-all.h" which provides tlb_flush()

2018-05-28 Thread Philippe Mathieu-Daudé
Since it inception this include uses tlb_flush() declared in "exec/exec-all.h". Include the other header to allow further includes cleanup. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/helper_regs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/target/ppc/helper_regs.h

[Qemu-devel] [PATCH v4 06/21] target/xtensa: Include "qemu/timer.h" to use NANOSECONDS_PER_SECOND

2018-05-28 Thread Philippe Mathieu-Daudé
Since d0ce7e9cfc the dc232b structure uses the NANOSECONDS_PER_SECOND definition from "qemu/timer.h". Include it to allow further includes cleanup. Signed-off-by: Philippe Mathieu-Daudé --- target/xtensa/core-dc232b.c | 1 + 1 file changed, 1 insertion(+) diff --git

[Qemu-devel] [PATCH v4 16/21] hw/misc/mips_itu: Cleanup includes

2018-05-28 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/misc/mips_itu.h | 2 ++ hw/misc/mips_itu.c | 5 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/hw/misc/mips_itu.h b/include/hw/misc/mips_itu.h index b3a4532036..030eb4ac62 100644 ---

[Qemu-devel] [PATCH v4 03/21] target: Do not include "exec/address-spaces.h" if it is not necessary

2018-05-28 Thread Philippe Mathieu-Daudé
Code change produced with: $ git grep '#include "exec/address-spaces.h"' target | \ cut -d: -f-1 | \ xargs egrep -L "(get_system_|address_space_)" | \ xargs sed -i.bak '/#include "exec\/address-spaces.h"/d' Signed-off-by: Philippe Mathieu-Daudé ---

[Qemu-devel] [PATCH v4 11/21] hw: Do not include "exec/address-spaces.h" if it is not necessary

2018-05-28 Thread Philippe Mathieu-Daudé
Code change produced with: $ git grep '#include "exec/address-spaces.h"' hw include/hw | \ cut -d: -f-1 | \ xargs egrep -L "(get_system_|address_space_)" | \ xargs sed -i.bak '/#include "exec\/address-spaces.h"/d' Signed-off-by: Philippe Mathieu-Daudé ---

[Qemu-devel] [PATCH v4 05/21] target/i386: Do not include "exec/ioport.h" if it is not necessary

2018-05-28 Thread Philippe Mathieu-Daudé
Code change produced with: $ git grep '#include "exec/ioport.h"' target | \ cut -d: -f-1 | \ xargs egrep -Li "(portio|cpu_(in|out).\()" | \ xargs sed -i.bak '/#include "exec\/ioport.h"/d' Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hax-all.c | 1 -

[Qemu-devel] [PATCH v4 04/21] memory: Do not include "exec/ioport.h" if it is not necessary

2018-05-28 Thread Philippe Mathieu-Daudé
Code change produced with: $ git grep '#include "exec/ioport.h"' memory.c | \ cut -d: -f-1 | \ xargs egrep -Li "(portio|cpu_(in|out).\()" | \ xargs sed -i.bak '/#include "exec\/ioport.h"/d' Signed-off-by: Philippe Mathieu-Daudé --- memory.c | 1 - 1 file changed, 1

[Qemu-devel] [PATCH v4 00/21] Includes cleanup

2018-05-28 Thread Philippe Mathieu-Daudé
Hi, I split the previous series "Use the BYTE-based definitions when useful", this is the first generic part, only headers cleanup, which is big enough. Many patches, but "12 insertions(+), 145 deletions(-)" \o/ v3 was: http://lists.nongnu.org/archive/html/qemu-devel/2018-04/msg02049.html

[Qemu-devel] [PATCH v4 01/21] vfio: Include "exec/address-spaces.h" directly in the source file

2018-05-28 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/vfio/vfio-common.h | 1 - hw/vfio/ccw.c | 1 + hw/vfio/platform.c| 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index

[Qemu-devel] [PATCH v4 02/21] accel: Do not include "exec/address-spaces.h" if it is not necessary

2018-05-28 Thread Philippe Mathieu-Daudé
Code change produced with: $ git grep '#include "exec/address-spaces.h"' accel | \ cut -d: -f-1 | \ xargs egrep -L "(get_system_|address_space_)" | \ xargs sed -i.bak '/#include "exec\/address-spaces.h"/d' Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 1

Re: [Qemu-devel] storing machine data in qcow images?

2018-05-28 Thread Richard W.M. Jones
On Mon, May 28, 2018 at 08:38:33PM +0200, Kevin Wolf wrote: > Just accessing the image file within a tar archive is possible and we > could write a block driver for that (I actually think we should do > this), but it restricts you because certain operations like resizing > aren't really possible

Re: [Qemu-devel] storing machine data in qcow images?

2018-05-28 Thread Richard W.M. Jones
On Mon, May 28, 2018 at 10:20:54PM +0100, Richard W.M. Jones wrote: > On Mon, May 28, 2018 at 08:38:33PM +0200, Kevin Wolf wrote: > > Just accessing the image file within a tar archive is possible and we > > could write a block driver for that (I actually think we should do > > this), but it

Re: [Qemu-devel] [PATCH] linux-user: SPARC "rd %tick" can be used by user application

2018-05-28 Thread Philippe Mathieu-Daudé
On 05/28/2018 04:48 PM, Laurent Vivier wrote: > we have the same problem decribed in 7d6b1daedd > ("linux-user, ppc: mftbl can be used by user application") > for ppc in the case of sparc. > > When we use an application trying to resolve a name, it hangs in > > 0xff5dd40c: rd

Re: [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc: Use proper logging function for possible guest errors

2018-05-28 Thread Greg Kurz
On Mon, 28 May 2018 20:11:19 +0200 Thomas Huth wrote: > fprintf() and qemu_log_separate() are frowned upon these days for printing > logging information in QEMU. Accessing the wrong SPRs indicates wrong guest > behaviour in most cases, and we've got a proper way to log such situations, > which

[Qemu-devel] [PATCH] linux-user: SPARC "rd %tick" can be used by user application

2018-05-28 Thread Laurent Vivier
we have the same problem decribed in 7d6b1daedd ("linux-user, ppc: mftbl can be used by user application") for ppc in the case of sparc. When we use an application trying to resolve a name, it hangs in 0xff5dd40c: rd %tick, %o5 0xff5dd410: srlx %o5, 0x20, %o4

Re: [Qemu-devel] storing machine data in qcow images?

2018-05-28 Thread Kevin Wolf
Am 28.05.2018 um 20:44 hat Max Reitz geschrieben: > On 2018-05-28 20:38, Kevin Wolf wrote: > > Am 28.05.2018 um 20:30 hat Richard W.M. Jones geschrieben: > >> On Mon, May 28, 2018 at 08:10:32PM +0200, Max Reitz wrote: > >>> As someone who is just naive and doesn't see the big picture, I don't >

Re: [Qemu-devel] [PATCH v1] xlnx-zdma: Correct mem leaks and memset to zero on desc unaligned errors

2018-05-28 Thread Philippe Mathieu-Daudé
On 05/28/2018 03:58 PM, Edgar E. Iglesias wrote: > On Mon, May 28, 2018 at 08:48:59PM +0200, Francisco Iglesias wrote: >> Coverity found that the string return by 'object_get_canonical_path' was not >> being freed at two locations in the model (CID 1391294 and CID 1391293) and >> also that a

Re: [Qemu-devel] [PATCH v1] xlnx-zdma: Correct mem leaks and memset to zero on desc unaligned errors

2018-05-28 Thread Edgar E. Iglesias
On Mon, May 28, 2018 at 08:48:59PM +0200, Francisco Iglesias wrote: > Coverity found that the string return by 'object_get_canonical_path' was not > being freed at two locations in the model (CID 1391294 and CID 1391293) and > also that a memset was being called with a value greater than the max

[Qemu-devel] [PATCH v2] linux-user: Remove extra mapping

2018-05-28 Thread Steve Mcpolin
When a guest mmap()'d a file, a transient MAP_ANONYMOUS mapping was created, which required the kernel to reserve this memory, then subsequently released by applying a mapping with just the requested flags and fd. This transient mapping causes spurious failures when the available memory is smaller

Re: [Qemu-devel] storing machine data in qcow images?

2018-05-28 Thread Max Reitz
On 2018-05-28 20:38, Kevin Wolf wrote: > Am 28.05.2018 um 20:30 hat Richard W.M. Jones geschrieben: >> On Mon, May 28, 2018 at 08:10:32PM +0200, Max Reitz wrote: >>> As someone who is just naive and doesn't see the big picture, I don't >>> see what's wrong with using a tar file that contains the

Re: [Qemu-devel] [Qemu-trivial] [PATCH] target/ppc: Use proper logging function for possible guest errors

2018-05-28 Thread Philippe Mathieu-Daudé
On 05/28/2018 03:11 PM, Thomas Huth wrote: > fprintf() and qemu_log_separate() are frowned upon these days for printing > logging information in QEMU. Accessing the wrong SPRs indicates wrong guest > behaviour in most cases, and we've got a proper way to log such situations, > which is the

[Qemu-devel] [PATCH v1] xlnx-zdma: Correct mem leaks and memset to zero on desc unaligned errors

2018-05-28 Thread Francisco Iglesias
Coverity found that the string return by 'object_get_canonical_path' was not being freed at two locations in the model (CID 1391294 and CID 1391293) and also that a memset was being called with a value greater than the max of a byte on the second argument (CID 1391286). This patch corrects this by

Re: [Qemu-devel] storing machine data in qcow images?

2018-05-28 Thread Richard W.M. Jones
On Mon, May 28, 2018 at 08:10:32PM +0200, Max Reitz wrote: > As someone who is just naive and doesn't see the big picture, I don't > see what's wrong with using a tar file that contains the image and > additional data. FWIW an OVA file is exactly this: an uncompressed tar file containing disk

Re: [Qemu-devel] storing machine data in qcow images?

2018-05-28 Thread Max Reitz
On 2018-05-24 13:32, Richard W.M. Jones wrote: > I read the whole thread and the fundamental problem is that you're > mixing layers. Let qcow2 be a disk image format, and let management > layers deal with metadata and how to run qemu. > > What's going to happen when you have (eg) an OVA file

Re: [Qemu-devel] storing machine data in qcow images?

2018-05-28 Thread Kevin Wolf
Am 28.05.2018 um 20:30 hat Richard W.M. Jones geschrieben: > On Mon, May 28, 2018 at 08:10:32PM +0200, Max Reitz wrote: > > As someone who is just naive and doesn't see the big picture, I don't > > see what's wrong with using a tar file that contains the image and > > additional data. > > FWIW an

[Qemu-devel] [PATCH] target/ppc: Use proper logging function for possible guest errors

2018-05-28 Thread Thomas Huth
fprintf() and qemu_log_separate() are frowned upon these days for printing logging information in QEMU. Accessing the wrong SPRs indicates wrong guest behaviour in most cases, and we've got a proper way to log such situations, which is the qemu_log_mask(LOG_GUEST_ERROR, ...) function. So use this

Re: [Qemu-devel] [RFC v2 5/6] hw/arm: ACPI SRAT changes to accommodate non-contiguous mem

2018-05-28 Thread Andrew Jones
On Wed, May 16, 2018 at 04:20:25PM +0100, Shameer Kolothum wrote: > This is in preparation for the next patch where initial ram is split > into a non-pluggable chunk and a pc-dimm modeled mem if the vaild > iova regions are non-contiguous. > > Signed-off-by: Shameer Kolothum > --- >

Re: [Qemu-devel] [RFC v2 2/6] hw/arm/virt: Enable dynamic generation of guest RAM memory regions

2018-05-28 Thread Andrew Jones
On Wed, May 16, 2018 at 04:20:22PM +0100, Shameer Kolothum wrote: > Register ram_memory_region_init notifier to allocate memory region > from system memory. > > Signed-off-by: Zhu Yijun > Signed-off-by: Shameer Kolothum > --- >

Re: [Qemu-devel] [Qemu-arm] [PATCH] ARM: ACPI: Fix use-after-free due to memory realloc

2018-05-28 Thread Philippe Mathieu-Daudé
On 05/28/2018 05:42 AM, Shannon Zhao wrote: > acpi_data_push uses g_array_set_size to resize the memory size. If there > is no enough contiguous memory, the address will be changed. So previous > pointer could not be used any more. It must update the pointer and use > the new one. > >

Re: [Qemu-devel] [PATCH v2] aspeed_scu: Implement RNG register

2018-05-28 Thread Philippe Mathieu-Daudé
Hi Joel, On 05/28/2018 12:22 PM, Joel Stanley wrote: > The ASPEED SoCs contain a single register that returns random data when > read. This models that register so that guests can use it. > > The random number data register has a corresponding control register, > data returns a different number

Re: [Qemu-devel] [PATCH v2] Remove unwanted crlf conversion in serial

2018-05-28 Thread Paolo Bonzini
On 23/05/2018 21:50, Patryk Olszewski wrote: > This patch fixes bug in serial that made it almost impossible for guest > to communicate with devices through host's serial. > > OPOST flag in c_oflag enables output processing letting other flags in > c_oflag take effect. Usually in c_oflag ONLCR

Re: [Qemu-devel] [PATCH v2] Remove unwanted crlf conversion in serial

2018-05-28 Thread Paolo Bonzini
On 24/05/2018 07:36, Thomas Huth wrote: > On 23.05.2018 21:50, Patryk Olszewski wrote: >> This patch fixes bug in serial that made it almost impossible for guest >> to communicate with devices through host's serial. >> >> OPOST flag in c_oflag enables output processing letting other flags in >>

Re: [Qemu-devel] [PATCH 4/4] spapr: introduce a new IRQ backend using fixed IRQ number ranges

2018-05-28 Thread Cédric Le Goater
On 05/28/2018 05:18 PM, Greg Kurz wrote: > On Fri, 18 May 2018 18:44:05 +0200 > Cédric Le Goater wrote: > >> The proposed layout of the IRQ number space is organized as follow : >> >>RANGES DEVICES >> >>0x - 0x0FFFReserved for future use (IPI = 2) >>

Re: [Qemu-devel] [PATCH v4 0/4] qdev: remove DeviceClass::init/exit()

2018-05-28 Thread Philippe Mathieu-Daudé
On 05/28/2018 12:39 PM, Paolo Bonzini wrote: > On 28/05/2018 16:45, Markus Armbruster wrote: >> This lovely series got stuck after v3, so I took the liberty to respin >> it. >> >> v4: >> * PATCH 1+2 unchanged >> * PATCH 3+4 reshuffled a bit, missing documentation updates supplied > > At long

Re: [Qemu-devel] [PATCH v4 0/4] qdev: remove DeviceClass::init/exit()

2018-05-28 Thread Paolo Bonzini
On 28/05/2018 16:45, Markus Armbruster wrote: > This lovely series got stuck after v3, so I took the liberty to respin > it. > > v4: > * PATCH 1+2 unchanged > * PATCH 3+4 reshuffled a bit, missing documentation updates supplied At long last! Queued,t hanks. Paolo

Re: [Qemu-devel] [PATCH v2] aspeed_scu: Implement RNG register

2018-05-28 Thread Cédric Le Goater
On 05/28/2018 05:22 PM, Joel Stanley wrote: > The ASPEED SoCs contain a single register that returns random data when > read. This models that register so that guests can use it. > > The random number data register has a corresponding control register, > data returns a different number regardless

Re: [Qemu-devel] [RFC PATCH] mmio-exec: Make device return MemoryRegion rather than host pointer

2018-05-28 Thread Cédric Le Goater
On 05/28/2018 07:22 AM, Cédric Le Goater wrote: > On 04/26/2018 05:09 PM, Peter Maydell wrote: >> Our current interface for allowing a device to support execution from >> MMIO regions has the device return a pointer into host memory >> containing the contents to be used for execution.

[Qemu-devel] [PATCH v2] aspeed_scu: Implement RNG register

2018-05-28 Thread Joel Stanley
The ASPEED SoCs contain a single register that returns random data when read. This models that register so that guests can use it. The random number data register has a corresponding control register, data returns a different number regardless of the state of the enabled bit, so the model follows

Re: [Qemu-devel] [PATCH v7 4/4] monitor: add lock to protect mon_fdsets

2018-05-28 Thread Markus Armbruster
Peter Xu writes: > On Thu, May 24, 2018 at 11:03:55AM +0200, Markus Armbruster wrote: >> Peter Xu writes: >> >> > Similar to previous patch, but introduce a new global big lock for >> > mon_fdsets. Take it where needed. >> >> The previous patch is

Re: [Qemu-devel] [PATCH 4/4] spapr: introduce a new IRQ backend using fixed IRQ number ranges

2018-05-28 Thread Greg Kurz
On Fri, 18 May 2018 18:44:05 +0200 Cédric Le Goater wrote: > The proposed layout of the IRQ number space is organized as follow : > >RANGES DEVICES > >0x - 0x0FFFReserved for future use (IPI = 2) >0x1000 - 0x10001 EPOW >0x1001 - 0x1001

[Qemu-devel] [PATCH] qcow2: Fix Coverity warning when calculating the refcount cache size

2018-05-28 Thread Alberto Garcia
MIN_REFCOUNT_CACHE_SIZE is 4 and the cluster size is guaranteed to be at most 2MB, so the minimum refcount cache size (in bytes) is always going to fit in a 32-bit integer. Coverity doesn't know that, and since we're storing the result in a uint64_t (*refcount_cache_size) it thinks that we need

Re: [Qemu-devel] [PATCH] aspeed_scu: Implement RNG register

2018-05-28 Thread Cédric Le Goater
On 05/28/2018 04:29 PM, Joel Stanley wrote: > On 28 May 2018 at 23:33, Joel Stanley wrote: >> On 28 May 2018 at 23:17, Cédric Le Goater wrote: >>> Hello Joel, >>> >>> On 05/28/2018 02:46 PM, Joel Stanley wrote: The ASPEED SoCs contain a single register that

[Qemu-devel] [PATCH v4 2/4] hw/i2c: Use DeviceClass::realize instead of I2CSlaveClass::init

2018-05-28 Thread Markus Armbruster
From: Philippe Mathieu-Daudé I2CSlaveClass::init is no more used, remove it. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20180419212727.26095-3-f4...@amsat.org> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster

[Qemu-devel] [PATCH v4 4/4] qdev: Remove DeviceClass::init() and ::exit()

2018-05-28 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Since no devices use it, we can safely remove it. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20180419212727.26095-5-f4...@amsat.org> Reviewed-by: Markus Armbruster [Removal of DeviceClass::init() moved

[Qemu-devel] [PATCH v4 1/4] hw/i2c/smbus: Use DeviceClass::realize instead of SMBusDeviceClass::init

2018-05-28 Thread Markus Armbruster
From: Philippe Mathieu-Daudé SMBusDeviceClass::init is no more used, remove it. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20180419212727.26095-2-f4...@amsat.org> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster

[Qemu-devel] [PATCH v4 3/4] qdev: Simplify the SysBusDeviceClass::init path

2018-05-28 Thread Markus Armbruster
From: Philippe Mathieu-Daudé Instead of using SysBusDeviceClass::realize -> DeviceClass::realize -> DeviceClass::init -> sysbus_device_init -> SysBusDeviceClass::init Simplify the path by directly calling SysBusDeviceClass::init in

[Qemu-devel] [PATCH v4 0/4] qdev: remove DeviceClass::init/exit()

2018-05-28 Thread Markus Armbruster
This lovely series got stuck after v3, so I took the liberty to respin it. v4: * PATCH 1+2 unchanged * PATCH 3+4 reshuffled a bit, missing documentation updates supplied Philippe's cover letter: Since v2: - rebased for 2.13 (Markus) - dropped 2 patches already merged (Gerd) - start

Re: [Qemu-devel] [PATCH] aspeed_scu: Implement RNG register

2018-05-28 Thread Joel Stanley
On 28 May 2018 at 23:33, Joel Stanley wrote: > On 28 May 2018 at 23:17, Cédric Le Goater wrote: >> Hello Joel, >> >> On 05/28/2018 02:46 PM, Joel Stanley wrote: >>> The ASPEED SoCs contain a single register that returns random data when >>> read. This models that

Re: [Qemu-devel] [PATCH 3/4] spapr: introduce a generic IRQ frontend to the machine

2018-05-28 Thread Greg Kurz
On Fri, 18 May 2018 18:44:04 +0200 Cédric Le Goater wrote: > This proposal moves all the related IRQ routines of the sPAPR machine > behind a class interface to prepare for future changes in the IRQ > controller model. First of which is a reorganization of the IRQ number > space

[Qemu-devel] Cortex M0 emulation tasks

2018-05-28 Thread Stefan Hajnoczi
Hi, I took a look at what's required for ARM Cortex M0 emulation that we need for the micro:bit ARM board. The following notes are based on Appendix D3 of the ARMv6-M Architecture Reference Manual that Peter Maydell recommended. Several people can work on this since there are many smaller tasks.

Re: [Qemu-devel] [RFC v2 2/6] hw/arm/virt: Enable dynamic generation of guest RAM memory regions

2018-05-28 Thread Auger Eric
Hi Shameer, On 05/16/2018 05:20 PM, Shameer Kolothum wrote: > Register ram_memory_region_init notifier to allocate memory region > from system memory. At this stage the commit message does not explain why you need a machine init done notifier. Also the commit title does not summarize the actual

Re: [Qemu-devel] [RFC v2 0/6] hw/arm: Add support for non-contiguous iova regions

2018-05-28 Thread Auger Eric
Hi Shameer, On 05/16/2018 05:20 PM, Shameer Kolothum wrote: > When the kernel reports valid iova ranges as non-contiguous, > memory should be allocated to Guest in such a way that > reserved regions(holes) are not visible by Guest. > > This series retrieves the valid iova ranges based on the new

Re: [Qemu-devel] [RFC v2 3/6] hw/arm/virt: Add pc-dimm mem hotplug framework

2018-05-28 Thread Auger Eric
Hi Shameer, On 05/16/2018 05:20 PM, Shameer Kolothum wrote: > This will be used in subsequent patches to model a chunk of > memory as pc-dimm(cold plug) if the valid iova regions are > non-contiguous. This is not yet a full hotplug support. Please can you give more details about this restriction?

Re: [Qemu-devel] [RFC v2 5/6] hw/arm: ACPI SRAT changes to accommodate non-contiguous mem

2018-05-28 Thread Auger Eric
Hi Shameer, On 05/16/2018 05:20 PM, Shameer Kolothum wrote: > This is in preparation for the next patch where initial ram is split > into a non-pluggable chunk and a pc-dimm modeled mem if the vaild valid > iova regions are non-contiguous. > > Signed-off-by: Shameer Kolothum

Re: [Qemu-devel] [RFC v2 4/6] hw/arm: Changes required to accommodate non-contiguous DT mem nodes

2018-05-28 Thread Auger Eric
Hi Shameer, On 05/16/2018 05:20 PM, Shameer Kolothum wrote: > This makes changes to the DT mem node creation such that its easier > to add non-contiguous mem modeled as non-pluggable and a pc-dimm > mem later. See comments below. I think you should augment the description here with what the patch

Re: [Qemu-devel] [RFC v2 6/6] hw/arm: Populate non-contiguous memory regions

2018-05-28 Thread Auger Eric
Hi Shameer, On 05/16/2018 05:20 PM, Shameer Kolothum wrote: > In case valid iova regions are non-contiguous, split the > RAM mem into a 1GB non-pluggable dimm and remaining as a > single pc-dimm mem. Please can you explain where does this split come from? Currently we have 254 GB non pluggable

Re: [Qemu-devel] [RFC v2 1/6] hw/vfio: Retrieve valid iova ranges from kernel

2018-05-28 Thread Auger Eric
Hi Shameer, On 05/16/2018 05:20 PM, Shameer Kolothum wrote: > This makes use of the newly introduced iova cap chains added > to the type1 VFIO_IOMMU_GET_INFO ioctl. > > The retrieved iova info is stored in a list for later use. > > Signed-off-by: Shameer Kolothum

Re: [Qemu-devel] [PATCH] aspeed_scu: Implement RNG register

2018-05-28 Thread Joel Stanley
On 28 May 2018 at 23:17, Cédric Le Goater wrote: > Hello Joel, > > On 05/28/2018 02:46 PM, Joel Stanley wrote: >> The ASPEED SoCs contain a single register that returns random data when >> read. This models that register so that guests can use it. >> >> Signed-off-by: Joel Stanley

Re: [Qemu-devel] [PULL 20/37] qcow2: Give the refcount cache the minimum possible size by default

2018-05-28 Thread Alberto Garcia
On Mon 28 May 2018 03:49:07 PM CEST, Peter Maydell wrote: > On 28 May 2018 at 09:58, Alberto Garcia wrote: >> On Mon 28 May 2018 10:38:55 AM CEST, Kevin Wolf wrote: > +if (!refcount_cache_size_set) { > +*refcount_cache_size = MIN_REFCOUNT_CACHE_SIZE

Re: [Qemu-devel] [PATCH 02/13] 9p: Avoid warning if FS_IOC_GETVERSION is not defined

2018-05-28 Thread Greg Kurz
On Sat, 26 May 2018 01:23:04 -0400 k...@juliacomputing.com wrote: > From: Keno Fischer > > Signed-off-by: Keno Fischer > --- > hw/9pfs/9p-local.c | 39 +++ > 1 file changed, 19 insertions(+), 20 deletions(-)

Re: [Qemu-devel] [PULL 20/37] qcow2: Give the refcount cache the minimum possible size by default

2018-05-28 Thread Peter Maydell
On 28 May 2018 at 09:58, Alberto Garcia wrote: > On Mon 28 May 2018 10:38:55 AM CEST, Kevin Wolf wrote: >>> > +if (!refcount_cache_size_set) { >>> > +*refcount_cache_size = MIN_REFCOUNT_CACHE_SIZE * >>> > s->cluster_size; >>> >>> ...but in the else clause

Re: [Qemu-devel] [PATCH] aspeed_scu: Implement RNG register

2018-05-28 Thread Cédric Le Goater
Hello Joel, On 05/28/2018 02:46 PM, Joel Stanley wrote: > The ASPEED SoCs contain a single register that returns random data when > read. This models that register so that guests can use it. > > Signed-off-by: Joel Stanley > --- > hw/misc/aspeed_scu.c | 19 +++

Re: [Qemu-devel] What is the best git-way to add a new board?

2018-05-28 Thread Peter Maydell
On 28 May 2018 at 06:02, Philippe Mathieu-Daudé wrote: > 1/ how RISC-V boards got merged > > Add devices individually, > finally add the board and default-configs/Makefile rules at once. > > PRO: commits are easier to cherry-pick/rebase > CON: you can not test a single patch

Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/4] spapr: remove irq_hint parameter from spapr_irq_alloc()

2018-05-28 Thread Cédric Le Goater
On 05/28/2018 02:09 PM, Greg Kurz wrote: > On Mon, 28 May 2018 11:20:36 +0200 > Cédric Le Goater wrote: > >> On 05/28/2018 09:18 AM, Thomas Huth wrote: >>> On 28.05.2018 09:06, Cédric Le Goater wrote: On 05/28/2018 08:17 AM, Thomas Huth wrote: > On 25.05.2018 16:02,

[Qemu-devel] [Bug 1773753] Re: virsh managed save fails with qemu version v2.12.0-813-g5a5c383b13-dirty on powerpc

2018-05-28 Thread Satheesh Rajendran
followed by further attempts saves the domains as reported but issue still same. #virsh managedsave avocado-vt-vm1 Domain avocado-vt-vm1 state saved by libvirt # virsh start avocado-vt-vm1 hung # virsh list --all IdName State

Re: [Qemu-devel] [PATCH 42/42] qemu-iotests: Test job-* with block jobs

2018-05-28 Thread Max Reitz
On 2018-05-17 15:50, Kevin Wolf wrote: > Am 15.05.2018 um 01:44 hat Max Reitz geschrieben: >> On 2018-05-09 18:26, Kevin Wolf wrote: >>> This adds a test case that tests the new job-* QMP commands with >>> mirror and backup block jobs. >>> >>> Signed-off-by: Kevin Wolf >>> ---

Re: [Qemu-devel] [PATCH 13/13] 9p: darwin: configure: Allow VirtFS on Darwin

2018-05-28 Thread Greg Kurz
On Sat, 26 May 2018 01:23:15 -0400 k...@juliacomputing.com wrote: > From: Keno Fischer > > Signed-off-by: Keno Fischer > --- > Makefile.objs | 1 + > configure | 23 +++ > 2 files changed, 16 insertions(+), 8

Re: [Qemu-devel] [PATCH v2 1/1] sandbox: disable -sandbox if CONFIG_SECCOMP undefined

2018-05-28 Thread Yi Min Zhao
在 2018/5/25 下午5:36, Eduardo Otubo 写道: On 05/25/2018 06:23 AM, Yi Min Zhao wrote: 在 2018/5/24 下午9:40, Paolo Bonzini 写道: On 24/05/2018 09:53, Eduardo Otubo wrote: Thanks! But I have not got response from Paolo.  I have added him to CC list.   I'll just wait one more ACK and will send a

[Qemu-devel] [Bug 1773753] Re: virsh managed save fails with qemu version v2.12.0-813-g5a5c383b13-dirty on powerpc

2018-05-28 Thread Satheesh Rajendran
with above patch compiled on top of latest upstream fails with below error: # virsh managedsave avocado-vt-vm1 error: Failed to save domain avocado-vt-vm1 state error: internal error: guest unexpectedly quit rest of the behaviour same.. # virsh start avocado-vt-vm1 gets hung ---crtl+c -->

  1   2   >