Re: [PATCH v5 00/13] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-07-22 Thread Andy Lutomirski
On 7/21/22 14:19, Sean Christopherson wrote: On Thu, Jul 21, 2022, Gupta, Pankaj wrote: I view it as a performance problem because nothing stops KVM from copying from userspace into the private fd during the SEV ioctl(). What's missing is the ability for userspace to directly initialze the

[PING^2] linux-user: Passthrough MADV_DONTNEED for certain file mappings

2022-07-22 Thread Ilya Leoshkevich
On Fri, 2022-07-01 at 15:52 +0200, Ilya Leoshkevich wrote: > This is a follow-up for commit 892a4f6a750a ("linux-user: Add partial > support for MADV_DONTNEED"), which added passthrough for anonymous > mappings. File mappings can be handled in a similar manner. > > In order to do that, mark

[PATCH v2 2/2] tests/tcg/s390x: Test unaligned accesses to lowcore

2022-07-22 Thread Ilya Leoshkevich
Add a small test to avoid regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 9 + tests/tcg/s390x/unaligned-lowcore.S | 19 +++ 2 files changed, 28 insertions(+) create mode 100644 tests/tcg/s390x/Makefile.softmmu-target

[PATCH v2 1/2] qapi: Add exit-failure PanicAction

2022-07-22 Thread Ilya Leoshkevich
Currently QEMU exits with code 0 on both panic an shutdown. For tests it is useful to return 1 on panic, so that it counts as a test failure. Introduce a new exit-failure PanicAction that makes main() return EXIT_FAILURE. Tests can use -action panic=exit-failure option to activate this behavior.

[PATCH v2 0/2] accel/tcg: Test unaligned stores to s390x low-address-protected lowcore

2022-07-22 Thread Ilya Leoshkevich
Hi, This is a follow-up series for [1]. The fix has been committed. I asked Christian what might be a good alternative for the mmio-debug-exit device for testing, and he suggested to look into shutdown/panic actions. Patch 1 adds a new panic action. Patch 2 tests unaligned stores to s390x

Re: [PATCH for-7.2 00/10] add hmp 'save-fdt' and 'info fdt' commands

2022-07-22 Thread BALATON Zoltan
On Fri, 22 Jul 2022, Daniel Henrique Barboza wrote: Hi, After dealing with a FDT element that isn't being shown in the userspace and having to shutdown the guest, dump the FDT using 'machine -dumpdtb' and then using 'dtc' to see what was inside the FDT, I thought it was a good idea to add extra

Re: [PATCH for-7.2 04/10] hmp, device_tree.c: introduce fdt-save

2022-07-22 Thread BALATON Zoltan
On Fri, 22 Jul 2022, Daniel Henrique Barboza wrote: To save the FDT blob we have the '-machine dumpdtb=' property. With this property set, the machine saves the FDT in and exit. The created file can then be converted to plain text dts format using 'dtc'. There's nothing particularly

Re: [PATCH for-7.2 02/10] hw/ppc/pegasos2.c: set machine->fdt in machine_reset()

2022-07-22 Thread BALATON Zoltan
On Fri, 22 Jul 2022, Daniel Henrique Barboza wrote: We'll introduce HMP commands that requires machine->fdt to be set properly. Cc: BALATON Zoltan Cc: qemu-...@nongnu.org Signed-off-by: Daniel Henrique Barboza --- hw/ppc/pegasos2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

Re: [PATCH for-7.2 01/10] hw/arm/boot.c: do not free machine->fdt in arm_load_dtb()

2022-07-22 Thread BALATON Zoltan
On Fri, 22 Jul 2022, Daniel Henrique Barboza wrote: At this moment, arm_load_dtb() can free machine->fdt when binfo->dtb_filename is NULL. If there's no 'dtb_filename', 'fdt' will be retrieved by binfo->get_dtb(). If get_dtb() returns machine->fdt, as is the case of machvirt_dtb() from

Re: [RFC 0/3] add snapshot/restore fuzzing device

2022-07-22 Thread Claudio Fontana
Hi Richard, On 7/22/22 21:20, Richard Liu wrote: > This RFC adds a virtual device for snapshot/restores within QEMU. I am working > on this as a part of QEMU Google Summer of Code 2022. Fast snapshot/restores > within QEMU is helpful for code fuzzing. > > I reused the migration code for saving

[PATCH for-7.2 00/10] add hmp 'save-fdt' and 'info fdt' commands

2022-07-22 Thread Daniel Henrique Barboza
Hi, After dealing with a FDT element that isn't being shown in the userspace and having to shutdown the guest, dump the FDT using 'machine -dumpdtb' and then using 'dtc' to see what was inside the FDT, I thought it was a good idea to add extra support for FDT handling in QEMU. This series

[PATCH for-7.2 10/10] hmp, device_tree.c: add 'info fdt ' support

