[PATCH v3 2/5] plugins/cache: limited the scope of a mutex lock

2021-07-22 Thread Mahmoud Mandour
It's not necessary to lock the address translation portion of the vcpu_mem_access callback. Signed-off-by: Mahmoud Mandour --- contrib/plugins/cache.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index 4a71602639..695fb96

[PATCH v3 3/5] plugins/cache: Supported multicore cache modelling

2021-07-22 Thread Mahmoud Mandour
Multicore L1 cache modelling is introduced and is supported for both full system emulation and linux-user. For full-system emulation, L1 icache and dcache are maintained for each available core, since this information is exposed to the plugin through `qemu_plugin_n_vcpus()`. For linux-user, a sta

[PATCH v3 00/13] new plugin argument passing scheme

2021-07-22 Thread Mahmoud Mandour
Hello, This series removes passing arguments to plugins through "arg=" since it's redundant and reduces readability especially when the argument itself is composed of a name and a value. Also, passing arguments through "arg=" still works but is marked as deprecated and will produce a deprecation

[PATCH v3 04/13] plugins/hotblocks: Added correct boolean argument parsing

2021-07-22 Thread Mahmoud Mandour
Signed-off-by: Mahmoud Mandour --- contrib/plugins/hotblocks.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 4b08340143..062200a7a4 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/

[PATCH v3 11/13] tests/plugins/mem: introduce "track" arg and make args not positional

2021-07-22 Thread Mahmoud Mandour
This commit makes the plugin adhere to the new plugins arg-passing scheme by expecting full-form boolean args instead of short-form booleans. This necessitates that we introduce a new argument, here "track", to accept "r", "w", or "rw". Also, it makes arguments not positional and we only care abou

Re: [PATCH for-6.2 v2 02/11] machine: Make smp_parse generic enough for all arches

2021-07-22 Thread wangyanan (Y)
On 2021/7/20 14:57, Cornelia Huck wrote: On Mon, Jul 19 2021, Yanan Wang wrote: Currently the only difference between smp_parse and pc_smp_parse is the support of multi-dies and the related error reporting code. With an arch compat variable "bool smp_dies_supported", we can easily make smp_par

[PATCH v3 02/13] plugins/api: added a boolean parsing plugin api

2021-07-22 Thread Mahmoud Mandour
This call will help boolean argument parsing since arguments are now passed to plugins as a name and value. Signed-off-by: Mahmoud Mandour --- include/qemu/qemu-plugin.h | 13 + plugins/api.c | 5 + 2 files changed, 18 insertions(+) diff --git a/include/qemu/qemu-p

[PATCH v3 01/13] plugins: allow plugin arguments to be passed directly

