Re: [PATCH v2 1/1] hw/i386/amd_iommu: Fix IOMMU event log encoding errors

2022-04-23 Thread Jason Wang
On Fri, Apr 22, 2022 at 1:52 PM Wei Huang wrote: > > Coverity issues several UNINIT warnings against amd_iommu.c [1]. This > patch fixes them by clearing evt before encoding. On top of it, this > patch changes the event log size to 16 bytes per IOMMU specification, > and fixes the event log entry

[PATCH 2/2] target/riscv: Add short-isa-string option

2022-04-23 Thread Tsukasa OI
Because some operating systems don't correctly parse long ISA extension string, this commit adds short-isa-string boolean option to disable generating long ISA extension strings on Device Tree. Operating Systems which short-isa-string might be helpful: 1. Linux (5.17 or earlier) 2. FreeBSD (at

[PATCH 0/2] target/riscv: ISA string conversion fix and enhancement

2022-04-23 Thread Tsukasa OI
Hello, There is two issues related to RISC-V ISA extension string I want to be fixed before QEMU 7.1 release. Issue 1 (workaround in PATCH 1): Related: Generating long ISA extension string is definately a good thing to merg

[PATCH 1/2] target/riscv: Tentatively remove Zhinx* from ISA extension string

2022-04-23 Thread Tsukasa OI
This commit disables ISA string conversion for Zhinx and Zhinxmin extensions for now. Because extension category ordering of "H" is not ratified, their ordering is likely invalid. Once "H"-extension ordering is determined, we can add Zhinx* again. Signed-off-by: Tsukasa OI --- target/riscv/cpu

Re: [PATCH v3] target/riscv: Fix incorrect PTE merge in walk_pte

2022-04-23 Thread Bin Meng
On Sun, Apr 24, 2022 at 5:59 AM Ralf Ramsauer wrote: > > Two non-subsequent PTEs can be mapped to subsequent paddrs. In this > case, walk_pte will erroneously merge them. > > Enforce the split up, by tracking the virtual base address. > > Let's say we have the mapping: > 0x8120 -> 0x89623000 (

Re: [RFC PATCH for-7.1] Remove the slirp submodule (and only compile with an external libslirp)

2022-04-23 Thread Brad Smith
On 4/20/2022 6:13 AM, Thomas Huth wrote: On 19/04/2022 18.24, Daniel P. Berrangé wrote: On Mon, Apr 11, 2022 at 08:55:19AM +0200, Thomas Huth wrote: On 11/04/2022 01.50, Brad Smith wrote: On 4/10/2022 5:06 AM, Peter Maydell wrote: On Sun, 10 Apr 2022 at 05:51, Brad Smith wrote: On 4/8/2022

[PATCH v3] target/riscv: Fix incorrect PTE merge in walk_pte

2022-04-23 Thread Ralf Ramsauer
Two non-subsequent PTEs can be mapped to subsequent paddrs. In this case, walk_pte will erroneously merge them. Enforce the split up, by tracking the virtual base address. Let's say we have the mapping: 0x8120 -> 0x89623000 (4K) 0x8120f000 -> 0x89624000 (4K) Before, walk_pte would have shown

Re: [PATCH v2] target/xtensa: import core lx106

2022-04-23 Thread Max Filippov
Hi Simon, On Fri, Apr 22, 2022 at 9:09 PM Simon Safar wrote: > > This is the core used in e.g. ESP8266 chips. Importing them > using import_core.sh, with the required files sourced from > > https://github.com/espressif/xtensa-overlays > > core-lx106.c was generated by the script; the only change

Re: [PATCH] target/xtensa: import core lx106

2022-04-23 Thread Max Filippov
On Fri, Apr 22, 2022 at 8:16 PM Simon Safar wrote: > It's for a (future...) Lisp compiler! Somewhat in the style of MicroPython; > the idea > is to make code editable on the fly, without reflashing (... or restarting, > even). Interesting. Do you use libisa or do you do instruction encoding on

Re: [PATCH V2 4/4] intel-iommu: PASID support

2022-04-23 Thread Michael S. Tsirkin
On Fri, Apr 22, 2022 at 11:03:51AM -0400, Peter Xu wrote: > On Sat, Apr 02, 2022 at 07:27:15AM +, Tian, Kevin wrote: > > > > > > Earlier when Yi proposed Qemu changes for guest SVA [1] he aimed for > > > a > > > > > > coarse-grained knob design: > > > > > > -- > > > > > > Intel VT-d 3.0 intro