2022-07-22 Thread Daniel Henrique Barboza
'info fdt' is only able to print full nodes so far. It would be good to be able to also print single properties, since ometimes we just want to verify a single value from the FDT. libfdt does not have support to find a property given its full path, but it does have a way to return a fdt_property

[PATCH for-7.2 07/10] device_tree.c: support remaining FDT prop types

2022-07-22 Thread Daniel Henrique Barboza
When printing a blob with 'dtc' using the '-O dts' option there are 3 distinct data types being printed: strings, arrays of uint32s and regular byte arrays. Previous patch added support to print strings. Let's add the remaining formats. We want to resemble the format that 'dtc -O dts' uses, so

[PATCH for-7.2 09/10] device_tree.c: add fdt_print_property() helper

2022-07-22 Thread Daniel Henrique Barboza
We want to be able to also print properties with 'info fdt'. Create a helper to print properties based on the already existing code from fdt_print_node(). Signed-off-by: Daniel Henrique Barboza --- softmmu/device_tree.c | 32 ++-- 1 file changed, 18 insertions(+),

driver type raw-xz supports discard=unmap?

2022-07-22 Thread Chris Murphy
Is this valid? ` ` `/> ` I know type="raw" works fine, I'm wondering if there'd be any problem with type "raw-xz" combined with discards? Thanks, Chris Murphy

[PATCH for-7.2 02/10] hw/ppc/pegasos2.c: set machine->fdt in machine_reset()

2022-07-22 Thread Daniel Henrique Barboza
We'll introduce HMP commands that requires machine->fdt to be set properly. Cc: BALATON Zoltan Cc: qemu-...@nongnu.org Signed-off-by: Daniel Henrique Barboza --- hw/ppc/pegasos2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index

[PATCH for-7.2 04/10] hmp, device_tree.c: introduce fdt-save

2022-07-22 Thread Daniel Henrique Barboza
To save the FDT blob we have the '-machine dumpdtb=' property. With this property set, the machine saves the FDT in and exit. The created file can then be converted to plain text dts format using 'dtc'. There's nothing particularly sophisticated into saving the FDT that can't be done with the

[PATCH for-7.2 06/10] device_tree.c: support printing of strings props

2022-07-22 Thread Daniel Henrique Barboza
To support printing string properties in 'info fdt' we need to determine whether a void data might contain a string. We do that by casting the void data to a string array and: - check if the array finishes with a null character - check if all characters are printable If both conditions are met,

[PATCH for-7.2 05/10] hmp, device_tree.c: introduce 'info fdt' command

2022-07-22 Thread Daniel Henrique Barboza
Reading the FDT requires that the user saves the fdt_blob and then use 'dtc' to read the contents. Saving the file and using 'dtc' is a strong use case when we need to compare two FDTs, but it's a lot of steps if you want to do quick check on a certain attribute. 'info fdt' retrieves FDT nodes

[PATCH for-7.2 08/10] device_node.c: enable 'info fdt' to print subnodes

2022-07-22 Thread Daniel Henrique Barboza
Printing subnodes of a given node will allow us to show a whole subtree, which the additional perk of 'info fdt /' being able to print the whole FDT. Since we're now printing more than one subnode, change 'fdt_info' to print the full path of the first node. This small tweak helps identifying

[PATCH for-7.2 01/10] hw/arm/boot.c: do not free machine->fdt in arm_load_dtb()

2022-07-22 Thread Daniel Henrique Barboza
At this moment, arm_load_dtb() can free machine->fdt when binfo->dtb_filename is NULL. If there's no 'dtb_filename', 'fdt' will be retrieved by binfo->get_dtb(). If get_dtb() returns machine->fdt, as is the case of machvirt_dtb() from hw/arm/virt.c, fdt now has a pointer to machine->fdt. And, in

[PATCH for-7.2 03/10] hw/ppc: set machine->fdt in spapr machine

2022-07-22 Thread Daniel Henrique Barboza
The pSeries machine never bothered with the common machine->fdt attribute. We do all the FDT related work using spapr->fdt_blob. We're going to introduce HMP commands to read and save the FDT, which will rely on setting machine->fdt properly to work across all machine archs/types. Let's set

[RFC 1/3] create skeleton snapshot device and add docs

2022-07-22 Thread Richard Liu
Added a simple skeleton PCI device for snapshot/restores. Added documentation about the snapshot/restore functionality. Signed-off-by: Richard Liu --- docs/devel/snapshot.rst | 26 + hw/i386/Kconfig | 1 + hw/misc/Kconfig | 3 ++ hw/misc/meson.build | 1 +

[RFC 2/3] implement ram save/restore

2022-07-22 Thread Richard Liu
Use a file-backed copy-on-write mmap region for snapshots. Restores are handled by remmaping the fixed region. Currently, the snapshot file save path (`filepath`) is hardcoded (to a path that is memory-backed on my machine). Signed-off-by: Richard Liu --- hw/misc/snapshot.c | 72

[RFC 3/3] use migration code for cpu and device save/restore

