Re: [Qemu-devel] [PATCH v4] log: Make glib logging go through QEMU

2019-01-15 Thread Stefan Hajnoczi
On Mon, Jan 14, 2019 at 12:54:20PM +0100, Christophe Fergeau wrote: > On Fri, Jan 04, 2019 at 03:40:34PM +, Stefan Hajnoczi wrote: > > On Thu, Jan 03, 2019 at 03:14:55PM +0100, Christophe Fergeau wrote: > > > Hey, > > > > > > On Thu, Jan 03, 2019 at 10:54:25AM +, Stefan Hajnoczi wrote: > >

Re: [Qemu-devel] [PATCH v2 0/4] pvh: add new PVH option rom

2019-01-15 Thread Stefan Hajnoczi
On Tue, Jan 15, 2019 at 11:00:54AM +0100, Stefano Garzarella wrote: > This patch series is based on "[RFC v2 0/4] QEMU changes to do PVH boot" and > provides a PVH option rom that can be used with SeaBIOS to boot uncompressed > kernel using the x86/HVM direct boot ABI. > > Patches 1 and 2 are to p

[Qemu-devel] [PATCH 01/12] chardev: fix validation of options for QMP created chardevs

2019-01-15 Thread Daniel P . Berrangé
The TLS creds option is not valid with certain address types. The user config was only checked for errors when parsing legacy QemuOpts, thus the user could pass unsupported values via QMP. Pull all code for validating options out into a new method qmp_chardev_validate_socket, that is called from t

[Qemu-devel] [PATCH 03/12] chardev: forbid 'wait' option with client sockets

2019-01-15 Thread Daniel P . Berrangé
The 'wait'/'nowait' parameter is used to tell server sockets whether to block until a client is accepted during initialization. Client chardevs have always silently ignored this option. Various tests were mistakenly passing this option for their client chardevs. Signed-off-by: Daniel P. Berrangé

[Qemu-devel] [PATCH] hw/core/generic-loader: Fix PC overwriting

2019-01-15 Thread Julia Suvorova via Qemu-devel
If the memory is set using a file, and PC is specified on the command line, it will be overwritten with the value 'entry'. This is not only illogical, but also incorrect, because the load_ * functions do not take into account the specifics of the ARM-M PC. Signed-off-by: Julia Suvorova --- hw/co

[Qemu-devel] [PATCH 06/12] chardev: remove unused 'sioc' variable & cleanup paths

2019-01-15 Thread Daniel P . Berrangé
The 'sioc' variable in qmp_chardev_open_socket was unused since commit 3e7d4d20d3a528b1ed10b1dc3d83119bfb0c5f24 Author: Peter Xu Date: Tue Mar 6 13:33:17 2018 +0800 chardev: use chardev's gcontext for async connect Signed-off-by: Daniel P. Berrangé --- chardev/char-socket.c | 22 +

Re: [Qemu-devel] [PATCH] include/fpu/softfloat: Fix compilation with Clang on s390x

2019-01-15 Thread Alex Bennée
Peter Maydell writes: > On Mon, 14 Jan 2019 at 22:48, Alex Bennée wrote: >> >> >> Richard Henderson writes: >> > But perhaps >> > >> > unsigned __int128 n = (unsigned __int128)n1 << 64 | n0; >> > *r = n % d; >> > return n / d; >> > >> > will allow the compiler to do what the assem

Re: [Qemu-devel] [PATCH v3 11/19] nbd/client: Split out nbd_receive_one_meta_context()

2019-01-15 Thread Vladimir Sementsov-Ogievskiy
12.01.2019 20:58, Eric Blake wrote: > Extract portions of nbd_negotiate_simple_meta_context() to > a new function nbd_receive_one_meta_context() that copies the > pattern of nbd_receive_list() for performing the argument > validation of one reply. The error message when the server > replies with m

Re: [Qemu-devel] [PATCH v4 for-4.0 4/7] libvhost-user: Support tracking inflight I/O in shared memory

2019-01-15 Thread Yongji Xie
On Tue, 15 Jan 2019 at 15:52, Jason Wang wrote: > > > On 2019/1/11 下午2:10, Yongji Xie wrote: > > On Fri, 11 Jan 2019 at 11:56, Jason Wang wrote: > >> > >> On 2019/1/9 下午7:27, elohi...@gmail.com wrote: > >>> From: Xie Yongji > >>> > >>> This patch adds support for VHOST_USER_GET_INFLIGHT_FD and >

[Qemu-devel] [PATCH 04/12] chardev: remove many local variables in qemu_chr_parse_socket

2019-01-15 Thread Daniel P . Berrangé
Now that all validation is separated off into a separate method, we can directly populate the ChardevSocket struct from the QemuOpts values, avoiding many local variables. Signed-off-by: Daniel P. Berrangé --- chardev/char-socket.c | 40 ++-- 1 file changed, 1

Re: [Qemu-devel] MTTCG qemu-softmmu aborted on watchpoint hit by atomic instruction

2019-01-15 Thread Emilio G. Cota
On Mon, Jan 14, 2019 at 18:49:43 -0800, Max Filippov wrote: > Hello, > > I tried to debug guest application on SMP xtensa softmmu QEMU > through the gdbserver and found that QEMU aborts when guest > uses atomic operation to modify memory location watched by the > debugger. It exits with the follow

[Qemu-devel] [PATCH 08/12] chardev: split up qmp_chardev_open_socket connection code

2019-01-15 Thread Daniel P . Berrangé
In qmp_chardev_open_socket the code for connecting client chardevs is split across two conditionals far apart with some server chardev code in the middle. Split up the method so that code for client connection setup is separate from code for server connection setup. Signed-off-by: Daniel P. Berran

[Qemu-devel] [PATCH 10/12] chardev: honour the reconnect setting in tcp_chr_wait_connected