2021-07-22 Thread Mahmoud Mandour
Passing arguments to plugins had to be done through "arg=". This is redundant and introduces confusion especially when the argument has a name and value (e.g. `-plugin plugin_name,arg="argname=argvalue"`). This allows passing plugin arguments directly e.g: `-plugin plugin_name,argname=argvalu

[PATCH v3 12/13] tests/plugins/syscalls: adhere to new arg-passing scheme

2021-07-22 Thread Mahmoud Mandour
Signed-off-by: Mahmoud Mandour --- tests/plugin/syscall.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/plugin/syscall.c b/tests/plugin/syscall.c index 6dd71092e1..484b48de49 100644 --- a/tests/plugin/syscall.c +++ b/tests/plugin/syscall.c @@ -

[PATCH v3 05/13] plugins/lockstep: make socket path not positional & parse bool arg

2021-07-22 Thread Mahmoud Mandour
Signed-off-by: Mahmoud Mandour --- contrib/plugins/lockstep.c | 31 ++- docs/devel/tcg-plugins.rst | 2 +- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index 7fd35eb669..a41ffe83fa 100644 ---

[PATCH v3 06/13] plugins/hwprofile: adapt to the new plugin arguments scheme

2021-07-22 Thread Mahmoud Mandour
Parsing boolean arguments correctly (e.g. pattern=on or source=false). Introduced a new "track" argument that takes a [read|write] value. This substitutes passing read or write to "arg=" that is deprecated. Also, matches are now taken one by one through the "match" argument. Signed-off-by: Mahmou

[PATCH v3 03/13] plugins/hotpages: introduce sortby arg and parsed bool args correctly

2021-07-22 Thread Mahmoud Mandour
Since plugin arguments now expect boolean arguments, a plugin argument name "sortby" now expects a value of "read", "write", or "address". "io" arg is now expected to be passed as a full-form boolean parameter, i.e. "io=on|true|yes|off|false|no" Signed-off-by: Mahmoud Mandour --- contrib/plugin

[PATCH v3 09/13] tests/plugins/bb: adapt to the new arg passing scheme

2021-07-22 Thread Mahmoud Mandour
Signed-off-by: Mahmoud Mandour --- tests/plugin/bb.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index de09bdde4e..7d470a1011 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -104,10 +104,17 @@ QEMU_PLUGIN_EXP

[PATCH v3 07/13] plugins/howvec: Adapting to the new argument passing scheme.

2021-07-22 Thread Mahmoud Mandour
Correctly parsing plugin argument since they now must be provided as full-form boolean parameters, e.g.: -plugin ./contrib/plugins/libhowvec.so,verbose=on,inline=on Also, introduced the argument "count" that accepts one opt to count individually at a time. Signed-off-by: Mahmoud Mandour ---

[PATCH v3 08/13] docs/tcg-plugins: new passing parameters scheme for cache docs

2021-07-22 Thread Mahmoud Mandour
Signed-off-by: Mahmoud Mandour --- docs/devel/tcg-plugins.rst | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 9377bc51d8..7b1a3921b6 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-pl

[PATCH v3 10/13] tests/plugins/insn: made arg inline not positional and parse it as bool

2021-07-22 Thread Mahmoud Mandour
Made argument "inline" not positional, this has two benefits. First is that we adhere to how QEMU passes args generally, by taking the last value of an argument and drop the others. And the second is that this sets up a framework for potentially adding new args easily. Signed-off-by: Mahmoud Mando

[PATCH v3 13/13] docs/deprecated: deprecate passing plugin args through `arg=`

2021-07-22 Thread Mahmoud Mandour
Signed-off-by: Mahmoud Mandour --- docs/system/deprecated.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index e2e0090878..7ae6f1f727 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -126,6 +126,13

Re: [PATCH for-6.2 v2 02/11] machine: Make smp_parse generic enough for all arches

2021-07-22 Thread wangyanan (Y)
On 2021/7/20 0:53, Daniel P. Berrangé wrote: On Mon, Jul 19, 2021 at 11:20:34AM +0800, Yanan Wang wrote: Currently the only difference between smp_parse and pc_smp_parse is the support of multi-dies and the related error reporting code. With an arch compat variable "bool smp_dies_supported", we

[PATCH] usbredir: fix free call

2021-07-22 Thread Gerd Hoffmann
data might point into the middle of a larger buffer, there is a separate free_on_destroy pointer passed into bufp_alloc() to handle that. It is only used in the normal workflow though, not when dropping packets due to the queue being full. Fix that. Resolves: https://gitlab.com/qemu-project/qemu

Re: [PATCH v2 07/22] target/loongarch: Add fixed point arithmetic instruction translation

2021-07-22 Thread Song Gao
Hi, Philippe, On 07/22/2021 01:49 AM, Philippe Mathieu-Daudé wrote: > On 7/21/21 7:38 PM, Philippe Mathieu-Daudé wrote: >> On 7/21/21 11:53 AM, Song Gao wrote: >>> This patch implement fixed point arithemtic instruction translation. > > Typo arithmetic. > >>> >>> This includes: >>> - ADD.{W/D},

Re: [PATCH] usbredir: fix free call

2021-07-22 Thread Marc-André Lureau
Hi On Thu, Jul 22, 2021 at 11:28 AM Gerd Hoffmann wrote: > data might point into the middle of a larger buffer, there is a separate > free_on_destroy pointer passed into bufp_alloc() to handle that. It is > only used in the normal workflow though, not when dropping packets due > to the queue be

master: make check buzzes forever in qos-test

2021-07-22 Thread Claudio Fontana
Hi all, I see a strange effect on master, with cd build ../configure --enable-kvm --enable-debug --enable-tcg --target-list=x86_64-softmmu make -j make -j check ... Not run: 220 287 Passed all 121 iotests [buzzes here] ps -a PID TTY TIME CMD 3609 pts/000:00:00 make 4196 pts

Re: [PATCH for-6.2 v2 00/11] machine: smp parsing fixes and improvement

2021-07-22 Thread Pierre Morel
On 7/21/21 2:38 PM, wangyanan (Y) wrote: On 2021/7/20 0:57, Cornelia Huck wrote: On Mon, Jul 19 2021, Yanan Wang wrote: Hi, This is v2 of the series [1] that I have posted to introduce some smp parsing fixes and improvement, much more work has been processed compared to RFC v1. [1] ht

RE: [PATCH] This is a test mail

2021-07-22 Thread ishii.shuuic...@fujitsu.com
> FWIW, this mail seems to have been accepted by the qemu-arm list: > https://lists.gnu.org/archive/html/qemu-arm/2021-07/msg00341.html > but it didn't get to the qemu-devel list. Thank you for letting us know. As you said, it seems that it is not listed in qemu-devel. We are checking with the adm

RE: [PATCH 0/4] Add support for Fujitsu A64FX processor

2021-07-22 Thread ishii.shuuic...@fujitsu.com
Hi, Philippe. > Meanwhile you can send your series via sourcehut: https://sr.ht/ Thank you for providing useful information. We will use the above sites as needed. Best regards. > -Original Message- > From: Philippe Mathieu-Daudé > Sent: Tuesday, July 20, 2021 8:25 PM > To: Ishii, Shuu

Re: [PATCH 08/16] whpx nvmm: Drop useless migrate_del_blocker()

2021-07-22 Thread Reinoud Zandijk
On Tue, Jul 20, 2021 at 02:54:00PM +0200, Markus Armbruster wrote: > There is nothing to delete after migrate_add_blocker() failed. Trying > anyway is safe, but useless. Don't. > > Cc: Sunil Muthuswamy > Cc: Kamil Rytarowski > Cc: Reinoud Zandijk > Signed-off-by: Markus Armbruster > --- > t

Re: [PATCH for-6.2 v2 05/11] machine: Improve the error reporting of smp parsing

2021-07-22 Thread wangyanan (Y)
On 2021/7/20 0:53, Andrew Jones wrote: On Mon, Jul 19, 2021 at 11:20:37AM +0800, Yanan Wang wrote: We totally have two requirements for a valid SMP configuration: s/totally// the sum of "sockets * dies * cores * threads" must represent all the product the possible cpus, i.e., max_cpus, and

Re: master: make check buzzes forever in qos-test

2021-07-22 Thread Philippe Mathieu-Daudé
On 7/22/21 9:49 AM, Claudio Fontana wrote: > Hi all, > > I see a strange effect on master, with > > cd build > ../configure --enable-kvm --enable-debug --enable-tcg > --target-list=x86_64-softmmu > make -j > > make -j check > ... > > Not run: 220 287 > Passed all 121 iotests > [buzzes here] >

[Bug 1860553] Re: cmake crashes on qemu-alpha-user with Illegal Instruction

2021-07-22 Thread Philippe Mathieu-Daudé
** Changed in: qemu Status: Expired => New -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1860553 Title: cmake crashes on qemu-alpha-user with Illegal Instruction Status in QEMU: New Bug

Re: [PATCH v2 09/22] target/loongarch: Add fixed point bit instruction translation

2021-07-22 Thread Song Gao
Hi, Philippe On 07/22/2021 01:46 AM, Philippe Mathieu-Daudé wrote: > On 7/21/21 11:53 AM, Song Gao wrote: >> This patch implement fixed point bit instruction translation. >> >> This includes: >> - EXT.W.{B/H} >> - CL{O/Z}.{W/D}, CT{O/Z}.{W/D} >> - BYTEPICK.{W/D} >> - REVB.{2H/4H/2W/D} >> - REVH.{2

Re: [PULL 36/40] vl: switch -M parsing to keyval

2021-07-22 Thread Peter Krempa
CC libvir-list On Tue, Jul 06, 2021 at 12:01:37 +0200, Paolo Bonzini wrote: > Switch from QemuOpts to keyval. This enables the introduction > of non-scalar machine properties, and JSON syntax in the future. > > For JSON syntax to be supported right now, we would have to > consider what would hap

Re: [PATCH v3 2/3] hw/net: e1000e: Correct the initial value of VET register

2021-07-22 Thread Jason Wang
在 2021/7/21 下午12:15, Bin Meng 写道: From: Christina Wang The initial value of VLAN Ether Type (VET) register is 0x8100, as per the manual and real hardware. While Linux e1000e driver always writes VET register to 0x8100, it is not always the case for everyone. Drivers relying on the reset valu

Re: [PATCH for-6.2 v2 00/11] machine: smp parsing fixes and improvement

2021-07-22 Thread wangyanan (Y)
On 2021/7/22 15:51, Pierre Morel wrote: On 7/21/21 2:38 PM, wangyanan (Y) wrote: On 2021/7/20 0:57, Cornelia Huck wrote: On Mon, Jul 19 2021, Yanan Wang wrote: Hi, This is v2 of the series [1] that I have posted to introduce some smp parsing fixes and improvement, much more work has been

Re: [PATCH v3 1/3] hw/net: e1000: Correct the initial value of VET register

2021-07-22 Thread Jason Wang
在 2021/7/21 下午12:15, Bin Meng 写道: From: Christina Wang The initial value of VLAN Ether Type (VET) register is 0x8100, as per the manual and real hardware. While Linux e1000 driver always writes VET register to 0x8100, it is not always the case for everyone. Drivers relying on the reset value

Re: [PATCH 0/5] ebpf: Added ebpf helper for libvirtd.

2021-07-22 Thread Andrew Melnichenko
ping On Tue, Jul 13, 2021 at 6:38 PM Andrew Melnychenko wrote: > Libvirt usually launches qemu with strict permissions. > To enable eBPF RSS steering, qemu-ebpf-rss-helper was added. > > Added property "ebpf_rss_fds" for "virtio-net" that allows to > initialize eBPF RSS context with passed progr

[PATCH for-6.1] i386: do not call cpudef-only models functions for max, host, base

2021-07-22 Thread Claudio Fontana
properties set by function x86_cpu_apply_props, including kvm_default_props, tcg_default_props, and the "vendor" property for KVM and HVF, are actually to be set only for cpu models in builtin_x86_defs, registered with x86_register_cpu_model_type, and not for cpu models "base", "max", and the subc

Re: master: make check buzzes forever in qos-test

2021-07-22 Thread Claudio Fontana
On 7/22/21 10:12 AM, Philippe Mathieu-Daudé wrote: > On 7/22/21 9:49 AM, Claudio Fontana wrote: >> Hi all, >> >> I see a strange effect on master, with >> >> cd build >> ../configure --enable-kvm --enable-debug --enable-tcg >> --target-list=x86_64-softmmu >> make -j >> >> make -j check >> ... >>

Re: [PATCH for-6.2 32/34] target/arm: Implement MVE scatter-gather insns

2021-07-22 Thread Peter Maydell
On Thu, 22 Jul 2021 at 01:36, Richard Henderson wrote: > > On 7/13/21 3:37 AM, Peter Maydell wrote: > > +static bool do_ldst_sg(DisasContext *s, arg_vldst_sg *a, MVEGenLdStSGFn fn) > > +{ > > +TCGv_i32 addr; > > +TCGv_ptr qd, qm; > > + > > +if (!dc_isar_feature(aa32_mve, s) || > > +

Re: intermittent hang in qos-test for qemu-system-i386 on 32-bit arm host

2021-07-22 Thread Claudio Fontana
On 7/10/21 3:30 PM, Peter Maydell wrote: > I've noticed recently that intermittently 'make check' will hang on > my aarch32 test system (really an aarch64 box with an aarch32 chroot). > > I think from grep that this must be the vhost-user-blk test. > > Here's the process tree: > > pmaydell 13126

[PATCH] hw/pcie-root-port: Fix hotplug for PCI devices requiring IO

2021-07-22 Thread Marcel Apfelbaum
Q35 has now ACPI hotplug enabled by default for PCI(e) devices. As opposed to native PCIe hotplug, some guests will not assign IO range to pcie-root-ports not supporting native hotplug, resulting into a regression. Fix it by setting the "reserve-io" hint capability of the pcie-root-ports so the fi

Re: [PATCH v2] qom/object.c 'if (type_table == NULL)' statement is redundant , delete it.

2021-07-22 Thread 朱光宏
 Hi Signed-off-by: zhuguanghong https://developer.gnome.org/glib/stable/glib-Threads.html#g-once-init-enter I would have thought QOM usage is so widespread in QEMU that we'll trigger initialization of this hash tble very early in startup while we're still single threaded. That said there's not re

Re: [PATCH v6 0/6] hmp, qmp: Add some commands to introspect virtio devices

2021-07-22 Thread Jason Wang
在 2021/7/21 下午4:53, Jonah Palmer 写道: Hi Jason. My apologies for the delayed response, several work-related things came up recently, but they're slowing down now so I'm turning my attention these patches to get taken care of. A few questions and comments below (and in other following patche

Re: [PATCH v6 6/6] hmp: add virtio commands

2021-07-22 Thread Jason Wang
在 2021/7/21 下午5:11, Jonah Palmer 写道: On 7/13/21 10:40 PM, Jason Wang wrote: 在 2021/7/12 下午6:35, Jonah Palmer 写道: +void hmp_virtio_queue_status(Monitor *mon, const QDict *qdict) +{ +    Error *err = NULL; +    const char *path = qdict_get_try_str(qdict, "path"); +    int queue = qdict_get_i

Re: [PATCH v2] qom/object.c 'if (type_table == NULL)' statement is redundant , delete it.

2021-07-22 Thread Daniel P . Berrangé
On Thu, Jul 22, 2021 at 05:15:46PM +0800, 朱光宏 wrote: >  Hi > Signed-off-by: zhuguanghong --- >  qom/object.c | 4 >  1 file changed, 4 insertions(+) > > > diff --git a/qom/object.c b/qom/object.c > index 6a01d56546..dc0a363ed0 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -73,15 +73,

Re: [PATCH v6 4/6] qmp: add QMP command x-debug-virtio-queue-status

2021-07-22 Thread Jason Wang
在 2021/7/21 下午4:59, Jonah Palmer 写道: On 7/13/21 10:37 PM, Jason Wang wrote: 在 2021/7/12 下午6:35, Jonah Palmer 写道: From: Laurent Vivier This new command shows internal status of a VirtQueue. (vrings and indexes). Signed-off-by: Laurent Vivier Signed-off-by: Jonah Palmer ---   hw/virtio/

[PATCH] qom/object.c How about using G_LOCK ? thread safety

2021-07-22 Thread zhuguanghong
Signed-off-by: zhuguanghong --- qom/object.c | 4 1 file changed, 4 insertions(+) diff --git a/qom/object.c b/qom/object.c index 6a01d56546..dc0a363ed0 100644 --- a/qom/object.c +++ b/qom/object.c @@ -73,15 +73,19 @@ struct TypeImpl }; static Type type_interface; +G_LOCK_DEFINE (GHashTa

Re: [PATCH] hw/net/vmxnet3: Do not abort QEMU if guest specified bad queue numbers

2021-07-22 Thread Jason Wang
在 2021/7/21 下午10:15, Thomas Huth 写道: QEMU should never terminate unexpectedly just because the guest is doing something wrong like specifying wrong queue numbers. Let's simply refuse to set the device active in this case. Buglink: https://bugs.launchpad.net/qemu/+bug/1890160 Signed-off-by: Tho

Re: [PATCH] hw/net/net_tx_pkt: Fix crash detected by fuzzer

2021-07-22 Thread Jason Wang
在 2021/7/16 上午3:32, Thomas Huth 写道: QEMU currently crashes when it's started like this: cat << EOF | ./qemu-system-i386 -device vmxnet3 -nodefaults -qtest stdio outl 0xcf8 0x80001014 outl 0xcfc 0xe0001000 outl 0xcf8 0x80001018 outl 0xcf8 0x80001004 outw 0xcfc 0x7 outl 0xcf8 0x80001083 write 0x

[PATCH v3] migration: clear the memory region dirty bitmap when skipping free pages

2021-07-22 Thread Wei Wang
When skipping free pages to send, their corresponding dirty bits in the memory region dirty bitmap need to be cleared. Otherwise the skipped pages will be sent in the next round after the migration thread syncs dirty bits from the memory region dirty bitmap. Cc: David Hildenbrand Cc: Peter Xu Cc

[Bug 1860553] Re: cmake crashes on qemu-alpha-user with Illegal Instruction

2021-07-22 Thread Thomas Huth
This is an automated cleanup. This bug report has been moved to QEMU's new bug tracker on gitlab.com and thus gets marked as 'expired' now. Please continue with the discussion here: https://gitlab.com/qemu-project/qemu/-/issues/494 ** Changed in: qemu Status: New => Expired ** Bug watch

Re: [PATCH v3] migration: clear the memory region dirty bitmap when skipping free pages

2021-07-22 Thread David Hildenbrand
On 22.07.21 10:30, Wei Wang wrote: When skipping free pages to send, their corresponding dirty bits in the memory region dirty bitmap need to be cleared. Otherwise the skipped pages will be sent in the next round after the migration thread syncs dirty bits from the memory region dirty bitmap. Cc

Re: [PULL v3 05/19] hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35

2021-07-22 Thread Laurent Vivier
On 21/07/2021 18:37, Michael S. Tsirkin wrote: > On Wed, Jul 21, 2021 at 06:27:33PM +0200, Igor Mammedov wrote: >> On Wed, 21 Jul 2021 12:09:01 -0400 >> "Michael S. Tsirkin" wrote: >> >>> On Wed, Jul 21, 2021 at 05:49:16PM +0200, Laurent Vivier wrote: On 21/07/2021 16:59, Igor Mammedov wrote:

RE: [PATCH v3] migration: clear the memory region dirty bitmap when skipping free pages

2021-07-22 Thread Wang, Wei W
On Thursday, July 22, 2021 5:48 PM, David Hildenbrand wrote: > On 22.07.21 10:30, Wei Wang wrote: > > When skipping free pages to send, their corresponding dirty bits in > > the memory region dirty bitmap need to be cleared. Otherwise the > > skipped pages will be sent in the next round after the m

Prefetches in buffer_zero_*

2021-07-22 Thread Dr. David Alan Gilbert
Hi Richard, I think you were the last person to fiddle with the prefetching in buffer_zero_avx2 and friends; Joe (cc'd) wondered if explicit prefetching still made sense on modern CPUs, and that their hardware generally figures stuff out better on simple increments. What was your thinking on t

[PATCH] nbd/server: Suppress Broken pipe errors on abrupt disconnection

2021-07-22 Thread Richard W.M. Jones
This simple patch suppresses a warning message from qemu-nbd when a client abruptly disconnects. There is a way to work around this in the client (by shutting down the connection properly). Nevertheless the "Broken pipe" error seems unnecessary to me as it does not convey any useful information a

[PATCH] nbd/server: Suppress Broken pipe errors on abrupt disconnection

2021-07-22 Thread Richard W.M. Jones
$ rm -f /tmp/sock /tmp/pid $ qemu-img create -f qcow2 /tmp/disk.qcow2 1M $ qemu-nbd -t --format=qcow2 --socket=/tmp/sock --pid-file=/tmp/pid /tmp/disk.qcow2 & $ nbdsh -u 'nbd+unix:///?socket=/tmp/sock' -c 'h.get_size()' qemu-nbd: Disconnect client, due to: Failed to send reply: Unable to write to

Re: [PULL v3 05/19] hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35

2021-07-22 Thread Igor Mammedov
On Wed, 21 Jul 2021 12:37:40 -0400 "Michael S. Tsirkin" wrote: > On Wed, Jul 21, 2021 at 06:27:33PM +0200, Igor Mammedov wrote: > > On Wed, 21 Jul 2021 12:09:01 -0400 > > "Michael S. Tsirkin" wrote: > > > > > On Wed, Jul 21, 2021 at 05:49:16PM +0200, Laurent Vivier wrote: > > > > On 21/07/2

Re: [PATCH for-6.1 0/1] machine: Disallow specifying topology parameters as zero

2021-07-22 Thread wangyanan (Y)
On 2021/7/22 14:02, Cornelia Huck wrote: On Thu, Jul 22 2021, Yanan Wang wrote: In the SMP configuration, we should either specify a topology parameter with a reasonable value (equal to or greater than 1) or just leave it omitted and QEMU will calculate its value. Configurations which explicit

[PATCH 0/2] acpi: pcihp: fix hotplug when bridge is wired to function > 0

2021-07-22 Thread Igor Mammedov
For full description see 2/2. Tested hotplug on Q35 (see 2/2 for reproducer) and PC (with pci-bridge) machines Igor Mammedov (2): acpi: x86: pcihp: cleanup devfn usage in build_append_pci_bus_devices() acpi: x86: pcihp: add support hotplug on multifunction bridges hw/i386/acpi-build.c |

[PATCH 1/2] acpi: x86: pcihp: cleanup devfn usage in build_append_pci_bus_devices()

2021-07-22 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- hw/i386/acpi-build.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 17836149fe..b40e284b72 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -374,7 +374,7 @@ static

[PATCH 2/2] acpi: x86: pcihp: add support hotplug on multifunction bridges

2021-07-22 Thread Igor Mammedov
Commit 17858a1695 (hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35) switched PCI hotplug from native to ACPI one by default. That however breaks ihotplug on following CLI that used to work: -nodefaults -machine q35 \ -device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie

Re: [PATCH for-6.2 03/23] target/avr: Drop checks for singlestep_enabled

2021-07-22 Thread Michael Rolnik
Reviewed-by: Michael Rolnik Tested-by: Michael Rolnik On Wed, Jul 21, 2021 at 9:00 PM Philippe Mathieu-Daudé wrote: > +Michael/Alex/Pavel > > On 7/21/21 8:41 AM, Richard Henderson wrote: > > GDB single-stepping is now handled generically. > > > > Signed-off-by: Richard Henderson > > --- > >

Re: [PATCH v2 0/6] migration/ram: Optimize for virtio-mem via RamDiscardManager

2021-07-22 Thread Dr. David Alan Gilbert
* David Hildenbrand (da...@redhat.com) wrote: > virtio-mem exposes a dynamic amount of memory within RAMBlocks by > coordinating with the VM. Memory within a RAMBlock can either get > plugged and consequently used by the VM, or unplugged and consequently no > longer used by the VM. Logical unplug i

Re: [PATCH v2 0/6] migration/ram: Optimize for virtio-mem via RamDiscardManager

2021-07-22 Thread David Hildenbrand
On 22.07.21 13:29, Dr. David Alan Gilbert wrote: * David Hildenbrand (da...@redhat.com) wrote: virtio-mem exposes a dynamic amount of memory within RAMBlocks by coordinating with the VM. Memory within a RAMBlock can either get plugged and consequently used by the VM, or unplugged and consequentl

Re: [PATCH] hw/display: fix virgl reset regression

2021-07-22 Thread Gerd Hoffmann
On Fri, Jul 02, 2021 at 04:32:21PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Before commit 49afbca3b00e8e517d54964229a794b51768deaf ("virtio-gpu: drop > use_virgl_renderer"), use_virgl_renderer was preventing calling GL > functions from non-GL context threads. The in

[PATCH 0/3] i386/kvm: Paravirtualized features usage enforcement

2021-07-22 Thread Vitaly Kuznetsov
[I know this is probably too late for 6.1 but maybe the first patch of the series is good as it just adds a missing doc?] By default, KVM doesn't limit the usage of paravirtualized feature (neither native KVM nor Hyper-V) to what was exposed to the guest in CPUIDs making it possible to use all of

[PATCH 2/3] i386: Support KVM_CAP_ENFORCE_PV_FEATURE_CPUID

2021-07-22 Thread Vitaly Kuznetsov
By default, KVM allows the guest to use all currently supported PV features even when they were not announced in guest visible CPUIDs. Introduce a new "kvm-pv-enforce-cpuid" flag to limit the supported feature set to the exposed features. The feature is supported by Linux >= 5.10 and is not enabled

[PATCH 3/3] i386: Support KVM_CAP_HYPERV_ENFORCE_CPUID

2021-07-22 Thread Vitaly Kuznetsov
By default, KVM allows the guest to use all currently supported Hyper-V enlightenments when Hyper-V CPUID interface was exposed, regardless of if some features were not announced in guest visible CPUIDs. hv-enforce-cpuid feature alters this behavior and only allows the guest to use exposed Hyper-V

[PATCH 1/3] docs: Briefly describe KVM PV features

2021-07-22 Thread Vitaly Kuznetsov
KVM PV features don't seem to be documented anywhere, in particular, the fact that some of the features are enabled by default and some are not can only be figured out from the code. Signed-off-by: Vitaly Kuznetsov --- docs/kvm-pv.txt | 92 + 1 fil

Re: [PATCH for-6.1?] iotest: Further enhance qemu-img-bitmaps

2021-07-22 Thread Vladimir Sementsov-Ogievskiy
21.07.2021 23:46, Eric Blake wrote: Add a regression test to make sure we detect attempts to use 'qemu-img bitmap' to modify an in-use local file. Suggested-by: Nir Soffer Signed-off-by: Eric Blake --- Sadly, this missed my bitmaps pull request today. If there's any reason to respin that pul

[PATCH for-6.1? 0/6] mirror: Handle errors after READY cancel

2021-07-22 Thread Max Reitz
Hi, This is a rather complex series with changes that aren’t exactly local to the mirror job, so maybe it’s too complex for 6.1. However, it is a bug fix, and not an insignificant one, though probably not a regression of any kind. Bug report: https://gitlab.com/qemu-project/qemu/-/issues/462 (I

[PATCH for-6.1? 1/6] mirror: Keep s->synced on error

2021-07-22 Thread Max Reitz
An error does not take us out of the READY phase, which is what s->synced signifies. It does of course mean that source and target are no longer in sync, but that is what s->actively_sync is for -- s->synced never meant that source and target are in sync, only that they were at some point (and at

[PATCH for-6.1? 2/6] job: @force parameter for job_cancel_sync{, _all}()

2021-07-22 Thread Max Reitz
Callers should be able to specify whether they want job_cancel_sync() to force-cancel the job or not. In fact, almost all invocations do not care about consistency of the result and just want the job to terminate as soon as possible, so they should pass force=true. The replication block driver is

[PATCH for-6.1? 5/6] mirror: Check job_is_cancelled() earlier

2021-07-22 Thread Max Reitz
We must check whether the job is force-cancelled early in our main loop, most importantly before any `continue` statement. For example, we used to have `continue`s before our current checking location that are triggered by `mirror_flush()` failing. So, if `mirror_flush()` kept failing, force-canc

Re: [PATCH for-6.2 v2 04/11] machine: Use the computed parameters to calculate omitted cpus

2021-07-22 Thread Andrew Jones
On Thu, Jul 22, 2021 at 12:42:55PM +0800, wangyanan (Y) wrote: > On 2021/7/20 0:42, Andrew Jones wrote: > > On Mon, Jul 19, 2021 at 11:20:36AM +0800, Yanan Wang wrote: > > > Currently we directly calculate the omitted cpus based on the already > > > provided parameters. This makes some cmdlines lik

[PATCH for-6.1? 3/6] jobs: Give Job.force_cancel more meaning

2021-07-22 Thread Max Reitz
We largely have two cancel modes for jobs: First, there is actual cancelling. The job is terminated as soon as possible, without trying to reach a consistent result. Second, we have mirror in the READY state. Technically, the job is not really cancelled, but it just is a different completion mo

[PATCH for-6.1? 4/6] job: Add job_cancel_requested()

2021-07-22 Thread Max Reitz
Most callers of job_is_cancelled() actually want to know whether the job is on its way to immediate termination. For example, we refuse to pause jobs that are cancelled; but this only makes sense for jobs that are really actually cancelled. A mirror job that is cancelled during READY with force=f

[PATCH v2 0/6] util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc()

2021-07-22 Thread David Hildenbrand
#1 adds support for MADV_POPULATE_WRITE, #2 cleans up the code to avoid global variables and prepare for concurrency, #3 and #4 optimize thread handling, #5 makes os_mem_prealloc() safe to be called from multiple threads concurrently and #6 makes the SIGBUS handler coexist cleanly with the MCE SIGB

[PATCH v2 1/6] util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc()

2021-07-22 Thread David Hildenbrand
Let's sense support and use it for preallocation. MADV_POPULATE_WRITE does not require a SIGBUS handler, doesn't actually touch page content, and avoids context switches; it is, therefore, faster and easier to handle than our current approach. While MADV_POPULATE_WRITE is, in general, faster than

[PATCH v2 2/6] util/oslib-posix: Introduce and use MemsetContext for touch_all_pages()

2021-07-22 Thread David Hildenbrand
Let's minimize the number of global variables to prepare for os_mem_prealloc() getting called concurrently and make the code a bit easier to read. The only consumer that really needs a global variable is the sigbus handler, which will require protection via a mutex in the future either way as we c

[PATCH v2 5/6] util/oslib-posix: Support concurrent os_mem_prealloc() invocation

2021-07-22 Thread David Hildenbrand
Add a mutex to protect the SIGBUS case, as we cannot mess concurrently with the sigbus handler and we have to manage the global variable sigbus_memset_context. The MADV_POPULATE_WRITE path can run concurrently. Note that page_mutex and page_cond are shared between concurrent invocations, which sho

[PATCH for-6.1? 6/6] iotests: Add mirror-ready-cancel-error test

2021-07-22 Thread Max Reitz
Test what happens when there is an I/O error after a mirror job in the READY phase has been cancelled. Signed-off-by: Max Reitz --- .../tests/mirror-ready-cancel-error | 143 ++ .../tests/mirror-ready-cancel-error.out | 5 + 2 files changed, 148 insertions(+) c

[PATCH v2 3/6] util/oslib-posix: Don't create too many threads with small memory or little pages

2021-07-22 Thread David Hildenbrand
Let's limit the number of threads to something sane, especially that - We don't have more threads than the number of pages we have - We don't have threads that initialize small (< 64 MiB) memory Signed-off-by: David Hildenbrand --- util/oslib-posix.c | 12 ++-- 1 file changed, 10 inserti

[PATCH v2 4/6] util/oslib-posix: Avoid creating a single thread with MADV_POPULATE_WRITE

2021-07-22 Thread David Hildenbrand
Let's simplify the case when we only want a single thread and don't have to mess with signal handlers. Signed-off-by: David Hildenbrand --- util/oslib-posix.c | 8 1 file changed, 8 insertions(+) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index a1d309d495..1483e985c6 100644 -

[PATCH v2 6/6] util/oslib-posix: Forward SIGBUS to MCE handler under Linux

2021-07-22 Thread David Hildenbrand
Temporarily modifying the SIGBUS handler is really nasty, as we might be unlucky and receive an MCE SIGBUS while having our handler registered. Unfortunately, there is no way around messing with SIGBUS when MADV_POPULATE_WRITE is not applicable or not around. Let's forward SIGBUS that don't belong

Re: [PATCH for-6.2 v2 05/11] machine: Improve the error reporting of smp parsing

2021-07-22 Thread Andrew Jones
On Thu, Jul 22, 2021 at 04:10:32PM +0800, wangyanan (Y) wrote: > On 2021/7/20 0:53, Andrew Jones wrote: > > On Mon, Jul 19, 2021 at 11:20:37AM +0800, Yanan Wang wrote: > > > We totally have two requirements for a valid SMP configuration: > > s/totally// > > > > > the sum of "sockets * dies * cores

Re: [PATCH 2/2] acpi: x86: pcihp: add support hotplug on multifunction bridges

2021-07-22 Thread Laurent Vivier
On 22/07/2021 12:59, Igor Mammedov wrote: > Commit 17858a1695 (hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35) > switched PCI hotplug from native to ACPI one by default. > > That however breaks ihotplug on following CLI that used to work: >-nodefaults -machine q35 \ >-device > pcie

Re: [PATCH] hw/display: fix virgl reset regression

2021-07-22 Thread Marc-André Lureau
Hi On Thu, Jul 22, 2021 at 4:12 PM Gerd Hoffmann wrote: > On Fri, Jul 02, 2021 at 04:32:21PM +0400, marcandre.lur...@redhat.com > wrote: > > From: Marc-André Lureau > > > > Before commit 49afbca3b00e8e517d54964229a794b51768deaf ("virtio-gpu: drop > > use_virgl_renderer"), use_virgl_renderer was

Re: [PULL 0/3] block bitmaps patches for rc1, 2021-07-21

2021-07-22 Thread Peter Maydell
On Wed, 21 Jul 2021 at 20:49, Eric Blake wrote: > > The following changes since commit e77c8b8b8e933414ef07dbed04e02973fccffeb0: > > Update version for v6.1.0-rc0 release (2021-07-21 17:10:15 +0100) > > are available in the Git repository at: > > https://repo.or.cz/qemu/ericb.git tags/pull-bit

Re: [PATCH for-6.2 v2 10/11] machine: Split out the smp parsing code

2021-07-22 Thread Andrew Jones
On Thu, Jul 22, 2021 at 02:24:03PM +0800, wangyanan (Y) wrote: > On 2021/7/20 1:20, Andrew Jones wrote: > > On Mon, Jul 19, 2021 at 11:20:42AM +0800, Yanan Wang wrote: > > > We are going to introduce an unit test for the parser smp_parse() > > > in hw/core/machine.c, but now machine.c is only built

Re: [PATCH for-6.2 v2 11/11] tests/unit: Add a unit test for smp parsing

2021-07-22 Thread Andrew Jones
On Thu, Jul 22, 2021 at 02:15:18PM +0800, wangyanan (Y) wrote: > On 2021/7/20 2:57, Andrew Jones wrote: > > On Mon, Jul 19, 2021 at 11:20:43AM +0800, Yanan Wang wrote: > > > Add a QEMU unit test for the parsing of given SMP configuration. > > > Since all the parsing logic is in generic function smp

Re: [PATCH] hw/display: fix virgl reset regression

2021-07-22 Thread Marc-André Lureau
Hi On Thu, Jul 22, 2021 at 4:51 PM Marc-André Lureau < marcandre.lur...@gmail.com> wrote: > Hi > > On Thu, Jul 22, 2021 at 4:12 PM Gerd Hoffmann wrote: > >> On Fri, Jul 02, 2021 at 04:32:21PM +0400, marcandre.lur...@redhat.com >> wrote: >> > From: Marc-André Lureau >> > >> > Before commit 49afb

Re: [question] Shall we flush ITS tables into guest RAM when shutdown the VM?

2021-07-22 Thread Juan Quintela
Eric Auger wrote: > Hi Dave, > > On 7/6/21 4:19 PM, Dr. David Alan Gilbert wrote: >> * Eric Auger (eric.au...@redhat.com) wrote: ... >> Well, I initially wanted to know more about this scenario to determine >> whether >> a normal shutdown would fall into it.😂 > I think it was for

Re: [PATCH 0/2] qapi/qom: use correct field name when getting/setting alias properties

2021-07-22 Thread Markus Armbruster
Since patch submitters tend to submit code that works for the success case, I like to test a few failure cases before anything else. Gotcha: $ qemu-system-x86_64 -machine pc,pflash0=xxx qemu-system-x86_64: Property 'cfi.pflash01.drive' can't find value 'xxx' The error message is misleadi

Re: [question] Shall we flush ITS tables into guest RAM when shutdown the VM?

2021-07-22 Thread Peter Maydell
On Thu, 22 Jul 2021 at 14:19, Juan Quintela wrote: > > Eric Auger wrote: > > Hi Dave, > > > > On 7/6/21 4:19 PM, Dr. David Alan Gilbert wrote: > > That's consistent with what you suggested in the past ans what is logged > > in the commit message of > > > > cddafd8f353d2d251b1a5c6c948a577a85838582

Re: [PATCH v2 1/6] util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc()

2021-07-22 Thread Daniel P . Berrangé
On Thu, Jul 22, 2021 at 02:36:30PM +0200, David Hildenbrand wrote: > Let's sense support and use it for preallocation. MADV_POPULATE_WRITE > does not require a SIGBUS handler, doesn't actually touch page content, > and avoids context switches; it is, therefore, faster and easier to handle > than ou

Re: [PATCH 0/2] qapi/qom: use correct field name when getting/setting alias properties

2021-07-22 Thread Paolo Bonzini
On 22/07/21 15:25, Markus Armbruster wrote: Since patch submitters tend to submit code that works for the success case, I like to test a few failure cases before anything else. Gotcha: $ qemu-system-x86_64 -machine pc,pflash0=xxx qemu-system-x86_64: Property 'cfi.pflash01.drive' can't

Re: [PATCH for-6.1 0/1] machine: Disallow specifying topology parameters as zero

2021-07-22 Thread Andrew Jones
On Thu, Jul 22, 2021 at 08:02:16AM +0200, Cornelia Huck wrote: > On Thu, Jul 22 2021, Yanan Wang wrote: > > > In the SMP configuration, we should either specify a topology > > parameter with a reasonable value (equal to or greater than 1) > > or just leave it omitted and QEMU will calculate its v

Re: [PATCH v2 1/6] util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc()

2021-07-22 Thread David Hildenbrand
On 22.07.21 15:31, Daniel P. Berrangé wrote: On Thu, Jul 22, 2021 at 02:36:30PM +0200, David Hildenbrand wrote: Let's sense support and use it for preallocation. MADV_POPULATE_WRITE does not require a SIGBUS handler, doesn't actually touch page content, and avoids context switches; it is, theref

Re: [PATCH v2 1/6] util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc()

2021-07-22 Thread Daniel P . Berrangé
On Thu, Jul 22, 2021 at 03:39:50PM +0200, David Hildenbrand wrote: > On 22.07.21 15:31, Daniel P. Berrangé wrote: > > On Thu, Jul 22, 2021 at 02:36:30PM +0200, David Hildenbrand wrote: > > > Let's sense support and use it for preallocation. MADV_POPULATE_WRITE > > > does not require a SIGBUS handle

  1   2   3   >