2022-07-22 Thread Richard Liu
Reused device migration code for cpu and device state snapshots. In this initial version, I used several hacks to get the device code working. vm_stop doesn't have the intended effect (for qemu_save_device_state) unless called outside the vcpu thread. I trick the function into thinking it is

Re: [PATCH v6 00/14] qapi: net: add unix socket type support to netdev backend

2022-07-22 Thread Laurent Vivier
On 22/07/2022 20:56, Laurent Vivier wrote: ... Please ignore this series, bad numbering and patch 11 breaks SMTP server... Sent v7 with another SMTP server. Thanks, LAurent

[RFC 0/3] add snapshot/restore fuzzing device

2022-07-22 Thread Richard Liu
This RFC adds a virtual device for snapshot/restores within QEMU. I am working on this as a part of QEMU Google Summer of Code 2022. Fast snapshot/restores within QEMU is helpful for code fuzzing. I reused the migration code for saving and restoring virtual device and CPU state. As for the RAM, I

[PATCH v7 07/14] net: stream: add unix socket

2022-07-22 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/stream.c| 108 +--- qapi/net.json | 2 +- qemu-options.hx | 1 + 3 files changed, 105 insertions(+), 6 deletions(-) diff --git a/net/stream.c b/net/stream.c index

[PATCH v7 01/14] net: introduce convert_host_port()

2022-07-22 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- include/qemu/sockets.h | 2 ++ net/net.c | 62 ++ 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index

[PATCH v7 06/14] net: stream: Don't ignore EINVAL on netdev socket connection

2022-07-22 Thread Laurent Vivier
From: Stefano Brivio Other errors are treated as failure by net_stream_client_init(), but if connect() returns EINVAL, we'll fail silently. Remove the related exception. Signed-off-by: Stefano Brivio [lvivier: applied to net/stream.c] Signed-off-by: Laurent Vivier Reviewed-by: Daniel P.

[PATCH v7 13/14] net: stream: move to QIO

2022-07-22 Thread Laurent Vivier
Use QIOChannel, QIOChannelSocket and QIONetListener. Signed-off-by: Laurent Vivier --- net/stream.c | 480 ++- 1 file changed, 168 insertions(+), 312 deletions(-) diff --git a/net/stream.c b/net/stream.c index 0f91ff20df61..c4ddb44fc3ed 100644

[PATCH v7 05/14] qapi: net: add stream and dgram netdevs

2022-07-22 Thread Laurent Vivier
Copied from socket netdev file and modified to use SocketAddress to be able to introduce new features like unix socket. "udp" and "mcast" are squashed into dgram netdev, multicast is detected according to the IP address type. "listen" and "connect" modes are managed by stream netdev. An optional

[PATCH v7 03/14] net: simplify net_client_parse() error management

2022-07-22 Thread Laurent Vivier
All net_client_parse() callers exit in case of error. Move exit(1) to net_client_parse() and remove error checking from the callers. Suggested-by: Markus Armbruster Signed-off-by: Laurent Vivier Reviewed-by: Markus Armbruster --- include/net/net.h | 2 +- net/net.c | 6 ++

[PATCH v7 11/14] qemu-sockets: move and rename SocketAddress_to_str()

2022-07-22 Thread Laurent Vivier
Rename SocketAddress_to_str() to socket_uri() and move it to util/qemu-sockets.c close to socket_parse(). socket_uri() generates a string from a SocketAddress while socket_parse() generates a SocketAddress from a string. Signed-off-by: Laurent Vivier --- include/qemu/sockets.h | 2 +-

[PATCH v7 14/14] tests/qtest: netdev: test stream and dgram backends

2022-07-22 Thread Laurent Vivier
Signed-off-by: Laurent Vivier --- tests/qtest/meson.build | 1 + tests/qtest/netdev-socket.c | 322 2 files changed, 323 insertions(+) create mode 100644 tests/qtest/netdev-socket.c diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index

[PATCH v7 09/14] net: dgram: move mcast specific code from net_socket_fd_init_dgram()

2022-07-22 Thread Laurent Vivier
It is less complex to manage special cases directly in net_dgram_mcast_init() and net_dgram_udp_init(). Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/dgram.c | 143 +++- 1 file changed, 73 insertions(+), 70 deletions(-) diff

Re: [PULL 7/9] hw/guest-loader: pass random seed to fdt

2022-07-22 Thread Jason A. Donenfeld
Hi Alex, On Fri, Jul 22, 2022 at 4:37 PM Alex Bennée wrote: > That sounds suspiciously like inventing a new ABI between QEMU and > guests which we generally try to avoid. Well the ABI is just the "rng-seed" param which is part of the DT spec. But I can understand why you might find this use a

[PATCH v7 00/14] qapi: net: add unix socket type support to netdev backend

2022-07-22 Thread Laurent Vivier
"-netdev socket" only supports inet sockets. It's not a complex task to add support for unix sockets, but the socket netdev parameters are not defined to manage well unix socket parameters. As discussed in: "socket.c added support for unix domain socket datagram transport"