2019-01-15 Thread Daniel P . Berrangé
If establishing a client connection fails, the tcp_chr_wait_connected method should sleep for the reconnect timeout and then retry the attempt. This ensures the callers don't immediately abort with an error when the initial connection fails. Signed-off-by: Daniel P. Berrangé --- chardev/char-soc

[Qemu-devel] [PATCH 09/12] chardev: use a state machine for socket connection state

2019-01-15 Thread Daniel P . Berrangé
The socket connection state is indicated via the 'bool connected' field in the SocketChardev struct. This variable is somewhat misleading though, as it is only set to true once the connection has completed all required handshakes (eg for TLS, telnet or websockets). IOW there is a period of time in

[Qemu-devel] [PATCH 00/12] chardev: refactoring & many bugfixes related tcp_chr_wait_connected

2019-01-15 Thread Daniel P . Berrangé
This series comes out of a discussion between myself & Yongji Xie in: https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg01881.html I eventually understood that the problem faced was that tcp_chr_wait_connected was racing with the background connection attempt previously started, causing

[Qemu-devel] [PATCH 02/12] chardev: forbid 'reconnect' option with server sockets

2019-01-15 Thread Daniel P . Berrangé
The 'reconnect' option is used to give the sleep time, in seconds, before a client socket attempts to re-establish a connection to the server. It does not make sense to set this for server sockets, as they will always accept a new client connection immediately after the previous one went away. Sig

[Qemu-devel] [PATCH 11/12] chardev: disallow TLS/telnet/websocket with tcp_chr_wait_connected

2019-01-15 Thread Daniel P . Berrangé
In the previous commit commit 1dc8a6695c731abb7461c637b2512c3670d82be4 Author: Marc-André Lureau Date: Tue Aug 16 12:33:32 2016 +0400 char: fix waiting for TLS and telnet connection the tcp_chr_wait_connected() method was changed to check for a non-NULL 's->ioc' as a sign th