[PATCH v2 33/34] meson: use have_vhost_* variables to pick sources

2022-04-23 Thread Paolo Bonzini
Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- Kconfig.host| 3 --- backends/meson.build| 8 ++-- hw/net/meson.build | 8 ++-- hw/virtio/Kconfig | 3 --- hw/virtio/meson.build | 25 - meson.build | 1 +

[PATCH v2 32/34] meson: create have_vhost_* variables

2022-04-23 Thread Paolo Bonzini
When using Meson options rather than config-host.h, the "when" clauses have to be changed to if statements (which is not necessarily great, though at least it highlights which parts of the build are per-target and which are not). Do that before moving vhost logic to meson.build, though for now the

[PATCH v2 31/34] build: move vhost-user-fs configuration to Kconfig

2022-04-23 Thread Paolo Bonzini
vhost-user-fs is a device and it should be possible to enable/disable it with --without-default-devices, not --without-default-features. Compute its default value in Kconfig to obtain the more intuitive behavior. In this case the configure options were undocumented, too. Reviewed-by: Marc-André L

Re: [PATCH v2] Warn user if the vga flag is passed but no vga device is created

2022-04-23 Thread Peter Maydell
On Sat, 23 Apr 2022 at 11:00, Gautam Agrawal wrote: > > I will make changes in hw/ppc/spapr.c . In hw/hppa/machine.c , > vga_interface_type is used inside if condition to check for graphics > device creation, but I am not able to find any relation with creation > of vga interface. Could you kindly

[PATCH v2 30/34] build: move vhost-scsi configuration to Kconfig

2022-04-23 Thread Paolo Bonzini
vhost-scsi and vhost-user-scsi are two devices of their own; it should be possible to enable/disable them with --without-default-devices, not --without-default-features. Compute their default value in Kconfig to obtain the more intuitive behavior. Reviewed-by: Marc-André Lureau Signed-off-by: Pa

[PATCH v2 24/34] configure: switch directory options to automatic parsing

2022-04-23 Thread Paolo Bonzini
While prefix, bindir and qemu_suffix needs special treatment due to differences between Windows and POSIX systems, everything else needs no extra code in configure. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 58 ++-

[PATCH v2 28/34] configure: simplify vhost-net-{user, vdpa} configuration

2022-04-23 Thread Paolo Bonzini
Cleanup to ease review of the conversion to meson. vhost_net_user and vhost_net_vdpa are never assigned anything in the command line parsing loop, so they are always equal to $vhost_user and $vhost_vdpa. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 17 ---

[PATCH v2 22/34] meson, configure: move --interp-prefix to meson

2022-04-23 Thread Paolo Bonzini
This is the last CONFIG_* entry in config-host.mak that had to be special cased. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 6 -- meson.build | 6 ++ meson_options.txt | 2 ++ scripts/meson-buildoptions.s

[PATCH v2 34/34] configure, meson: move vhost options to Meson

2022-04-23 Thread Paolo Bonzini
Finish the conversion by moving all the definitions and the constraint checks to meson_options.txt and meson.build respectively. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 82 --- meson.build

[PATCH v2 25/34] meson: pass more options directly as -D

2022-04-23 Thread Paolo Bonzini
If an option is not used anywhere by the configure script, it can be just added to $meson_options even if it is not parsed by the automatically generated bits in scripts/meson-buildoptions.sh. The only slightly tricky case is $debug, where the if test "$fortify_source" = "yes" ; then QEMU_C

[PATCH v2 27/34] meson, virtio: place all virtio-pci devices under virtio_pci_ss

2022-04-23 Thread Paolo Bonzini
Since a sourceset already exists for this, avoid unnecessary repeat of CONFIG_VIRTIO_PCI. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- hw/virtio/meson.build | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/virtio/meson.build b/hw/virtio/meson.bu

[PATCH v2 20/34] meson, configure: move bdrv whitelists to meson

2022-04-23 Thread Paolo Bonzini
Use the new support for string option parsing. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- v1->v2: fix RO/RW typo configure | 14 -- meson.build | 27 --- meson_options.txt | 4 scri