[PATCH v6 10/14] net: dgram: add unix socket

2022-07-22 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/dgram.c | 65 ++--- qapi/net.json | 2 +- qemu-options.hx | 1 + 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/net/dgram.c b/net/dgram.c index

[PATCH v7 04/14] qapi: net: introduce a way to bypass qemu_opts_parse_noisily()

2022-07-22 Thread Laurent Vivier
As qemu_opts_parse_noisily() flattens the QAPI structures ("type" field of Netdev structure can collides with "type" field of SocketAddress), we introduce a way to bypass qemu_opts_parse_noisily() and use directly visit_type_Netdev() to parse the backend parameters. More details from Markus:

[PATCH v7 02/14] net: remove the @errp argument of net_client_inits()

2022-07-22 Thread Laurent Vivier
The only caller passes _fatal, so use this directly in the function. It's what we do for -blockdev, -device, and -object. Suggested-by: Markus Armbruster Signed-off-by: Laurent Vivier Reviewed-by: Markus Armbruster --- include/net/net.h | 2 +- net/net.c | 20 +++-

[PATCH v7 12/14] qemu-sockets: update socket_uri() and socket_parse() to be consistent

2022-07-22 Thread Laurent Vivier
To be consistent with socket_uri(), add 'tcp:' prefix for inet type in socket_parse(), by default socket_parse() use tcp when no prefix is provided (format is host:port). In socket_uri(), use 'vsock:' prefix for vsock type rather than 'tcp:' because it makes a vsock address look like an inet

[PATCH v6 08/14] net: dgram: make dgram_dst generic

2022-07-22 Thread Laurent Vivier
dgram_dst is a sockaddr_in structure. To be able to use it with unix socket, use a pointer to a generic sockaddr structure. Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/dgram.c | 76 +++-- 1 file changed, 45 insertions(+), 31

[PATCH v7 08/14] net: dgram: make dgram_dst generic

2022-07-22 Thread Laurent Vivier
dgram_dst is a sockaddr_in structure. To be able to use it with unix socket, use a pointer to a generic sockaddr structure. Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/dgram.c | 76 +++-- 1 file changed, 45 insertions(+), 31

[PATCH v6 09/14] net: dgram: move mcast specific code from net_socket_fd_init_dgram()

2022-07-22 Thread Laurent Vivier
It is less complex to manage special cases directly in net_dgram_mcast_init() and net_dgram_udp_init(). Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/dgram.c | 143 +++- 1 file changed, 73 insertions(+), 70 deletions(-) diff

[PATCH v7 10/14] net: dgram: add unix socket

2022-07-22 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/dgram.c | 65 ++--- qapi/net.json | 2 +- qemu-options.hx | 1 + 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/net/dgram.c b/net/dgram.c index

[PATCH v6 07/14] net: stream: add unix socket

2022-07-22 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/stream.c| 108 +--- qapi/net.json | 2 +- qemu-options.hx | 1 + 3 files changed, 105 insertions(+), 6 deletions(-) diff --git a/net/stream.c b/net/stream.c index

[PATCH v6 05/14] qapi: net: add stream and dgram netdevs

2022-07-22 Thread Laurent Vivier
Copied from socket netdev file and modified to use SocketAddress to be able to introduce new features like unix socket. "udp" and "mcast" are squashed into dgram netdev, multicast is detected according to the IP address type. "listen" and "connect" modes are managed by stream netdev. An optional

[PATCH v6 04/14] qapi: net: introduce a way to bypass qemu_opts_parse_noisily()

2022-07-22 Thread Laurent Vivier
As qemu_opts_parse_noisily() flattens the QAPI structures ("type" field of Netdev structure can collides with "type" field of SocketAddress), we introduce a way to bypass qemu_opts_parse_noisily() and use directly visit_type_Netdev() to parse the backend parameters. More details from Markus:

[PATCH v6 00/14] qapi: net: add unix socket type support to netdev backend

2022-07-22 Thread Laurent Vivier
"-netdev socket" only supports inet sockets. It's not a complex task to add support for unix sockets, but the socket netdev parameters are not defined to manage well unix socket parameters. As discussed in: "socket.c added support for unix domain socket datagram transport"

[PATCH v6 06/14] net: stream: Don't ignore EINVAL on netdev socket connection

2022-07-22 Thread Laurent Vivier
From: Stefano Brivio Other errors are treated as failure by net_stream_client_init(), but if connect() returns EINVAL, we'll fail silently. Remove the related exception. Signed-off-by: Stefano Brivio [lvivier: applied to net/stream.c] Signed-off-by: Laurent Vivier Reviewed-by: Daniel P.

[PATCH v6 03/14] net: simplify net_client_parse() error management

2022-07-22 Thread Laurent Vivier
All net_client_parse() callers exit in case of error. Move exit(1) to net_client_parse() and remove error checking from the callers. Suggested-by: Markus Armbruster Signed-off-by: Laurent Vivier Reviewed-by: Markus Armbruster --- include/net/net.h | 2 +- net/net.c | 6 ++