Re: [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99

2019-01-15 Thread Daniel P . Berrangé
On Tue, Jan 15, 2019 at 03:32:10PM +0100, Thomas Huth wrote: > On 2019-01-15 14:16, Peter Maydell wrote: > > On Mon, 14 Jan 2019 at 17:45, Thomas Huth wrote: > >> > >> Hi Peter! > >> > >> The following changes since commit > >> 7260438b7056469610ee166f7abe9ff8a26b8b16: > >> > >> Merge remote-t

[Qemu-devel] [PATCH 05/12] chardev: ensure qemu_chr_parse_compat reports missing driver error

2019-01-15 Thread Daniel P . Berrangé
If no valid char driver was identified the qemu_chr_parse_compat method was silent, leaving callers no clue what failed. Signed-off-by: Daniel P. Berrangé --- chardev/char.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chardev/char.c b/chardev/char.c index ccba36bafb..b99f3692f7 100644

Re: [Qemu-devel] [PATCH v4] log: Make glib logging go through QEMU

2019-01-15 Thread Christophe Fergeau
On Tue, Jan 15, 2019 at 02:09:12PM +, Stefan Hajnoczi wrote: > > In these codepaths, I'm confident up to > > void monitor_vfprintf(FILE *stream, const char *fmt, va_list ap) > > { > > if (cur_mon && !monitor_cur_is_qmp()) { > > monitor_vprintf(cur_mon, fmt, ap); > > } else { > >

[Qemu-devel] [PATCH] egl-helpers.h: add a missing X11 include

2019-01-15 Thread Alexander Kanavin
Otherwise these errors occur, when qemu is built in the Yocto project: | In file included from /home/alexander/development/poky/build-virgl-gtk-64/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-qemu/3.1.0-r0/qemu-3.1.0/include/ui/egl-context.h:5, | from /home/alexander/develop

[Qemu-devel] [Bug 1811758] Re: virtio-rng backend should use getentropy() syscall when available

2019-01-15 Thread dkg
To be clear, the problem with using /dev/urandom as a backend is that it's possible to feed data from an uninitialized pool into the guest. and the problem with using /dev/random as a backend is that it's possible for a guest to starve the other host (and other guests) of entropy, since it pulls f

[Qemu-devel] [Bug 1811758] [NEW] virtio-rng backend should use getentropy() syscall when available

2019-01-15 Thread dkg
Public bug reported: According to https://wiki.qemu.org/Features/VirtIORNG the default backend for `virtio-rng-pci` is `/dev/random`. Alternately, the user can point it to a different backend file, like `/dev/urandom`. However, both of these files have suboptimal behavior in one way or another,

Re: [Qemu-devel] [PATCH v12 09/10] qcow2: skip writing zero buffers to empty COW areas

2019-01-15 Thread Alberto Garcia
On Mon 14 Jan 2019 12:18:30 PM CET, Anton Nefedov wrote: > If COW areas of the newly allocated clusters are zeroes on the backing image, > efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole > cluster instead of writing explicit zero buffers later in perform_cow(). > > iot

Re: [Qemu-devel] [PATCH] include/fpu/softfloat: Fix compilation with Clang on s390x

2019-01-15 Thread Thomas Huth
On 2019-01-15 15:46, Alex Bennée wrote: > > Peter Maydell writes: > >> On Mon, 14 Jan 2019 at 22:48, Alex Bennée wrote: >>> >>> >>> Richard Henderson writes: But perhaps unsigned __int128 n = (unsigned __int128)n1 << 64 | n0; *r = n % d; return n / d;

Re: [Qemu-devel] [PATCH v3 04/19] nbd/server: Hoist length check to qemp_nbd_server_add

2019-01-15 Thread Eric Blake
On 1/15/19 3:44 AM, Vladimir Sementsov-Ogievskiy wrote: > 12.01.2019 20:57, Eric Blake wrote: >> We only had two callers to nbd_export_new; qemu-nbd.c always >> passed a valid offset/length pair (because it already checked >> the file length, to ensure that offset was in bounds), while >> blockdev-

Re: [Qemu-devel] [PATCH v3 05/19] nbd/server: Favor [u]int64_t over off_t

2019-01-15 Thread Eric Blake
On 1/15/19 4:19 AM, Vladimir Sementsov-Ogievskiy wrote: > 12.01.2019 20:57, Eric Blake wrote: >> Although our compile-time environment is set up so that we always >> support long files with 64-bit off_t, we have no guarantee whether >> off_t is the same type as int64_t. This requires casts when >>

Re: [Qemu-devel] [PATCH v3 13/19] nbd/client: Split handshake into two functions

2019-01-15 Thread Vladimir Sementsov-Ogievskiy
12.01.2019 20:58, Eric Blake wrote: > An upcoming patch will add the ability for qemu-nbd to list > the services provided by an NBD server. Share the common > code of the TLS handshake by splitting the initial exchange > into a separate function, leaving only the export handling > in the original

Re: [Qemu-devel] [PATCH v3 06/19] qemu-nbd: Avoid strtol open-coding

2019-01-15 Thread Eric Blake
On 1/15/19 6:31 AM, Vladimir Sementsov-Ogievskiy wrote: > 12.01.2019 20:57, Eric Blake wrote: >> Our copy-and-pasted open-coding of strtol handling forgot to >> handle overflow conditions. Use qemu_strto*() instead. >> >> In the case of --partition, since we insist on a user-supplied >> partition

Re: [Qemu-devel] [PATCH v3 14/19] nbd/client: Pull out oldstyle size determination

2019-01-15 Thread Vladimir Sementsov-Ogievskiy
12.01.2019 20:58, Eric Blake wrote: > Another refactoring creating nbd_negotiate_finish_oldstyle() > for further reuse during 'qemu-nbd --list'. > > Signed-off-by: Eric Blake > Message-Id: <20181215135324.152629-18-ebl...@redhat.com> > Reviewed-by: Richard W.M. Jones Reviewed-by: Vladimir Semen

Re: [Qemu-devel] [PATCH v2] s390x/pci: Set the iommu region size mpcifc request

2019-01-15 Thread Collin Walling
On 1/10/19 8:00 AM, Pierre Morel wrote: The size of the accessible iommu memory region in the guest is given to the IOMMU by the guest through the mpcifc request specifying the PCI Base Address and the PCI Address Limit. Let set the size of the IOMMU region to: (PCI Address Limit) - (PCI Ba

Re: [Qemu-devel] [PATCH v4 for-4.0 1/7] char-socket: Enable "nowait" option on client sockets

2019-01-15 Thread Daniel P . Berrangé
On Fri, Jan 11, 2019 at 04:36:11PM +0800, Yongji Xie wrote: > On Fri, 11 Jan 2019 at 16:32, Daniel P. Berrangé wrote: > > > > On Fri, Jan 11, 2019 at 03:50:40PM +0800, Yongji Xie wrote: > > > On Fri, 11 Jan 2019 at 00:41, Daniel P. Berrangé > > > wrote: > > > > > > > > We need to fix qemu_chr_fe

Re: [Qemu-devel] [PATCH v3 05/19] nbd/server: Favor [u]int64_t over off_t

2019-01-15 Thread Vladimir Sementsov-Ogievskiy
15.01.2019 18:33, Eric Blake wrote: > On 1/15/19 4:19 AM, Vladimir Sementsov-Ogievskiy wrote: >> 12.01.2019 20:57, Eric Blake wrote: >>> Although our compile-time environment is set up so that we always >>> support long files with 64-bit off_t, we have no guarantee whether >>> off_t is the same typ

Re: [Qemu-devel] [PATCH v3 10/19] nbd/client: Split out nbd_send_one_meta_context()

2019-01-15 Thread Eric Blake
On 1/15/19 7:18 AM, Vladimir Sementsov-Ogievskiy wrote: > 12.01.2019 20:58, Eric Blake wrote: >> Refactor nbd_negotiate_simple_meta_context() to pull out the >> code that can be reused to send a LIST request for 0 or 1 query. >> No semantic change. The old comment about 'sizeof(uint32_t)' >> being

Re: [Qemu-devel] [PATCH v3 14/19] nbd/client: Pull out oldstyle size determination

2019-01-15 Thread Vladimir Sementsov-Ogievskiy
15.01.2019 18:35, Vladimir Sementsov-Ogievskiy wrote: > It must be set to true before calling, and nbd_start_negotiate may set it to > true. set it to false, I wanted to say -- Best regards, Vladimir

Re: [Qemu-devel] [PATCH v2] s390x/pci: Set the iommu region size mpcifc request

2019-01-15 Thread Cornelia Huck
On Thu, 10 Jan 2019 14:00:07 +0100 Pierre Morel wrote: > The size of the accessible iommu memory region in the guest > is given to the IOMMU by the guest through the mpcifc request > specifying the PCI Base Address and the PCI Address Limit. > > Let set the size of the IOMMU region to: > (PC

Re: [Qemu-devel] [PATCH v3 11/19] nbd/client: Split out nbd_receive_one_meta_context()

2019-01-15 Thread Eric Blake
On 1/15/19 9:05 AM, Vladimir Sementsov-Ogievskiy wrote: > 12.01.2019 20:58, Eric Blake wrote: >> Extract portions of nbd_negotiate_simple_meta_context() to >> a new function nbd_receive_one_meta_context() that copies the >> pattern of nbd_receive_list() for performing the argument >> validation of

Re: [Qemu-devel] [PATCH v3 10/19] nbd/client: Split out nbd_send_one_meta_context()

2019-01-15 Thread Vladimir Sementsov-Ogievskiy
15.01.2019 18:44, Eric Blake wrote: > On 1/15/19 7:18 AM, Vladimir Sementsov-Ogievskiy wrote: >> 12.01.2019 20:58, Eric Blake wrote: >>> Refactor nbd_negotiate_simple_meta_context() to pull out the >>> code that can be reused to send a LIST request for 0 or 1 query. >>> No semantic change. The old

[Qemu-devel] [PATCH 02/14] tests: acpi: make RSDT test routine handle XSDT

2019-01-15 Thread Igor Mammedov
If RSDP revision is more than 0 fetch table pointed by XSDT and fallback to legacy RSDT table otherwise. While at it drop unused acpi_get_xsdt_address(). Signed-off-by: Igor Mammedov --- PS: it doesn't affect existing pc/q35 machines as they use RSDP.revision == 0 but it will be used by follow

[Qemu-devel] [PATCH 04/14] tests: acpi: make pointer to RSDP 64bit

2019-01-15 Thread Igor Mammedov
In case of UEFI RSDP doesn't have to be located in lowmem, it could be placed at any address. Make sure that test won't break if it is placed above the first 4Gb of address space. PS: While at it cleanup some local variables as we don't really need them. Signed-off-by: Igor Mammedov --- tests/b

[Qemu-devel] [PATCH 00/14] tests: acpi: add UEFI (ARM) testing support

2019-01-15 Thread Igor Mammedov
Series adds support for ACPI tables located above 4G. It only adds 64-bit handling necessary for testing arm/virt board (i.e. might be not complete wrt spec) and a test build of UEFI (AVMF) firmware that provides an entry point[1] for fetching ACPI tables (RSDP pointer). Series depends on: [PAT

[Qemu-devel] [PATCH 05/14] tests: acpi: fetch X_DSDT if pointer to DSDT is 0

2019-01-15 Thread Igor Mammedov
that way it would be possible to test a DSDT pointed by 64bit X_DSDT field in FADT. PS: it will allow to enable testing arm/virt board, which sets only newer X_DSDT field. Signed-off-by: Igor Mammedov --- tests/bios-tables-test.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) dif

[Qemu-devel] [PATCH 03/14] tests: acpi: rename acpi_parse_rsdp_table() into acpi_fetch_rsdp_table()

2019-01-15 Thread Igor Mammedov
so name would reflect what the function does Signed-off-by: Igor Mammedov --- tests/acpi-utils.h | 2 +- tests/acpi-utils.c | 2 +- tests/bios-tables-test.c | 2 +- tests/vmgenid-test.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/acpi-utils.h b/te

[Qemu-devel] [PATCH 07/14] tests: acpi: skip FACS table if board uses hw reduced ACPI profile

2019-01-15 Thread Igor Mammedov
If FADT has HW_REDUCED_ACPI flag set, do not attempt to fetch FACS as it's not provided by the board. Signed-off-by: Igor Mammedov --- tests/bios-tables-test.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index

[Qemu-devel] [PATCH 01/14] tests: acpi: add uefi_find_rsdp_addr() helper

2019-01-15 Thread Igor Mammedov
introduce UEFI specific counterpart to acpi_find_rsdp_address() that will help to find RSDP address when [OA]VMF is used as firmware. It requires a [OA]VMF built with PcdAcpiTestSupport=TRUE, to locate RSDP address within 1Mb aligned ACPI test structure, tagged with GUID AB87A6B1-2034-BDA0-71BD-375

[Qemu-devel] [PATCH 14/14] tests: acpi: refactor rebuild-expected-aml.sh to dump ACPI tables for a specified list of targets

2019-01-15 Thread Igor Mammedov
Make initial list contain aarch64 and x86_64 targets. Signed-off-by: Igor Mammedov --- tests/data/acpi/rebuild-expected-aml.sh | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/data/acpi/rebuild-expected-aml.sh b/tests/data/acpi/rebuild-expected

[Qemu-devel] [PATCH 06/14] tests: acpi: add reference blobs arm/virt board testcase

2019-01-15 Thread Igor Mammedov
adds test blobs for default arm/virt machine testcase Signed-off-by: Igor Mammedov --- tests/data/acpi/virt/APIC | Bin 0 -> 168 bytes tests/data/acpi/virt/DSDT | Bin 0 -> 18476 bytes tests/data/acpi/virt/FACP | Bin 0 -> 268 bytes tests/data/acpi/virt/GTDT | Bin 0 -> 96 bytes tests/data/acpi/

[Qemu-devel] [PATCH 08/14] tests: acpi: introduce an abilty start tests with UEFI firmware

2019-01-15 Thread Igor Mammedov
For testcase to use UEFI firmware, one needs to provide and specify firmware and varstore blobs names in test_data { uefi_fl1, uefi_fl2) } fields respectively. Signed-off-by: Igor Mammedov --- tests/bios-tables-test.c | 36 ++-- 1 file changed, 26 insertions(+), 1

[Qemu-devel] [PATCH 09/14] tests: acpi: move boot_sector_init() into x86 tests branch

2019-01-15 Thread Igor Mammedov
boot_sector_init() won't be used by arm/virt board, so move it from global scope to x86 branch that uses it. Signed-off-by: Igor Mammedov --- tests/bios-tables-test.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c i

Re: [Qemu-devel] [PATCH] include/fpu/softfloat: Fix compilation with Clang on s390x

2019-01-15 Thread Alex Bennée
Thomas Huth writes: > On 2019-01-15 15:46, Alex Bennée wrote: >> >> Peter Maydell writes: >> >>> On Mon, 14 Jan 2019 at 22:48, Alex Bennée wrote: Richard Henderson writes: > But perhaps > > unsigned __int128 n = (unsigned __int128)n1 << 64 | n0; > *r =

[Qemu-devel] [PATCH 10/14] tests: acpi: ignore SMBIOS tests when UEFI firmware is used

2019-01-15 Thread Igor Mammedov
once FW provides a pointer to SMBIOS entry point like it does for RSDP it should be possible to enable this one the same way. Signed-off-by: Igor Mammedov --- tests/bios-tables-test.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/bios-tables-test.c b/tests/bios

[Qemu-devel] [PATCH 12/14] tests: acpi: prepare AVMF firmware blobs to be used by bios-tables-test

2019-01-15 Thread Igor Mammedov
Copy blobs in ACPI test data directory and pad them up to 64Mb so that QEMU run by test could use them. Signed-off-by: Igor Mammedov --- tests/Makefile.include | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.include b/tests/Makefile.include i

Re: [Qemu-devel] [PATCH v3 10/19] nbd/client: Split out nbd_send_one_meta_context()

2019-01-15 Thread Eric Blake
On 1/15/19 9:52 AM, Vladimir Sementsov-Ogievskiy wrote: -nbd_opt_meta_request(const char *context, const char *export) "Requesting to set meta context %s for export %s" +nbd_opt_meta_request(const char *optname, const char *context, const char *export) "Requesting %s %s for e

Re: [Qemu-devel] [PATCH v4 for-4.0 4/7] libvhost-user: Support tracking inflight I/O in shared memory

2019-01-15 Thread Michael S. Tsirkin
On Tue, Jan 15, 2019 at 03:52:21PM +0800, Jason Wang wrote: > Well, this may work but here're my points: > > 1) The code want to recover from backed crash by introducing extra space to > store inflight data, but it still depends on the backend to set/get the > inflight state > > 2) Since the back

[Qemu-devel] [PATCH 13/14] tests: acpi: add simple arm/virt testcase

2019-01-15 Thread Igor Mammedov
adds simple arm/virt test case that starts guest with default values (modulo cortex-a57) Signed-off-by: Igor Mammedov --- tests/Makefile.include | 1 + tests/bios-tables-test.c | 16 2 files changed, 17 insertions(+) diff --git a/tests/Makefile.include b/tests/Makefile.inclu

Re: [Qemu-devel] [PATCH v3 11/19] nbd/client: Split out nbd_receive_one_meta_context()

2019-01-15 Thread Vladimir Sementsov-Ogievskiy
15.01.2019 18:50, Eric Blake wrote: > On 1/15/19 9:05 AM, Vladimir Sementsov-Ogievskiy wrote: >> 12.01.2019 20:58, Eric Blake wrote: >>> Extract portions of nbd_negotiate_simple_meta_context() to >>> a new function nbd_receive_one_meta_context() that copies the >>> pattern of nbd_receive_list() for

Re: [Qemu-devel] [PATCH v3 10/19] nbd/client: Split out nbd_send_one_meta_context()

2019-01-15 Thread Vladimir Sementsov-Ogievskiy
15.01.2019 18:55, Eric Blake wrote: > On 1/15/19 9:52 AM, Vladimir Sementsov-Ogievskiy wrote: > > -nbd_opt_meta_request(const char *context, const char *export) > "Requesting to set meta context %s for export %s" > +nbd_opt_meta_request(const char *optname, const char *context, const

[Qemu-devel] [Bug 1811862] [NEW] microcode version stays 0x1 even if -cpu host is used

2019-01-15 Thread Michael Ablassmeier
Public bug reported: The microcode version of my host cpu has the following version: grep microcode /proc/cpuinfo | head -1 microcode : 0x3d while trying to run ESXi in an nested VM, the boot bailed out with error message that at least microcode version 0x19 is needed. It seems they have

Re: [Qemu-devel] [PATCH v2 2/3] migration: fix memory leak when updating tls-creds and tls-hostname

2019-01-15 Thread Eric Blake
On 1/15/19 4:24 AM, Dr. David Alan Gilbert wrote: > I think the problem is that > migrate_params_check checks a MigrationParameters > > while the QMP command gives us a MigrateSetParameters; but we also use > migrate_params_check for the global check you added (8b0b29dc) which is > against migrat

Re: [Qemu-devel] Questions about VFIO enabling MSIX vector

2019-01-15 Thread Alex Williamson
On Tue, 15 Jan 2019 11:21:51 +0800 Heyi Guo wrote: > Hi Alex, > > Really appreciate your comments. I have some more questions below. > > > On 2019/1/15 0:07, Alex Williamson wrote: > > On Sat, 12 Jan 2019 10:30:40 +0800 > > Heyi Guo wrote: > > > >> Hi folks, > >> > >> I have some questions

Re: [Qemu-devel] [PATCH v3 03/19] qemu-nbd: Sanity check partition bounds

2019-01-15 Thread Vladimir Sementsov-Ogievskiy
12.01.2019 20:57, Eric Blake wrote: > When the user requests a partition, we were using data read > from the disk as disk offsets without a bounds check. We got > lucky that even when computed offsets are out-of-bounds, > blk_pread() will gracefully catch the error later (so I don't > think a malic

Re: [Qemu-devel] [PATCH v3 04/19] nbd/server: Hoist length check to qemp_nbd_server_add

2019-01-15 Thread Vladimir Sementsov-Ogievskiy
15.01.2019 18:25, Eric Blake wrote: > On 1/15/19 3:44 AM, Vladimir Sementsov-Ogievskiy wrote: >> 12.01.2019 20:57, Eric Blake wrote: >>> We only had two callers to nbd_export_new; qemu-nbd.c always >>> passed a valid offset/length pair (because it already checked >>> the file length, to ensure that

Re: [Qemu-devel] [PATCH v3 03/19] qemu-nbd: Sanity check partition bounds

2019-01-15 Thread Eric Blake
On 1/15/19 10:20 AM, Vladimir Sementsov-Ogievskiy wrote: > 12.01.2019 20:57, Eric Blake wrote: >> When the user requests a partition, we were using data read >> from the disk as disk offsets without a bounds check. We got >> lucky that even when computed offsets are out-of-bounds, >> blk_pread() wi

Re: [Qemu-devel] [PATCH v4 for-4.0 1/7] char-socket: Enable "nowait" option on client sockets

2019-01-15 Thread Yury Kotov
15.01.2019, 18:39, "Daniel P. Berrangé" : > On Fri, Jan 11, 2019 at 04:36:11PM +0800, Yongji Xie wrote: >>  On Fri, 11 Jan 2019 at 16:32, Daniel P. Berrangé >> wrote: >>  > >>  > On Fri, Jan 11, 2019 at 03:50:40PM +0800, Yongji Xie wrote: >>  > > On Fri, 11 Jan 2019 at 00:41, Daniel P. Berrangé

[Qemu-devel] [PATCH v2] QGA: Fix guest-get-fsinfo PCI address collection in Windows

2019-01-15 Thread mhines
From: Matt Hines The Windows QEMU guest agent erroneously tries to collect PCI information directly from the physical drive. However, windows stores SCSI/IDE information with the drive and PCI information with the underlying storage controller This changes get_pci_info to use the physical drive's

Re: [Qemu-devel] [PATCH v3 04/19] nbd/server: Hoist length check to qemp_nbd_server_add

2019-01-15 Thread Eric Blake
On 1/15/19 10:26 AM, Vladimir Sementsov-Ogievskiy wrote: >>> @size is not size of the image, but size of the export, so it may be less >>> than dev_offset >>> (qemu-nbd.c do "fd_size -= dev_offset" before "nbd_export_new(bs, >>> dev_offset, fd_size, " >> >> But the assert is fine because patch 3

Re: [Qemu-devel] [PATCH] cpus: ignore ESRCH in qemu_cpu_kick_thread()

2019-01-15 Thread Laurent Vivier
On 08/01/2019 19:47, Laurent Vivier wrote: On 08/01/2019 00:02, Paolo Bonzini wrote: On 02/01/19 15:16, Laurent Vivier wrote: We can have a race condition between qemu_cpu_kick_thread() and qemu_kvm_cpu_thread_fn() when we hotunplug a CPU. In this case, qemu_cpu_kick_thread() can try to kick a

Re: [Qemu-devel] [PULL v2 00/27] ivshmem deprecation, qtests, typedefs and gnu99

2019-01-15 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Tue, Jan 15, 2019 at 03:32:10PM +0100, Thomas Huth wrote: >> On 2019-01-15 14:16, Peter Maydell wrote: >> > On Mon, 14 Jan 2019 at 17:45, Thomas Huth wrote: >> >> >> >> Hi Peter! >> >> >> >> The following changes since commit >> >> 7260438b7056469610ee166f7abe9f

Re: [Qemu-devel] [PATCH v4 for-4.0 1/7] char-socket: Enable "nowait" option on client sockets

2019-01-15 Thread Daniel P . Berrangé
On Tue, Jan 15, 2019 at 07:53:51PM +0300, Yury Kotov wrote: > 15.01.2019, 18:39, "Daniel P. Berrangé" : > > On Fri, Jan 11, 2019 at 04:36:11PM +0800, Yongji Xie wrote: > >>  On Fri, 11 Jan 2019 at 16:32, Daniel P. Berrangé > >> wrote: > >>  > > >>  > On Fri, Jan 11, 2019 at 03:50:40PM +0800, Yong

[Qemu-devel] [PATCH] seccomp: Work-around GCC 4.x bug in gnu99 mode

2019-01-15 Thread Thomas Huth
We'd like to compile QEMU with -std=gnu99, but GCC 4.8 currently fails to compile qemu-seccomp.c in this mode: qemu-seccomp.c:45:1: error: initializer element is not constant }; ^ qemu-seccomp.c:45:1: error: (near initialization for ‘sched_setscheduler_arg[0]’) This is due to a compiler bug wh

[Qemu-devel] [PATCH 3/5] vhost: restrict Linux dependency to kernel vhost

2019-01-15 Thread Paolo Bonzini
vhost-user does not depend on Linux; it can run on any POSIX system. Restrict vhost-kernel to Linux in hw/virtio/vhost-backend.c, everything else can be compiled on all POSIX systems. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <1543851204-41186-4-git-send-email-pbo

Re: [Qemu-devel] [PULL 00/20] NBD patches through 2019-01-14

2019-01-15 Thread Peter Maydell
On Mon, 14 Jan 2019 at 16:28, Eric Blake wrote: > > The following changes since commit 7260438b7056469610ee166f7abe9ff8a26b8b16: > > Merge remote-tracking branch > 'remotes/palmer/tags/riscv-for-master-3.2-part2' into staging (2019-01-14 > 11:41:43 +) > > are available in the Git repositor

Re: [Qemu-devel] MTTCG qemu-softmmu aborted on watchpoint hit by atomic instruction

2019-01-15 Thread Max Filippov
On Tue, Jan 15, 2019 at 6:51 AM Emilio G. Cota wrote: > Can you please try the appended? > > diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c > index 870027d435..a5258bcbc8 100644 > --- a/accel/tcg/cpu-exec.c > +++ b/accel/tcg/cpu-exec.c > @@ -266,6 +266,9 @@ void cpu_exec_step_atomic(CPUS

[Qemu-devel] [PATCH 2/5] vhost-net-user: add stubs for when no virtio-net device is present

2019-01-15 Thread Paolo Bonzini
hw/net/vhost_net.c needs functions that are declared in net/vhost-user.c: the vhost-user code is always compiled into QEMU, only the constructor net_init_vhost_user is unreachable. Also, net/vhost-user.c needs functions declared in hw/virtio/vhost-stub.c even if no virtio device exists. Break thi

[Qemu-devel] [PATCH 5/5] vhost-net: revamp configure logic

2019-01-15 Thread Paolo Bonzini
Detect all invalid configurations (e.g. mingw32 with vhost-user, non-Linux with vhost-kernel). As a collateral benefit, all vhost-kernel backends can be now disabled if one wants to reduce the attack surface. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini Reviewed-by: Thomas H

Re: [Qemu-devel] [PATCH v2 0/6] contrib/elf2dmp: elf2dmp for Windows hosts

2019-01-15 Thread Paolo Bonzini
On 20/12/18 02:24, Viktor Prutyanov wrote: > In most cases, it is more convenient to convert a dump on the same machine > on which the analysis is performed. Because of WinDbg, the analysis of guest > Windows problems needs Windows host anyway, so it is useful to have dump > convertion tool near th

Re: [Qemu-devel] [PATCH v1 4/8] RISC-V: Use riscv prefix consistently on cpu helpers

2019-01-15 Thread Philippe Mathieu-Daudé
On 1/15/19 11:50 AM, Philippe Mathieu-Daudé wrote: > Hi Alistair, > > On 1/15/19 12:58 AM, Alistair Francis wrote: >> From: Michael Clark >> >> * Add riscv prefix to raise_exception function >> * Add riscv prefix to CSR read/write functions >> * Add riscv prefix to signal handler function >> * Ad

[Qemu-devel] [PATCH 1/5] vhost-net: move stubs to a separate file

2019-01-15 Thread Paolo Bonzini
There is no reason for CONFIG_VHOST_NET to be specific to a single target; it is a host feature that can be add to all targets, as long as they support the virtio-net device. Currently CONFIG_VHOST_NET depends on CONFIG_KVM, but ioeventfd support is present in the core memory API and works with ot

[Qemu-devel] [PATCH 4/5] vhost-net: compile it on all targets that have virtio-net.

2019-01-15 Thread Paolo Bonzini
This shows a preexisting bug: if a KVM target did not have virtio-net enabled, it would fail with undefined symbols when vhost was enabled. This must now be fixed, lest targets that have no virtio-net fail to compile. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini Reviewed-by:

[Qemu-devel] [PATCH v2 0/5] vhost: enable for all targets

2019-01-15 Thread Paolo Bonzini
vhost does not have to be supported only if KVM is present, in fact vhost-user does not even need any kind of kernel support. This series changes this. The rationale is that, when vhost-user-test.c will be converted to qgraph, it will be able to test vhost-user support for virtio-mmio backend eve

Re: [Qemu-devel] [PATCH v2] s390x/pci: Set the iommu region size mpcifc request

2019-01-15 Thread Pierre Morel
On 15/01/2019 16:47, Cornelia Huck wrote: On Thu, 10 Jan 2019 14:00:07 +0100 Pierre Morel wrote: The size of the accessible iommu memory region in the guest is given to the IOMMU by the guest through the mpcifc request specifying the PCI Base Address and the PCI Address Limit. Let set the siz

Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 00/13] spapr: Add support for PHB hotplug

2019-01-15 Thread Greg Kurz
On Fri, 11 Jan 2019 21:59:55 +0100 Greg Kurz wrote: > This allows to hotplug/unplug PHBs. I could successfully test: > - hotplug/unplug with e1000 device to validate LSIs > - hotplug/unplug with virtio-net device to validate MSIs > - some simple migration scenarios > > Changes in v2: > - rebased

Re: [Qemu-devel] [PATCH] seccomp: Work-around GCC 4.x bug in gnu99 mode

2019-01-15 Thread Daniel P . Berrangé
On Tue, Jan 15, 2019 at 06:32:42PM +0100, Thomas Huth wrote: > We'd like to compile QEMU with -std=gnu99, but GCC 4.8 currently > fails to compile qemu-seccomp.c in this mode: > > qemu-seccomp.c:45:1: error: initializer element is not constant > }; > ^ > qemu-seccomp.c:45:1: error: (near initial

Re: [Qemu-devel] [PATCH v1 4/8] RISC-V: Use riscv prefix consistently on cpu helpers

2019-01-15 Thread Alistair Francis
On Tue, Jan 15, 2019 at 9:17 AM Philippe Mathieu-Daudé wrote: > > On 1/15/19 11:50 AM, Philippe Mathieu-Daudé wrote: > > Hi Alistair, > > > > On 1/15/19 12:58 AM, Alistair Francis wrote: > >> From: Michael Clark > >> > >> * Add riscv prefix to raise_exception function > >> * Add riscv prefix to C

[Qemu-devel] [Bug 1777252] Re: tests/Makefile.include trying to add linking library '-lutil' that break the build on Solaris

2019-01-15 Thread Michele
That's great. I spent quite a while last summer looking for the source of that error, without success. I finally just created a stub library named lutil figuring I would then find which function was missing on the next build attempt. But it worked fine so apparently QEMU does not even use whatev

Re: [Qemu-devel] [PATCH v3 01/19] maint: Allow for EXAMPLES in texi2pod

2019-01-15 Thread Richard W.M. Jones
On Sat, Jan 12, 2019 at 11:57:54AM -0600, Eric Blake wrote: > The next commit will add an EXAMPLES section to qemu-nbd.8; > for that to work, we need to recognize EXAMPLES in texi2pod. > We also need to add a dependency from all man pages against > the generator script, since a change to the genera

Re: [Qemu-devel] [PATCH v3 02/19] qemu-nbd: Enhance man page

2019-01-15 Thread Richard W.M. Jones
On Sat, Jan 12, 2019 at 11:57:55AM -0600, Eric Blake wrote: > Document some useful qemu-nbd command lines. Mention some restrictions > on particular options, like -p being only for MBR images, or -c/-d > being Linux-only. Update some text given the recent change to no > longer serve oldstyle proto

[Qemu-devel] [PATCH] tap: flush STDOUT on newline

2019-01-15 Thread Paolo Bonzini
This makes it easier to follow what is going on. Signed-off-by: Paolo Bonzini --- scripts/tap-driver.pl | 1 + scripts/tap-merge.pl | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/tap-driver.pl b/scripts/tap-driver.pl index 5e59b5d..6621a5c 100755 --- a/scripts/tap-driver.pl +++ b

Re: [Qemu-devel] [PATCH 03/15] hw/ssi: Remove SSIBus from "qemu/typedefs.h"

2019-01-15 Thread Paolo Bonzini
On 15/01/19 13:28, Markus Armbruster wrote: >> Signed-off-by: Philippe Mathieu-Daudé >> --- >> hw/arm/strongarm.h | 1 + >> include/hw/arm/pxa.h| 1 + >> include/hw/ssi/pl022.h | 1 + >> include/hw/ssi/ssi.h| 1 + >> include/qemu/typedefs.h | 1 - >> 5 files changed, 4 insertions(+)

Re: [Qemu-devel] [PATCH v3 03/19] qemu-nbd: Sanity check partition bounds

2019-01-15 Thread Richard W.M. Jones
On Sat, Jan 12, 2019 at 11:57:56AM -0600, Eric Blake wrote: > When the user requests a partition, we were using data read > from the disk as disk offsets without a bounds check. We got > lucky that even when computed offsets are out-of-bounds, > blk_pread() will gracefully catch the error later (so

Re: [Qemu-devel] [PATCH] tap: flush STDOUT on newline

2019-01-15 Thread Eric Blake
On 1/15/19 11:56 AM, Paolo Bonzini wrote: > This makes it easier to follow what is going on. > > Signed-off-by: Paolo Bonzini > --- > scripts/tap-driver.pl | 1 + > scripts/tap-merge.pl | 1 + > 2 files changed, 2 insertions(+) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software En

Re: [Qemu-devel] [PATCH 03/15] hw/ssi: Remove SSIBus from "qemu/typedefs.h"

2019-01-15 Thread Paolo Bonzini
On 15/01/19 13:56, Thomas Huth wrote: > Yes, agreed, removing things from typedefs.h just to add lots of > #includes in other files is not really the best idea. I also dropped > this patch in v2 of my current PULL request because of this reason. > Phil, I suggest to simply drop this patch. What we

Re: [Qemu-devel] [RFC PATCH v2 01/37] build: actually use CONFIG_PAM

2019-01-15 Thread Thomas Huth
On 2019-01-15 15:10, Yang Zhong wrote: > From: Paolo Bonzini > > Do not link it unconditionally into all binaries. > > Signed-off-by: Paolo Bonzini I think you should put your Signed-off-by below Paolo's S-o-b into this patch, too (since you've edited it). > --- > default-configs/i386-softmm

Re: [Qemu-devel] [PULL 0/2] Block patches

2019-01-15 Thread Peter Maydell
On Mon, 14 Jan 2019 at 16:34, Stefan Hajnoczi wrote: > > The following changes since commit 7260438b7056469610ee166f7abe9ff8a26b8b16: > > Merge remote-tracking branch > 'remotes/palmer/tags/riscv-for-master-3.2-part2' into staging (2019-01-14 > 11:41:43 +) > > are available in the Git repo

Re: [Qemu-devel] [PATCH v3 03/19] qemu-nbd: Sanity check partition bounds

2019-01-15 Thread Eric Blake
On 1/15/19 12:00 PM, Richard W.M. Jones wrote: > On Sat, Jan 12, 2019 at 11:57:56AM -0600, Eric Blake wrote: >> When the user requests a partition, we were using data read >> from the disk as disk offsets without a bounds check. We got >> lucky that even when computed offsets are out-of-bounds, >>

Re: [Qemu-devel] [PATCH] cpus: ignore ESRCH in qemu_cpu_kick_thread()

2019-01-15 Thread Paolo Bonzini
On 15/01/19 17:34, Laurent Vivier wrote: > On 08/01/2019 19:47, Laurent Vivier wrote: >> On 08/01/2019 00:02, Paolo Bonzini wrote: >>> On 02/01/19 15:16, Laurent Vivier wrote: We can have a race condition between qemu_cpu_kick_thread() and qemu_kvm_cpu_thread_fn() when we hotunplug a CPU.

Re: [Qemu-devel] [PATCH v3 06/19] qemu-nbd: Avoid strtol open-coding

2019-01-15 Thread Richard W.M. Jones
On Sat, Jan 12, 2019 at 11:57:59AM -0600, Eric Blake wrote: > Our copy-and-pasted open-coding of strtol handling forgot to > handle overflow conditions. Use qemu_strto*() instead. > > In the case of --partition, since we insist on a user-supplied > partition to be non-zero, we can use 0 rather th

Re: [Qemu-devel] [PATCH v3 1/5] elf: Add optional function ptr to load_elf() to parse ELF notes

2019-01-15 Thread BALATON Zoltan
On Tue, 15 Jan 2019, Liam Merwick wrote: This patch adds an optional function pointer, 'elf_note_fn', to load_elf() which causes load_elf() to additionally parse any ELF program headers of type PT_NOTE and check to see if the ELF Note is of the type specified by the 'translate_opaque' arg. If a m

[Qemu-devel] [PATCH 0/5] qtest driver framework (core only)

2019-01-15 Thread Paolo Bonzini
As promised, this is the implementation of the core qtest driver framework API. The diff of patch 5 from the previous post is at the end of the cover letter. Emanuele Giuseppe Esposito (3): tests/libqos: introduce virtio_start_device tests/libqos: rename qpci_init_pc and qpci_init_spapr funct

[Qemu-devel] [PATCH 3/5] tests: remove rule for nonexisting qdev-monitor-test

2019-01-15 Thread Paolo Bonzini
This test was merged into drive_del-test in 2014. Signed-off-by: Paolo Bonzini --- tests/Makefile.include | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 195af1f..8b88cd5 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@

<    1   2   3   4   >