[PATCH v2 18/34] configure: switch string options to automatic parsing

2022-04-23 Thread Paolo Bonzini
Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 24 +--- scripts/meson-buildoptions.py | 5 + scripts/meson-buildoptions.sh | 9 + 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/configure b/config

[PATCH v2 29/34] build: move vhost-vsock configuration to Kconfig

2022-04-23 Thread Paolo Bonzini
vhost-vsock and vhost-user-vsock are two devices of their own; it should be possible to enable/disable them with --without-default-devices, not --without-default-features. Compute their default value in Kconfig to obtain the more intuitive behavior. Reviewed-by: Marc-André Lureau Signed-off-by:

[PATCH v2 26/34] configure: omit options with default values from meson command line

2022-04-23 Thread Paolo Bonzini
This has no functional change, it only makes the command line shorter and nicer. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 29 + meson.build | 2 +- meson_options.txt | 2 +- 3 files changed, 19 insertions(+), 14 dele

[PATCH v2 23/34] meson: always combine directories with prefix

2022-04-23 Thread Paolo Bonzini
Meson allows directories such as "bindir" to be relative to the prefix. Right now configure is forcing an absolute path, but that is not really necessary: just make sure all uses of the directory variables are prefixed appropriately. Do the same also for the options that are custom for QEMU, i.e.

[PATCH v2 15/34] meson-buildoptions: add support for string options

2022-04-23 Thread Paolo Bonzini
Allow using the buildoptions.json file for more options, namely anything that is not a boolean or multiple-choice. The mapping between configure and meson is messy for string options, so allow configure to use to something other than the name in meson_options.txt. This will come in handy anyway f

[PATCH v2 17/34] configure: move Windows flags detection to meson

2022-04-23 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- v1->v2: fix get_option('optimization') comparison to use a string configure | 20 meson.build | 8 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 0b236fda59..a6ba59cf6f 100755 --- a/con

[PATCH v2 21/34] meson, configure: move --with-pkgversion, CONFIG_STAMP to meson

2022-04-23 Thread Paolo Bonzini
The hash is now generated with a Python script. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 23 --- docs/meson.build | 2 +- meson.build | 10 +- meson_options.txt | 2 ++

[PATCH v2 19/34] meson, configure: move --tls-priority to meson

2022-04-23 Thread Paolo Bonzini
Use the new support for string option parsing. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 5 - meson.build | 3 ++- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 7 insertio

[PATCH v2 10/34] meson, configure: move usbfs test to meson

2022-04-23 Thread Paolo Bonzini
Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 28 meson.build | 13 + 2 files changed, 13 insertions(+), 28 deletions(-) diff --git a/configure b/configure index 313579019d..d527a9c22e 100755 --- a/configure +++ b/configur

[PATCH v2 13/34] meson, configure: move --enable-module-upgrades to meson

2022-04-23 Thread Paolo Bonzini
Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 14 -- meson.build | 7 ++- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 4 4 files changed, 12 insertions(+), 15 deletions(-) diff

[PATCH v2 16/34] configure, meson: move iasl detection to meson

2022-04-23 Thread Paolo Bonzini
Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 2 +- meson.build | 16 +--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/configure b/configure index a3ac5af863..0b236fda59 100755 --- a/configure +++ b/configure @@ -2506,7 +2506,7 @@

[PATCH v2 14/34] meson, configure: move Xen detection to meson

2022-04-23 Thread Paolo Bonzini
This is quite a complicated check. I moved all the test programs to a single file in scripts/, picking the right program with #if and a -D flag in meson.build's cc.links() invocation. Signed-off-by: Paolo Bonzini --- configure| 322 +-- meson.

[PATCH v2 09/34] meson, configure: move keyctl test to meson

2022-04-23 Thread Paolo Bonzini
Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 44 --- crypto/meson.build| 4 +++- meson.build | 15 +++- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh |

[PATCH v2 11/34] meson, configure: move libgio test to meson

2022-04-23 Thread Paolo Bonzini
Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- backends/meson.build | 2 +- configure | 58 --- meson.build | 32 --- meson_options.txt | 2 ++ scripts/meson-buildoptions

[PATCH v2 12/34] meson: remove CONFIG_XEN_PCI_PASSTHROUGH from config-target.h