[PATCH v6 02/14] net: remove the @errp argument of net_client_inits()

2022-07-22 Thread Laurent Vivier
The only caller passes _fatal, so use this directly in the function. It's what we do for -blockdev, -device, and -object. Suggested-by: Markus Armbruster Signed-off-by: Laurent Vivier Reviewed-by: Markus Armbruster --- include/net/net.h | 2 +- net/net.c | 20 +++-

[PATCH v6 01/14] net: introduce convert_host_port()

2022-07-22 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- include/qemu/sockets.h | 2 ++ net/net.c | 62 ++ 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index

[PATCH v3 0/1] python/machine: Fix AF_UNIX path too long on macOS

2022-07-22 Thread Peter Delevoryas
v1: https://lore.kernel.org/qemu-devel/20220705214659.73369-1-pe...@pjd.dev/ v2: https://lore.kernel.org/qemu-devel/20220716173434.17183-1-pe...@pjd.dev/ v3: - Changed QEMUMachine._name to f"{id(self):x}". Suggestion was to do f"{id(self):02x}", but the id's look like they are probably

[PATCH v3 1/1] python/machine: Fix AF_UNIX path too long on macOS

2022-07-22 Thread Peter Delevoryas
On macOS, private $TMPDIR's are the default. These $TMPDIR's are generated from a user's unix UID and UUID [1], which can create a relatively long path: /var/folders/d7/rz20f6hd709c1ty8f6_6y_z4gn/T/ QEMU's avocado tests create a temporary directory prefixed by "avo_qemu_sock_", and

Re: [PATCH v2 1/1] python/machine: Fix AF_UNIX path too long on macOS

2022-07-22 Thread Peter Delevoryas
On Fri, Jul 22, 2022 at 08:20:11AM +0100, Daniel P. Berrangé wrote: > On Thu, Jul 21, 2022 at 07:44:21PM -0700, Peter Delevoryas wrote: > > On Mon, Jul 18, 2022 at 09:56:17AM +0100, Daniel P. Berrangé wrote: > > > On Sat, Jul 16, 2022 at 10:34:34AM -0700, Peter Delevoryas wrote: > > > > On macOS,

Python package qemu.qmp v0.0.1 released

2022-07-22 Thread John Snow
I'm pleased to announce the very first version of the standalone QMP library for Python, "qemu.qmp". PyPI: https://pypi.org/project/qemu.qmp/ Docs: https://qemu-project.gitlab.io/python-qemu-qmp/ Source: https://gitlab.com/qemu-project/python-qemu-qmp This library is identical to the one

[PULL 7/8] hw/rx: pass random seed to fdt

2022-07-22 Thread Paolo Bonzini
From: "Jason A. Donenfeld" If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to initialize early. Set this using the usual guest random number generation function. This FDT node is part of the DT specification. Cc: Yoshinori Sato Signed-off-by: Jason A. Donenfeld

[PULL 4/8] oss-fuzz: ensure base_copy is a generic-fuzzer

2022-07-22 Thread Paolo Bonzini
From: Alexander Bulekov Depending on how the target list is sorted in by qemu, the first target (used as the base copy of the fuzzer, to which all others are linked) might not be a generic-fuzzer. Since we are trying to only use generic-fuzz, on oss-fuzz, fix that, to ensure the base copy is a

[PULL 5/8] hw/nios2: virt: pass random seed to fdt

2022-07-22 Thread Paolo Bonzini
From: "Jason A. Donenfeld" If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to initialize early. Set this using the usual guest random number generation function. This FDT node is part of the DT specification. Cc: Chris Wulff Cc: Marek Vasut Signed-off-by: Jason A.

[PULL 8/8] hw/i386: pass RNG seed via setup_data entry

2022-07-22 Thread Paolo Bonzini
From: "Jason A. Donenfeld" Tiny machines optimized for fast boot time generally don't use EFI, which means a random seed has to be supplied some other way. For this purpose, Linux (≥5.20) supports passing a seed in the setup_data table with SETUP_RNG_SEED, specially intended for hypervisors,

[PULL 3/8] oss-fuzz: remove binaries from qemu-bundle tree

2022-07-22 Thread Paolo Bonzini
oss-fuzz is finding possible fuzzing targets even under qemu-bundle/.../bin, but they cannot be used because the required shared libraries are missing. Since the fuzzing targets are already placed manually in $OUT, the bindir and libexecdir subtrees are not needed; remove them. Cc: Alexander

[PULL 6/8] hw/mips: boston: pass random seed to fdt

2022-07-22 Thread Paolo Bonzini
From: "Jason A. Donenfeld" If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to initialize early. Set this using the usual guest random number generation function. This FDT node is part of the DT specification. I'd do the same for other MIPS platforms but boston is the only

[PULL v2 0/8] More fixes + random seed patches for QEMU 7.1

2022-07-22 Thread Paolo Bonzini
The following changes since commit 5288bee45fbd33203b61f8c76e41b15bb5913e6e: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2022-07-21 11:13:01 +0100) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream2 for you to fetch

[PULL 1/8] docs: Add caveats for Windows as the build platform

2022-07-22 Thread Paolo Bonzini
From: Bin Meng Commit cf60ccc3306c ("cutils: Introduce bundle mechanism") introduced a Python script to populate a bundle directory using os.symlink() to point to the binaries in the pc-bios directory of the source tree. Commit 882084a04ae9 ("datadir: Use bundle mechanism") removed previous

[PULL 2/8] accel/kvm: Avoid Coverity warning in query_stats()

2022-07-22 Thread Paolo Bonzini
From: Peter Maydell Coverity complains that there is a codepath in the query_stats() function where it can leak the memory pointed to by stats_list. This can only happen if the caller passes something other than STATS_TARGET_VM or STATS_TARGET_VCPU as the 'target', which no callsite does.

Re: Corrupted display changing screen colour depth in qemu-system-ppc/MacOS

2022-07-22 Thread Mark Cave-Ayland
On 22/07/2022 14:44, Marc-André Lureau wrote: Hi On Fri, Jul 22, 2022 at 4:28 PM Howard Spoelstra wrote: On Fri, Jun 17, 2022 at 2:38 PM Marc-André Lureau wrote: Hi On Fri, Jun 17, 2022 at 1:56 PM Gerd Hoffmann wrote: Hi, Can you try ditch the QEMU_ALLOCATED_FLAG check added

Re: [PATCH v3] hw/pci/pci_bridge: ensure PCIe slots have only one slot