2022-04-23 Thread Paolo Bonzini
CONFIG_XEN_PCI_PASSTHROUGH is just a global configuration option; it is never used in the source files, so there is no need to put CONFIG_XEN_PCI_PASSTHROUGH in config-target.h or even in config-host.h. This inaccuracy was copied over from the configure script in commit 8a19980e3f ("configure: mov

[PATCH v2 08/34] meson, configure: move RDMA options to meson

2022-04-23 Thread Paolo Bonzini
Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 115 - contrib/rdmacm-mux/meson.build | 4 +- meson.build| 56 ++-- meson_options.txt | 4 ++ migration/meson.build

[PATCH v2 06/34] configure: move --enable/--disable-debug-info to second option parsing pass

2022-04-23 Thread Paolo Bonzini
$debug_info is not needed anywhere except in the final meson invocation, no need to special case it. Reviewed-by: Marc-André Lureau Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/configure b

[PATCH v2 07/34] configure, meson: move OpenGL check to meson

2022-04-23 Thread Paolo Bonzini
Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 40 --- meson.build | 16 +- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ ui/meson.build

[PATCH v2 01/34] meson: show final set of compiler flags

2022-04-23 Thread Paolo Bonzini
The actual set of compiler flags can grow beyond what is found by the configure script, for example if gprof is used. Show the full set in the summary. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- meson.build | 8 1 file changed, 4 insertions(+), 4 deletions(-) dif

[PATCH v2 04/34] configure: pc-bios/qemu-icon.bmp does not exist

2022-04-23 Thread Paolo Bonzini
The file has been removed in commit a8260d3876 ("ui: install logo icons to $prefix/share/icons", 2019-01-21), do not try to symlink it in the build tree. Reviewed-by: Marc-André Lureau Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 1 - 1 file changed, 1 deletion(-) dif

[PATCH v2 02/34] configure: remove dead code

2022-04-23 Thread Paolo Bonzini
tcg_interpreter is never written, it is purely a meson option; trace_backends is never read. And SeaBIOS is only build from the source tree with roms/Makefile, so the config.mak file is unused. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 24 -

[PATCH v2 05/34] configure: gcov should not exclude fortify-source

2022-04-23 Thread Paolo Bonzini
There is no reason other than history (dating back to commit 1d728c3946, "tests: add gcov support", 2013-01-06) for this, remove this unnecessary conditional. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) dif

[PATCH v2 00/34] Misc meson conversions for QEMU 7.1

2022-04-23 Thread Paolo Bonzini
The more interesting bits here are: * move all remaining dependencies except glib to Meson (glib depends on https://github.com/mesonbuild/meson/pull/10206/) * many more options are parsed from introspection data, including string options * make all -D options optional on the meson command li

[PATCH v2 03/34] qga: wixl: get path to sysroot from pkg-config as intended

2022-04-23 Thread Paolo Bonzini
The .wxs file uses $(var.Mingw_bin) while configure/meson have always used Mingw_dlls. Fix them to match what was probably intended. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 4 ++-- qga/meson.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-

Re: [PATCH 04/20] target/ppc: Substitute msr_le macro with new M_MSR_LE macro

2022-04-23 Thread BALATON Zoltan
On Fri, 22 Apr 2022, Víctor Colombo wrote: Suggested-by: Richard Henderson Signed-off-by: Víctor Colombo --- target/ppc/cpu.h| 2 +- target/ppc/cpu_init.c | 2 +- target/ppc/gdbstub.c| 2 +- target/ppc/mem_helper.c | 16 4 files changed, 11 insertions(+), 11 deleti

Re: [PATCH v2] Warn user if the vga flag is passed but no vga device is created

2022-04-23 Thread Gautam Agrawal
I will make changes in hw/ppc/spapr.c . In hw/hppa/machine.c , vga_interface_type is used inside if condition to check for graphics device creation, but I am not able to find any relation with creation of vga interface. Could you kindly provide some pointers about it? thanks, Regards, Gautam Agra

[PATCH v3 1/3] hw/audio/ac97: Coding style fixes to avoid checkpatch errors

2022-04-23 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- v3: Fixed misalignments and drop spaces before commas hw/audio/ac97.c | 733 1 file changed, 360 insertions(+), 373 deletions(-) diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 3cb8131060..6b1c12bece 100644

[PATCH v3 2/3] hw/audio/ac97: Remove unimplemented reset functions

2022-04-23 Thread BALATON Zoltan
The warm_reset() and cold_reset() functions are not implemented and do nothing so no point in calling them or keep around as dead code. Therefore remove them for now. Signed-off-by: BALATON Zoltan --- hw/audio/ac97.c | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) diff -