2022-07-22 Thread Mark Cave-Ayland
On 22/07/2022 08:28, Thomas Huth wrote: On 21/07/2022 18.05, Mark Cave-Ayland wrote: On 21/07/2022 16:56, Daniel P. Berrangé wrote: On Thu, Jul 21, 2022 at 04:51:51PM +0100, Mark Cave-Ayland wrote: On 21/07/2022 15:28, Roman Kagan wrote: (lots cut) In the guest (Fedora 34): [root@test

Re: [PULL 7/9] hw/guest-loader: pass random seed to fdt

2022-07-22 Thread Paolo Bonzini
Ok I will resend the pull request. Apologies for overstepping. Paolo Il ven 22 lug 2022, 16:37 Alex Bennée ha scritto: > > "Jason A. Donenfeld" writes: > > > Hey Alex, > > > > On Fri, Jul 22, 2022 at 10:45:19AM +0100, Alex Bennée wrote: > >> All the guest-loader does is add the information

Re: [PATCH v2 2/3] target/s390x: display deprecation status in '-cpu help'

2022-07-22 Thread Cornelia Huck
On Fri, Jul 22 2022, Daniel P. Berrangé wrote: > When the user queries CPU models via QMP there is a 'deprecated' flag > present, however, this is not done for the CLI '-cpu help' command. > > Signed-off-by: Daniel P. Berrangé > --- > target/s390x/cpu_models.c | 23 ++- > 1

Re: [PATCH v2 3/3] target/arm: display deprecation status in '-cpu help'

2022-07-22 Thread Cornelia Huck
On Fri, Jul 22 2022, Daniel P. Berrangé wrote: > When the user queries CPU models via QMP there is a 'deprecated' flag > present, however, this is not done for the CLI '-cpu help' command. > > Signed-off-by: Daniel P. Berrangé > --- > target/arm/helper.c | 7 ++- > 1 file changed, 6

Re: [PATCH v2 1/3] target/i386: display deprecation status in '-cpu help'

2022-07-22 Thread Cornelia Huck
On Fri, Jul 22 2022, Daniel P. Berrangé wrote: > When the user queries CPU models via QMP there is a 'deprecated' flag > present, however, this is not done for the CLI '-cpu help' command. > > Signed-off-by: Daniel P. Berrangé > --- > target/i386/cpu.c | 5 + > 1 file changed, 5

Re: [PATCH] trivial: Fix duplicated words

2022-07-22 Thread Daniel P . Berrangé
On Fri, Jul 22, 2022 at 05:07:08PM +0200, Thomas Huth wrote: > On 22/07/2022 17.03, Daniel P. Berrangé wrote: > > On Fri, Jul 22, 2022 at 04:58:59PM +0200, Thomas Huth wrote: > > > Some files wrongly contain the same word twice in a row. > > > One of them should be removed or replaced. > > > > >

Re: [PATCH] trivial: Fix duplicated words

2022-07-22 Thread Thomas Huth
On 22/07/2022 17.03, Daniel P. Berrangé wrote: On Fri, Jul 22, 2022 at 04:58:59PM +0200, Thomas Huth wrote: Some files wrongly contain the same word twice in a row. One of them should be removed or replaced. Signed-off-by: Thomas Huth --- Removing duplicated words seems to be the new hip

Re: [PATCH v2 2/2] migration-test: Allow test to run without uffd

2022-07-22 Thread Daniel P . Berrangé
On Fri, Jul 22, 2022 at 10:56:54AM -0400, Peter Xu wrote: > We used to stop running all tests if uffd is not detected. However > logically that's only needed for postcopy not the rest of tests. > > Keep running the rest when still possible. > > Signed-off-by: Peter Xu > --- >

Re: [PATCH] trivial: Fix duplicated words

2022-07-22 Thread Daniel P . Berrangé
On Fri, Jul 22, 2022 at 04:58:59PM +0200, Thomas Huth wrote: > Some files wrongly contain the same word twice in a row. > One of them should be removed or replaced. > > Signed-off-by: Thomas Huth > --- > Removing duplicated words seems to be the new hip trend on the > Linux kernel mailing

[PATCH v2 1/2] migration-test: Use migrate_ensure_converge() for auto-converge

2022-07-22 Thread Peter Xu
Thomas reported that auto-converge test will timeout on MacOS CI gatings. Use the migrate_ensure_converge() helper too in the auto-converge as when Daniel reworked the other test cases. Since both max_bandwidth / downtime_limit will not be used for converge calculations, make it simple by

Re: [PATCH v2 1/2] migration-test: Use migrate_ensure_converge() for auto-converge

2022-07-22 Thread Daniel P . Berrangé
On Fri, Jul 22, 2022 at 10:56:53AM -0400, Peter Xu wrote: > Thomas reported that auto-converge test will timeout on MacOS CI gatings. > Use the migrate_ensure_converge() helper too in the auto-converge as when > Daniel reworked the other test cases. > > Since both max_bandwidth / downtime_limit

[PATCH v2 0/2] migration-test: Allow test to run without uffd

2022-07-22 Thread Peter Xu
Compare to v1, this added a new patch as reported by Thomas to (hopefully) allow auto-converge test to pass on some MacOS testbeds. Please review, thanks. Peter Xu (2): migration-test: Use migrate_ensure_converge() for auto-converge migration-test: Allow test to run without uffd

[PATCH] trivial: Fix duplicated words

2022-07-22 Thread Thomas Huth
Some files wrongly contain the same word twice in a row. One of them should be removed or replaced. Signed-off-by: Thomas Huth --- Removing duplicated words seems to be the new hip trend on the Linux kernel mailing lists - so let's be hip in QEMU land, too! ;-)

[PATCH v2 2/2] migration-test: Allow test to run without uffd

2022-07-22 Thread Peter Xu
We used to stop running all tests if uffd is not detected. However logically that's only needed for postcopy not the rest of tests. Keep running the rest when still possible. Signed-off-by: Peter Xu --- tests/qtest/migration-test.c | 48 +++- 1 file changed, 25

Re: Access target TranslatorOps

2022-07-22 Thread Alex Bennée
Kenneth Adam Miller writes: > Oh whoa, I thought I could have an architecture neutral way to > interface with the TCG to find this out. While the TCG intermediates are architecture neutral there are enough difference between the various guest architectures in the way exceptions are raised

Re: [PULL 7/9] hw/guest-loader: pass random seed to fdt

2022-07-22 Thread Alex Bennée
"Jason A. Donenfeld" writes: > Hey Alex, > > On Fri, Jul 22, 2022 at 10:45:19AM +0100, Alex Bennée wrote: >> All the guest-loader does is add the information about where in memory a >> guest and/or it's initrd have been placed in memory to the DTB. It's >> entirely up to the initial booted

Re: [PATCH v3 14/14] s390x: pv: Add dump support

2022-07-22 Thread Steffen Eiden
Hi Janosch, looks good to me. Have a look on my comments. On 7/21/22 15:22, Janosch Frank wrote: Sometimes dumping a guest from the outside is the only way to get the data that is needed. This can be the case if a dumping mechanism like KDUMP hasn't been configured or data needs to be fetched

Re: [PATCH v3 11/14] s390x: Add protected dump cap

2022-07-22 Thread Steffen Eiden
On 7/21/22 15:22, Janosch Frank wrote: Add a protected dump capability for later feature checking. Signed-off-by: Janosch Frank Reviewed-by: Steffen Eiden --- target/s390x/kvm/kvm.c | 7 +++ target/s390x/kvm/kvm_s390x.h | 1 + 2 files changed, 8 insertions(+) diff --git

Re: [PATCH v3 12/14] s390x: Introduce PV query interface

2022-07-22 Thread Steffen Eiden
On 7/21/22 15:22, Janosch Frank wrote: Introduce an interface over which we can get information about UV data. Signed-off-by: Janosch Frank Reviewed-by: Steffen Eiden --- hw/s390x/pv.c | 61 ++ hw/s390x/s390-virtio-ccw.c | 5

Re: [PATCH v3 13/14] s390x: Add KVM PV dump interface

2022-07-22 Thread Steffen Eiden
Hi Janosch, looks good to me. Have a look on my comments. On 7/21/22 15:22, Janosch Frank wrote: Let's add a few bits of code which hide the new KVM PV dump API from us via new functions. Signed-off-by: Janosch Frank --- hw/s390x/pv.c | 51

[PATCH v2 4/7] vdpa: Add asid parameter to vhost_vdpa_dma_map/unmap

2022-07-22 Thread Eugenio Pérez
So the caller can choose which ASID is destined. No need to update the batch functions as they will always be called from memory listener updates at the moment. Memory listener updates will always update ASID 0, as it's the passthrough ASID. All vhost devices's ASID are 0 at this moment.

Re: [PATCH v2] Loading new machines and devices from external modules

2022-07-22 Thread Drap, Anton
Hi Guys, Let me clarify my position about out of tree devices. Yes, I understand that current QEMU politics is to have all the supported platforms inside QEMU source tree, but actually simulator core development, development of the devices standard library and development of virtual

Re: Access target TranslatorOps

2022-07-22 Thread Kenneth Adam Miller
Oh whoa, I thought I could have an architecture neutral way to interface with the TCG to find this out. Yes, I do have to use the decode tree, and converting the script to output the codes would suffice for my case. However, I do not know how to do that at the moment. I've tried my best to

Re: Corrupted display changing screen colour depth in qemu-system-ppc/MacOS

2022-07-22 Thread Marc-André Lureau
Hi On Fri, Jul 22, 2022 at 4:28 PM Howard Spoelstra wrote: > > > > On Fri, Jun 17, 2022 at 2:38 PM Marc-André Lureau > wrote: >> >> Hi >> >> On Fri, Jun 17, 2022 at 1:56 PM Gerd Hoffmann wrote: >> > >> > Hi, >> > >> > > > Can you try ditch the QEMU_ALLOCATED_FLAG check added by the commit?

[PATCH v2 3/7] vdpa: Allocate SVQ unconditionally

2022-07-22 Thread Eugenio Pérez
SVQ may run or not in a device depending on runtime conditions (for example, if the device can move CVQ to its own group or not). Allocate the resources unconditionally, and decide later if to use them or not. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 33

[PATCH v2 7/7] vdpa: Always start CVQ in SVQ mode

2022-07-22 Thread Eugenio Pérez
Isolate control virtqueue in its own group, allowing to intercept control commands but letting dataplane run totally passthrough to the guest. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 3 +- net/vhost-vdpa.c | 158 +++-- 2 files

[PATCH v2 6/7] vhost_net: Add NetClientInfo prepare callback

2022-07-22 Thread Eugenio Pérez
This is used by the backend to perform actions before the device is started. In particular, vdpa will use it to isolate CVQ in its own ASID if possible, and start SVQ unconditionally only in CVQ. Signed-off-by: Eugenio Pérez --- include/net/net.h | 2 ++ hw/net/vhost_net.c | 4 2 files

[PATCH v2 1/7] linux-headers: Update kernel headers to v5.19-rc1

2022-07-22 Thread Eugenio Pérez
Main reason is for new vhost_vdpa address space ioctls to be available. Signed-off-by: Eugenio Pérez --- include/standard-headers/asm-x86/bootparam.h | 1 + include/standard-headers/drm/drm_fourcc.h| 69 include/standard-headers/linux/ethtool.h | 1 +

[PATCH v2 5/7] vdpa: Store x-svq parameter in VhostVDPAState

2022-07-22 Thread Eugenio Pérez
CVQ can be shadowed two ways: - Device has x-svq=on parameter (current way) - The device can isolate CVQ in its own vq group QEMU needs to check for the second condition dynamically, because CVQ index is not known at initialization time. Since this is dynamic, the CVQ isolation could vary with

[PATCH v2 0/7] ASID support in vhost-vdpa net

2022-07-22 Thread Eugenio Pérez
Control VQ is the way net devices use to send changes to the device state, like the number of active queues or its mac address. QEMU needs to intercept this queue so it can track these changes and is able to migrate the device. It can do it from 1576dbb5bbc4 ("vdpa: Add x-svq to

[PATCH v2 2/7] vdpa: Use v->shadow_vqs_enabled in vhost_vdpa_svqs_start & stop

2022-07-22 Thread Eugenio Pérez
This function used to trust in v->shadow_vqs != NULL to know if it must start svq or not. This is not going to be valid anymore, as qemu is going to allocate svq unconditionally (but it will only start them conditionally). Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 4 ++-- 1

Re: [PATCH v2 18/19] vdpa: Add device migration blocker

2022-07-22 Thread Eugenio Perez Martin
On Fri, Jul 15, 2022 at 10:51 AM Jason Wang wrote: > > On Fri, Jul 15, 2022 at 1:40 PM Eugenio Perez Martin > wrote: > > > > On Fri, Jul 15, 2022 at 6:03 AM Jason Wang wrote: > > > > > > On Fri, Jul 15, 2022 at 12:32 AM Eugenio Pérez > > > wrote: > > > > > > > > Since the vhost-vdpa device is

  1   2   >