[PATCH v3 3/3] hw/audio/ac97: Remove unneeded local variables

2022-04-23 Thread BALATON Zoltan
Several functions have a local variable that is just a copy of one of the function parameters. This is unneeded complication so just get rid of these. Signed-off-by: BALATON Zoltan Reviewed-by: Peter Maydell --- hw/audio/ac97.c | 102 +++- 1 file chan

[PATCH v3 0/3] Misc AC97 clean ups

2022-04-23 Thread BALATON Zoltan
During trying to implement via-ac97 I did some small clean ups to ac97 which is in this series. The via-ac97 is not working yet so that's not included but these unrelated clean ups could be merged now. v3: Fixed misalignments and drop spaces before commas (Víctor Colombo) v2: Added R-b and changes

Re: [PATCH v2 for-7.1 9/9] nbd: document what is protected by the CoMutexes

2022-04-23 Thread Paolo Bonzini
On 4/16/22 16:00, Vladimir Sementsov-Ogievskiy wrote: 14.04.2022 20:57, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini ---   block/nbd.c | 8 +++-   1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/nbd.c b/block/nbd.c index 31c684772e..d0d94b40bd 100644 --- a/block/nbd.c

Re: [PATCH v2 for-7.1 6/9] nbd: code motion and function renaming

2022-04-23 Thread Paolo Bonzini
On 4/16/22 14:37, Vladimir Sementsov-Ogievskiy wrote: 14.04.2022 20:57, Paolo Bonzini wrote: Prepare for the next patch, so that the diff is less confusing. nbd_client_connecting is moved closer to the definition point. Amm. To usage-point you mean? The original idea was to keep simple state-

Re: [PATCH v2 for-7.1 5/9] nbd: use a QemuMutex to synchronize yanking, reconnection and coroutines

2022-04-23 Thread Paolo Bonzini
On 4/16/22 14:18, Vladimir Sementsov-Ogievskiy wrote: 14.04.2022 20:57, Paolo Bonzini wrote: The condition for waiting on the s->free_sema queue depends on both s->in_flight and s->state.  The latter is currently using atomics, but this is quite dubious and probably wrong. Because s->state is w

Re: [PATCH v2 for-7.1 4/9] nbd: keep send_mutex/free_sema handling outside nbd_co_do_establish_connection

2022-04-23 Thread Paolo Bonzini
On 4/16/22 13:54, Vladimir Sementsov-Ogievskiy wrote: @@ -187,9 +187,6 @@ static void reconnect_delay_timer_cb(void *opaque)   if (qatomic_load_acquire(&s->state) == NBD_CLIENT_CONNECTING_WAIT) {   s->state = NBD_CLIENT_CONNECTING_NOWAIT;   nbd_co_establish_connection_cancel

Re: [PATCH v2 for-7.1 3/9] nbd: remove peppering of nbd_client_connected

2022-04-23 Thread Paolo Bonzini
Hi, thanks for the careful review and sorry I'm only replying now. On 4/15/22 19:01, Vladimir Sementsov-Ogievskiy wrote: @@ -982,11 +978,6 @@ static bool nbd_reply_chunk_iter_receive(BDRVNBDState *s,   NBDReply local_reply;   NBDStructuredReplyChunk *chunk;   Error *local_err = NUL

qemu questions about x86

2022-04-23 Thread 项晨东
Dear qemu developers: hello~ I'm Xiang Chen dong, a student from Tsinghua University. recently I am trying to accomplish new X86 feature named user-interrupts which can view here. I worked for a couple of time, reaching status that new msrs added and access of msrs is work well, also add new CPU

Re: [PATCH] target/xtensa: import core lx106

2022-04-23 Thread Simon Safar
Hi Max, On Thu, Apr 21, 2022, at 1:56 PM, Max Filippov wrote: > > An update to target/xtensa/cores.list is needed for this core to be built > in qemu-6.2+. Please keep that file alphabetically sorted. sounds great, thank you for the review!!! Will send out v2 soon. > I'm curious how is it suppo