Re: [PATCH] ratelimit: restrict the delay time to a non-negative value

2022-09-23 Thread Markus Armbruster
Alberto Garcia writes: > On Wed 21 Sep 2022 09:47:32 AM +08, Wang Liang wrote: >>> > -return limit->slice_end_time - now; >>> > +return MAX(limit->slice_end_time - now, 0); >>> >>> How can this be negative? slice_end_time is guaranteed to be larger >>> than >>> now: >>> >>> if (limi

Re: [PATCH 2/5] migration: Fix race on qemu_file_shutdown()

2022-09-23 Thread Daniel P . Berrangé
On Thu, Sep 22, 2022 at 03:37:11PM -0400, Peter Xu wrote: > On Thu, Sep 22, 2022 at 05:58:25PM +0100, Daniel P. Berrangé wrote: > > On Tue, Sep 20, 2022 at 06:37:57PM -0400, Peter Xu wrote: > > > In qemu_file_shutdown(), there's a possible race if with current order of > > > operation. There're tw

[PATCH v7 0/2] Enable notify VM exit

2022-09-23 Thread Chenyi Qiang
Notify VM exit is introduced to mitigate the potential DOS attach from malicious VM. This series is the userspace part to enable this feature through a new KVM capability KVM_CAP_X86_NOTIFY_VMEXIT. The detailed info can be seen in Patch 2. The corresponding KVM support can be found in linux 6.0-rc

[PATCH v7 2/2] i386: Add notify VM exit support

2022-09-23 Thread Chenyi Qiang
There are cases that malicious virtual machine can cause CPU stuck (due to event windows don't open up), e.g., infinite loop in microcode when nested #AC (CVE-2015-5307). No event window means no event (NMI, SMI and IRQ) can be delivered. It leads the CPU to be unavailable to host or other VMs. Not

Re: Inscrutable CI jobs (avocado & Travis s390 check-tcg)

2022-09-23 Thread Daniel P . Berrangé
On Thu, Sep 22, 2022 at 03:04:12PM -0400, Stefan Hajnoczi wrote: > QEMU's avocado and Travis s390x check-tcg CI jobs fail often and I don't > know why. I think it's due to timeouts but maybe there is something > buried in the logs that I missed. > > I waste time skimming through logs when merging

[PATCH v7 1/2] i386: kvm: extend kvm_{get, put}_vcpu_events to support pending triple fault

2022-09-23 Thread Chenyi Qiang
For the direct triple faults, i.e. hardware detected and KVM morphed to VM-Exit, KVM will never lose them. But for triple faults sythesized by KVM, e.g. the RSM path, if KVM exits to userspace before the request is serviced, userspace could migrate the VM and lose the triple fault. A new flag KVM_

Re: Inscrutable CI jobs (avocado & Travis s390 check-tcg)

2022-09-23 Thread Thomas Huth
On 23/09/2022 09.28, Daniel P. Berrangé wrote: On Thu, Sep 22, 2022 at 03:04:12PM -0400, Stefan Hajnoczi wrote: QEMU's avocado and Travis s390x check-tcg CI jobs fail often and I don't know why. I think it's due to timeouts but maybe there is something buried in the logs that I missed. I waste

Re: [PATCH 0/4] Only generate cluster node in PPTT when specified

2022-09-23 Thread Yicong Yang via
On 2022/9/22 22:31, Jonathan Cameron wrote: > On Thu, 22 Sep 2022 21:11:39 +0800 > Yicong Yang wrote: > >> From: Yicong Yang >> >> This series mainly change the policy for building a cluster topology node >> in PPTT. Previously we'll always build a cluster node in PPTT without >> asking the user

Re: [PATCH 2/5] qga: Add initial FreeBSD support

2022-09-23 Thread Marc-André Lureau
Hi On Thu, Sep 22, 2022 at 4:28 PM Alexander Ivanov < alexander.iva...@virtuozzo.com> wrote: > Add commands-bsd.c file with dumb functions, fix device path and make > the code buildable in FreeBSD. > > Signed-off-by: Alexander Ivanov > --- > meson.build | 2 +- > qga/commands-bsd.c

Re: [PATCH 4/5] qga: Add shutdown/halt/reboot support for FreeBSD

2022-09-23 Thread Marc-André Lureau
Hi On Thu, Sep 22, 2022 at 3:51 PM Alexander Ivanov < alexander.iva...@virtuozzo.com> wrote: > Add appropriate shutdown command arguments in qmp_guest_shutdown() > for FreeBSD. > > Signed-off-by: Alexander Ivanov > --- > qga/commands-posix.c | 7 +++ > 1 file changed, 7 insertions(+) > > di

Re: [PATCH 3/5] qga: Add UFS freeze/thaw support for FreeBSD

2022-09-23 Thread Marc-André Lureau
Hi On Thu, Sep 22, 2022 at 4:15 PM Alexander Ivanov < alexander.iva...@virtuozzo.com> wrote: > UFS supports FS freezing through ioctl UFSSUSPEND on /dev/ufssuspend. > Freezed FS can be thawed by closing /dev/ufssuspend file descriptior. > > Use getmntinfo to get a list of mounted FS. > > Signed-o

Re: [PATCH 5/5] qga: Add support for user password settinng in FreeeBSD

2022-09-23 Thread Marc-André Lureau
Hi On Thu, Sep 22, 2022 at 4:25 PM Alexander Ivanov < alexander.iva...@virtuozzo.com> wrote: > Move qmp_guest_set_user_password() to commands-posix.c under (__linux__ or > __FreeBSD) condition. Add command and arguments for password setting in > FreeBSD. > > Signed-off-by: Alexander Ivanov > If

Re: [PATCH] Revert "intel_iommu: Fix irqchip / X2APIC configuration checks"

2022-09-23 Thread Igor Mammedov
On Thu, 22 Sep 2022 12:40:01 -0400 Peter Xu wrote: > On Thu, Sep 22, 2022 at 03:46:17PM +0200, Igor Mammedov wrote: > > On Wed, 21 Sep 2022 12:12:27 -0400 > > Peter Xu wrote: > > > > > It's true that when vcpus<=255 we don't require the length of 32bit APIC > > > IDs. However here since we a

Re: [PATCH] virtio-gpu: Resource UUID

2022-09-23 Thread Marc-André Lureau
Hi On Wed, Sep 21, 2022 at 1:24 PM Antonio Caggiano < antonio.caggi...@collabora.com> wrote: > Enable resource UUID feature and implement command resource assign UUID. > This is done by introducing a hash table to map resource IDs to their > UUIDs. > > Signed-off-by: Antonio Caggiano > --- > hw

Re: [PATCH] Revert "intel_iommu: Fix irqchip / X2APIC configuration checks"

2022-09-23 Thread Igor Mammedov
On Fri, 23 Sep 2022 10:20:34 +0200 Igor Mammedov wrote: > On Thu, 22 Sep 2022 12:40:01 -0400 > Peter Xu wrote: > > > On Thu, Sep 22, 2022 at 03:46:17PM +0200, Igor Mammedov wrote: > > > On Wed, 21 Sep 2022 12:12:27 -0400 > > > Peter Xu wrote: > > > > > > > It's true that when vcpus<=255

[PATCH] Use g_new() & friends where that makes obvious sense

2022-09-23 Thread Markus Armbruster
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. This commit only touches allocations with size arguments of the form si

[PATCH 3/6] hw/core/cpu-sysemu: used cached class in cpu_asidx_from_attrs

2022-09-23 Thread Cédric Le Goater
From: Alex Bennée This is a heavily used function so lets avoid the cost of CPU_GET_CLASS. On the romulus-bmc run it has a modest effect: Before: 36.812 s ± 0.506 s After: 35.912 s ± 0.168 s Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20220811151413.3350684-4

[PATCH 5/6] ssi: cache SSIPeripheralClass to avoid GET_CLASS()

2022-09-23 Thread Cédric Le Goater
From: Alex Bennée Investigating why some BMC models are so slow compared to a plain ARM virt machines I did some profiling of: ./qemu-system-arm -M romulus-bmc -nic user \ -drive file=obmc-phosphor-image-romulus.static.mtd,format=raw,if=mtd \ -nographic -serial mon:stdio And saw t

[PATCH 0/6] aspeed: avocado test boosts

2022-09-23 Thread Cédric Le Goater
Hello, Alex's patchset [1] showed that by avoiding the class cast checkers in hot code paths, performance is greatly improved. See results below. This is a partial resend of [1] plus an extra caching a reference on the AspeedSMC class, which adds an extra 10% boost. Thanks , C. [1] http://patc

[PATCH 1/6] tests/avocado/machine_aspeed.py: Fix typos on buildroot

2022-09-23 Thread Cédric Le Goater
Replace 'buidroot' and 'builroot' by 'buildroot'. Fixes: f7bc7da0724f ("test/avocado/machine_aspeed.py: Add tests using buildroot images") Signed-off-by: Cédric Le Goater --- tests/avocado/machine_aspeed.py | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tes

[PATCH 2/6] cpu: cache CPUClass in CPUState for hot code paths

2022-09-23 Thread Cédric Le Goater
From: Alex Bennée The class cast checkers are quite expensive and always on (unlike the dynamic case who's checks are gated by CONFIG_QOM_CAST_DEBUG). To avoid the overhead of repeatedly checking something which should never change we cache the CPUClass reference for use in the hot code paths. S

[PATCH 4/6] cputlb: used cached CPUClass in our hot-paths

2022-09-23 Thread Cédric Le Goater
From: Alex Bennée Before: 35.912 s ± 0.168 s After: 35.565 s ± 0.087 s Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20220811151413.3350684-5-alex.ben...@linaro.org> Signed-off-by: Cédric Le Goater --- accel/tcg/cputlb.c | 15 ++- 1 file changed, 6 in

[PATCH] Drop superfluous conditionals around g_free()

2022-09-23 Thread Markus Armbruster
There is no need to guard g_free(P) with if (P): g_free(NULL) is safe. Signed-off-by: Markus Armbruster --- replay/replay.c | 6 ++ target/i386/kvm/kvm.c | 12 target/i386/whpx/whpx-all.c | 14 ++ 3 files changed, 12 insertions(+), 20 deletions(-)

[PATCH 6/6] aspeed/smc: Cache AspeedSMCClass

2022-09-23 Thread Cédric Le Goater
Store a reference on the AspeedSMC class under the flash object and use it when accessing the flash contents. Avoiding the class cast checkers in these hot paths improves performance by 10% when running the aspeed avocado tests. Signed-off-by: Cédric Le Goater --- include/hw/ssi/aspeed_smc.h | 2

Re: [PATCH v2] hw/acpi: Add ospm_status hook implementation for acpi-ged

2022-09-23 Thread zhukeqian via
>> > I notice this doesn't seem to have gone in yet -- whose tree is it >> > going to go via? >> >> I'd guess ARM tree (due to almost sole user virt-arm). >> (there are toy users like microvm and new loongarch) > >OK; applied to target-arm.next, thanks. Thanks, Peter. Keqian.

Re: [PATCH] linux-user/host/s390: Add vector instructions to host_signal_write()

2022-09-23 Thread Thomas Huth
On 20/09/2022 13.39, Ilya Leoshkevich wrote: The new noexec test fails on s390x with "unexpected SEGV". This test overwrites code using libc's memcpy(), which uses VSTL instruction. host_signal_write() does not recognize it, which causes SEGV to be incorrectly forwarded to the test. Add all vect

Re: [PATCH 1/6] tests/avocado/machine_aspeed.py: Fix typos on buildroot

2022-09-23 Thread Thomas Huth
On 23/09/2022 10.47, Cédric Le Goater wrote: Replace 'buidroot' and 'builroot' by 'buildroot'. Fixes: f7bc7da0724f ("test/avocado/machine_aspeed.py: Add tests using buildroot images") Signed-off-by: Cédric Le Goater --- tests/avocado/machine_aspeed.py | 16 1 file changed,

Re: [PATCH] migration/ram: Fix memory leak when using x-ignore-shared

2022-09-23 Thread Nikolay Borisov
On 22.09.22 г. 20:42 ч., Dr. David Alan Gilbert wrote: * Nikolay Borisov (nbori...@suse.com) wrote: During ram initialization for migration dirty/clear bitmaps are allocated for all migratable blocks, irrespective of their shared status. However, during ram migration cleanup those bitmaps are

Re: [PATCH] Drop superfluous conditionals around g_free()

2022-09-23 Thread Philippe Mathieu-Daudé via
On Fri, Sep 23, 2022 at 11:13 AM Markus Armbruster wrote: > > There is no need to guard g_free(P) with if (P): g_free(NULL) is safe. > > Signed-off-by: Markus Armbruster > --- > replay/replay.c | 6 ++ > target/i386/kvm/kvm.c | 12 > target/i386/whpx/whpx-all.

Re: [PATCH v8.1 1/2] target/s390x: support SHA-512 extensions

2022-09-23 Thread Jason A. Donenfeld
Hi David & Thomas, On Fri, Sep 23, 2022 at 08:37:50AM +0200, David Hildenbrand wrote: > > But the point is that the "msa" helper is also called for other instructions > > like PCKMO which can also be called with code 3. And there it means > > something completely different. ... unless I completely

Re: [PATCH 2/5] qga: Add initial FreeBSD support

2022-09-23 Thread Alexander Ivanov
On 23.09.2022 09:56, Marc-André Lureau wrote: Hi On Thu, Sep 22, 2022 at 4:28 PM Alexander Ivanov wrote: Add commands-bsd.c file with dumb functions, fix device path and make the code buildable in FreeBSD. Signed-off-by: Alexander Ivanov ---  meson.build          |   

Re: [PATCH v4 2/3] module: add Error arguments to module_load_one and module_load_qom_one

2022-09-23 Thread Claudio Fontana
On 9/22/22 19:05, Kevin Wolf wrote: > Am 22.09.2022 um 17:27 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >>> Am 22.09.2022 um 14:42 hat Markus Armbruster geschrieben: >> >> [...] >> If you have callers that need to distinguish between not found, found but bad, found and g

Re: [PATCH v1 1/3] hw/loongarch: Add memmap for LoongArch virt machine

2022-09-23 Thread gaosong
在 2022/9/23 上午11:29, Xiaojuan Yang 写道: +#define VIRT_PCI_IO_OFFSET 0x4000 +static MemMapEntry virt_memmap[] = { +[VIRT_LOWDDR] = {0x0,0x1000 }, +[VIRT_PCH] = { 0x1000,0x1000 }, +[VIRT_PM] = { 0x1008, 0x100 }, +

Re: [PATCH v4 2/3] module: add Error arguments to module_load_one and module_load_qom_one

2022-09-23 Thread Claudio Fontana
On 9/23/22 07:31, Markus Armbruster wrote: > Claudio Fontana writes: > >> On 9/22/22 16:36, Markus Armbruster wrote: >>> Claudio Fontana writes: >>> On 9/22/22 15:20, Markus Armbruster wrote: > Claudio Fontana writes: > > [...] > >> I think it would be better to complet

Re: [PATCH] add keepalive for qemu-nbd

2022-09-23 Thread Vladimir Sementsov-Ogievskiy
On 9/21/22 18:34, Denis V. Lunev wrote: On 9/21/22 10:36, songlinfeng wrote: From: songlinfeng we want to export a image with qemu-nbd as server, in client we use libnbd to connect qemu-nbd,but when client power down,the server is still working. qemu-nbd will exit when last client exit.so,we

Re: [PATCH v4 2/3] module: add Error arguments to module_load_one and module_load_qom_one

2022-09-23 Thread Claudio Fontana
On 9/22/22 19:05, Kevin Wolf wrote: > Am 22.09.2022 um 17:27 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >>> Am 22.09.2022 um 14:42 hat Markus Armbruster geschrieben: >> >> [...] >> If you have callers that need to distinguish between not found, found but bad, found and g

[PATCH] block: unmap (discard) blocks only if discard_zeros flag is true

2022-09-23 Thread luzhipeng
From: lu zhipeng we can unmap(discard) blocks for block devices of supporting discard zeros or regular file. Signed-off-by: lu zhipeng --- block/file-posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 48cd096624..c35dbc0d

Re: Inscrutable CI jobs (avocado & Travis s390 check-tcg)

2022-09-23 Thread Alex Bennée
Thomas Huth writes: > On 23/09/2022 09.28, Daniel P. Berrangé wrote: >> On Thu, Sep 22, 2022 at 03:04:12PM -0400, Stefan Hajnoczi wrote: >>> QEMU's avocado and Travis s390x check-tcg CI jobs fail often and I don't >>> know why. I think it's due to timeouts but maybe there is something >>> burie

Re: [PATCH v8 1/2] target/s390x: support SHA-512 extensions

2022-09-23 Thread Alex Bennée
David Hildenbrand writes: > On 21.09.22 12:07, Jason A. Donenfeld wrote: >> In order to fully support MSA_EXT_5, we have to support the SHA-512 >> special instructions. So implement those. >> The implementation began as something TweetNacl-like, and then was >> adjusted to be useful here. It's

Re: [PATCH] Use g_new() & friends where that makes obvious sense

2022-09-23 Thread Michael S. Tsirkin
On Fri, Sep 23, 2022 at 10:42:54AM +0200, Markus Armbruster wrote: > g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, > for two reasons. One, it catches multiplication overflowing size_t. > Two, it returns T * rather than void *, which lets the compiler catch > more type error

Re: [PATCH v8.1 1/2] target/s390x: support SHA-512 extensions

2022-09-23 Thread David Hildenbrand
3) I won't follow up with additional cleanup patches because I already spent more time on this than I originally planned. What is this B.S.? I spent months on this code and had to poke you a bunch to review it. You spend one afternoon with it and you're already burnt out, apparently. Sorry to he

Re: [PATCH v8 2/8] s390x/pci: add routine to get host function handle from CLP info

2022-09-23 Thread Thomas Huth
On 02/09/2022 19.27, Matthew Rosato wrote: In order to interface with the underlying host zPCI device, we need to know it's function handle. Add a routine to grab this from the Nit: s/it's/its/ vfio CLP capabilities chain. Reviewed-by: Pierre Morel Signed-off-by: Matthew Rosato --- hw/s

Re: [PULL 11/20] target/arm: Don't mishandle count when enabling or disabling PMU counters

2022-09-23 Thread Peter Maydell
On Tue, 20 Sept 2022 at 17:45, Thomas Huth wrote: > this seems to break some Avocado based test(s) in our CI: > > make check-venv > ./tests/venv/bin/avocado run > tests/avocado/replay_kernel.py:ReplayKernelNormal.test_aarch64_virt > > ... fails with commit 01765386a88868ae993bcb but still pas

Re: [PATCH v2] RISC-V: Add support for Ztso

2022-09-23 Thread Palmer Dabbelt
On Thu, 22 Sep 2022 21:35:26 PDT (-0700), alistai...@gmail.com wrote: On Sat, Sep 17, 2022 at 6:12 PM Palmer Dabbelt wrote: The Ztso extension was recently frozen, this adds it as a CPU property and adds various fences throughout the port in order to allow TSO targets to function on weaker hos

[PATCH v2] linux-user: use 'max' instead of 'qemu32' / 'qemu64' by default

2022-09-23 Thread Daniel P . Berrangé
The 'qemu64' CPU model implements the least featureful x86_64 CPU that's possible. Historically this hasn't been an issue since it was rare for OS distros to build with a higher mandatory CPU baseline. With RHEL-9, however, the entire distro is built for the x86_64-v2 ABI baseline: https://dev

Re: [PATCH v8.1 1/2] target/s390x: support SHA-512 extensions

2022-09-23 Thread Jason A. Donenfeld
On Fri, Sep 23, 2022 at 12:47 PM David Hildenbrand wrote: > You must be fortunate if "one afternoon" is not a significant time > investment. For me it is a significant investment. For me too, to say the least of the multiple afternoons I've spent on this patch set. Getting back to technical conte

Re: [PATCH v8.1 1/2] target/s390x: support SHA-512 extensions

2022-09-23 Thread David Hildenbrand
On 23.09.22 13:19, Jason A. Donenfeld wrote: On Fri, Sep 23, 2022 at 12:47 PM David Hildenbrand wrote: You must be fortunate if "one afternoon" is not a significant time investment. For me it is a significant investment. For me too, to say the least of the multiple afternoons I've spent on th

Re: [PATCH v8.1 1/2] target/s390x: support SHA-512 extensions

2022-09-23 Thread Jason A. Donenfeld
Hi David, On Fri, Sep 23, 2022 at 1:35 PM David Hildenbrand wrote: > > On 23.09.22 13:19, Jason A. Donenfeld wrote: > > On Fri, Sep 23, 2022 at 12:47 PM David Hildenbrand wrote: > >> You must be fortunate if "one afternoon" is not a significant time > >> investment. For me it is a significant in

Re: [PATCH] ui/console: Get tab completion working again in the SDL monitor vc

2022-09-23 Thread Gerd Hoffmann
On Thu, Aug 11, 2022 at 06:01:38PM -0400, Cal Peake wrote: > Define a QEMU special key constant for the tab key and add an entry for > it in the qcode_to_keysym table. This allows tab completion to work again > in the SDL monitor virtual console, which has been broken ever since the > migration fro

Re: [PATCH for-7.2] hw/usb/hcd-xhci: Check whether DMA accesses fail

2022-09-23 Thread Gerd Hoffmann
On Wed, Aug 17, 2022 at 06:00:16PM +0200, Thomas Huth wrote: > If a guest sets up bad descriptors, it could force QEMU to access > non-existing memory regions. Thus we should check the return value > of dma_memory_read/write() to make sure that these errors don't go > unnoticed. > > Signed-off-by:

Re: [PATCH v5 0/3] ui/cocoa: Run qemu_init in the main thread

2022-09-23 Thread Gerd Hoffmann
On Fri, Aug 19, 2022 at 10:27:53PM +0900, Akihiko Odaki wrote: > This work is based on: > https://patchew.org/QEMU/20220317125534.38706-1-philippe.mathieu.da...@gmail.com/ > > Simplify the initialization dance by running qemu_init() in the main > thread before the Cocoa event loop starts. The seco

[PATCH 0/3] Drop useless casts from void * to pointer

2022-09-23 Thread Markus Armbruster
Markus Armbruster (3): hw/core: Tidy up unnecessary casting away of const Drop useless casts from g_malloc() & friends to pointer Drop more useless casts from void * to pointer bsd-user/elfload.c | 2 +- contrib/plugins/cache.c | 8 contrib/vhos

[PATCH 2/3] Drop useless casts from g_malloc() & friends to pointer

2022-09-23 Thread Markus Armbruster
These memory allocation functions return void *, and casting to another pointer type is useless clutter. Drop these casts. If you really want another pointer type, consider g_new(). Signed-off-by: Markus Armbruster --- hw/arm/nseries.c| 4 ++-- hw/char/exynos4210_uart.c | 2 +- h

[PATCH 3/3] Drop more useless casts from void * to pointer

2022-09-23 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- bsd-user/elfload.c | 2 +- contrib/plugins/cache.c | 8 contrib/vhost-user-blk/vhost-user-blk.c | 2 +- hw/core/qdev-clock.c| 2 +- hw/hyperv/vmbus.c | 2 +- hw/net/cadence

Re: [PATCH v8.1 1/2] target/s390x: support SHA-512 extensions

2022-09-23 Thread David Hildenbrand
On 23.09.22 13:46, Jason A. Donenfeld wrote: Hi David, On Fri, Sep 23, 2022 at 1:35 PM David Hildenbrand wrote: On 23.09.22 13:19, Jason A. Donenfeld wrote: On Fri, Sep 23, 2022 at 12:47 PM David Hildenbrand wrote: You must be fortunate if "one afternoon" is not a significant time investme

Re: [PATCH v11 18/21] job.c: enable job lock/unlock and remove Aiocontext locks

2022-09-23 Thread Paolo Bonzini
On Thu, Sep 22, 2022 at 4:42 PM Emanuele Giuseppe Esposito wrote: > > Am 18/09/2022 um 19:12 schrieb Emanuele Giuseppe Esposito: > >> In replication_stop, we call job_cancel_sync() inside > >> aio_context_acquire - aio_context_release section. Should it be fixed? > > > I don't think it breaks anyt

[PATCH 1/3] hw/core: Tidy up unnecessary casting away of const

2022-09-23 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- hw/core/sysbus-fdt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/core/sysbus-fdt.c b/hw/core/sysbus-fdt.c index edb0c49b19..eebcd28f9a 100644 --- a/hw/core/sysbus-fdt.c +++ b/hw/core/sysbus-fdt.c @@ -299,7 +299,8 @@ static int a

Re: [PATCH v8.1 1/2] target/s390x: support SHA-512 extensions

2022-09-23 Thread Jason A. Donenfeld
On Fri, Sep 23, 2022 at 2:05 PM Thomas Huth wrote: > > On 23/09/2022 13.46, Jason A. Donenfeld wrote: > > Hi David, > > > > On Fri, Sep 23, 2022 at 1:35 PM David Hildenbrand wrote: > >> > >> On 23.09.22 13:19, Jason A. Donenfeld wrote: > >>> On Fri, Sep 23, 2022 at 12:47 PM David Hildenbrand >

Re: [PATCH v8.1 1/2] target/s390x: support SHA-512 extensions

2022-09-23 Thread Thomas Huth
On 23/09/2022 13.46, Jason A. Donenfeld wrote: Hi David, On Fri, Sep 23, 2022 at 1:35 PM David Hildenbrand wrote: On 23.09.22 13:19, Jason A. Donenfeld wrote: On Fri, Sep 23, 2022 at 12:47 PM David Hildenbrand wrote: You must be fortunate if "one afternoon" is not a significant time invest

Re: [PATCH v2 4/4] virtio-gpu: Don't require udmabuf when blob support is enabled

2022-09-23 Thread Gerd Hoffmann
On Tue, Sep 13, 2022 at 12:50:22PM +0200, Antonio Caggiano wrote: > From: Dmitry Osipenko > > Host blobs don't need udmabuf, it's only needed by guest blobs. The host > blobs are utilized by the Mesa virgl driver when persistent memory mapping > is needed by a GL buffer, otherwise virgl driver do

Re: [PATCH v2] linux-user: use 'max' instead of 'qemu32' / 'qemu64' by default

2022-09-23 Thread Laurent Vivier
Le 23/09/2022 à 13:04, Daniel P. Berrangé a écrit : The 'qemu64' CPU model implements the least featureful x86_64 CPU that's possible. Historically this hasn't been an issue since it was rare for OS distros to build with a higher mandatory CPU baseline. With RHEL-9, however, the entire distro is

[PATCH 0/3] target/arm: Fix bugs in recent PMU changes

2022-09-23 Thread Peter Maydell
This patchset fixes some bugs in the recent changes I made to the Arm PMU emualtion as part of implementing FEAT_PMUv3p5. The important patch here is the first one, which fixes a crash when in icount mode if the guest touched MDCR_EL3, MDCR_EL2, PMCNTENSET_EL0 or PMCNTENCLR_EL0. The other two are

[PATCH 3/3] target/arm: Update SDCR_VALID_MASK to include SCCD

2022-09-23 Thread Peter Maydell
Our SDCR_VALID_MASK doesn't include all of the bits which are defined by the current architecture. In particular in commit 0b42f4fab9d3 we forgot to add SCCD, which meant that an AArch32 guest couldn't actually use the SCCD bit to disable counting in Secure state. Add all the currently defined bi

[PATCH 2/3] target/arm: Make writes to MDCR_EL3 use PMU start/finish calls

2022-09-23 Thread Peter Maydell
In commit 01765386a88868 we fixed a bug where we weren't correctly bracketing changes to some registers with pmu_op_start() and pmu_op_finish() calls for changes which affect whether the PMU counters might be enabled. However, we missed the case of writes to the AArch64 MDCR_EL3 register, because

[PATCH 1/3] target/arm: Mark registers which call pmu_op_start() as ARM_CP_IO

2022-09-23 Thread Peter Maydell
In commit 01765386a888 we made some system register write functions call pmu_op_start()/pmu_op_finish(). This means that they now touch timers, so for icount to work these registers must have the ARM_CP_IO flag set. This fixes a bug where when icount is enabled a guest that touches MDCR_EL3, MDCR_

Re: [PATCH v8.1 1/2] target/s390x: support SHA-512 extensions

2022-09-23 Thread Thomas Huth
On 23/09/2022 14.07, Jason A. Donenfeld wrote: On Fri, Sep 23, 2022 at 2:05 PM Thomas Huth wrote: On 23/09/2022 13.46, Jason A. Donenfeld wrote: Hi David, On Fri, Sep 23, 2022 at 1:35 PM David Hildenbrand wrote: On 23.09.22 13:19, Jason A. Donenfeld wrote: On Fri, Sep 23, 2022 at 12:47 P

[PATCH 3/3] block: Start/end drain on correct AioContext

2022-09-23 Thread Hanna Reitz
bdrv_parent_drained_{begin,end}_single() are supposed to operate on the parent, not on the child, so they should not attempt to get the context to poll from the child but the parent instead. BDRV_POLL_WHILE(c->bs) does get the context from the child, so we should replace it with AIO_WAIT_WHILE() o

[PATCH 2/3] block-backend: Update ctx immediately after root

2022-09-23 Thread Hanna Reitz
blk_get_aio_context() asserts that blk->ctx is always equal to the root BDS's context (if there is a root BDS). Therefore, blk_do_set_aio_context() must update blk->ctx immediately after the root BDS's context has changed. Without this patch, the next patch would break iotest 238, because bdrv_dr

Re: [PATCH 1/3] hw/core: Tidy up unnecessary casting away of const

2022-09-23 Thread Philippe Mathieu-Daudé via
On Fri, Sep 23, 2022 at 2:30 PM Markus Armbruster wrote: > > Signed-off-by: Markus Armbruster > --- > hw/core/sysbus-fdt.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH 0/3] blcok: Start/end drain on correct AioContext

2022-09-23 Thread Hanna Reitz
Hi, bdrv_replace_child_noperm() drains the child via bdrv_parent_drained_{begin,end}_single(). When it removes a child, the bdrv_parent_drained_end_single() at its end will be called on an empty child, making the BDRV_POLL_WHILE() in it poll the main AioContext (because c->bs is NULL). That’s

[PATCH 1/3] block: bdrv_child_get_parent_aio_context is not GS

2022-09-23 Thread Hanna Reitz
All implementations of bdrv_child_get_parent_aio_context() are IO_CODE (or do not mark anything in the case of block jobs), so this too can be IO_CODE. By the definition of "I/O API functions" in block-io.h, this is a strict relaxation, as I/O code can be run from both GS and I/O code arbitrarily.

Re: [PATCH] i386: Add new CPU model SapphireRapids

2022-09-23 Thread Yang Zhong
On Wed, Sep 21, 2022 at 03:51:42PM +0100, Dr. David Alan Gilbert wrote: > * Wang, Lei (lei4.w...@intel.com) wrote: > > The new CPU model mostly inherits features from Icelake-Server, while > > adding new features: > > - AMX (Advance Matrix eXtensions) > > - Bus Lock Debug Exception > > and new in

Re: [PATCH v11 08/15] target/hexagon: add flex/bison/glib2 to qemu.yml

2022-09-23 Thread Alex Bennée
Anton Johansson writes: > Note, the glib2-native mapping exists separately from the normal glib2 > mapping. The latter uses a `foreign` cross-policy-default, and > libvirt-ci is not able to support package mappings for multiple > cross-compilation policies. > > This will probably change in the

Re: [PATCH 5/5] qga: Add support for user password settinng in FreeeBSD

2022-09-23 Thread Marc-André Lureau
Hi On Fri, Sep 23, 2022 at 10:19 AM Marc-André Lureau < marcandre.lur...@gmail.com> wrote: > Hi > > On Thu, Sep 22, 2022 at 4:25 PM Alexander Ivanov < > alexander.iva...@virtuozzo.com> wrote: > >> Move qmp_guest_set_user_password() to commands-posix.c under (__linux__ or >> __FreeBSD) condition.

[PATCH v2 2/2] virtio-gpu: Resource UUID

2022-09-23 Thread Antonio Caggiano
Enable resource UUID feature and implement command resource assign UUID. This is done by introducing a hash table to map resource IDs to their UUIDs. Signed-off-by: Antonio Caggiano --- v2: Destroy the hash table in the unrealize function hw/display/trace-events| 1 + hw/display/virtio

[PATCH v2 1/2] virtio-gpu: Unrealize

2022-09-23 Thread Antonio Caggiano
Implement an unrealize function for virtio gpu device. Signed-off-by: Antonio Caggiano --- hw/display/virtio-gpu.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 20cc703dcc..412f0fb7ec 100644 --- a/hw/display/virtio-gpu.c +

Re: [PATCH] virtio-gpu: Resource UUID

2022-09-23 Thread Antonio Caggiano
Hi Marc-André, On 23/09/2022 10:38, Marc-André Lureau wrote: Hi On Wed, Sep 21, 2022 at 1:24 PM Antonio Caggiano mailto:antonio.caggi...@collabora.com>> wrote: Enable resource UUID feature and implement command resource assign UUID. This is done by introducing a hash table to map re

[PATCH v2 0/2] virtio-gpu: Resource UUID

2022-09-23 Thread Antonio Caggiano
Enable resource UUID feature and implement command resource assign UUID. Antonio Caggiano (2): virtio-gpu: Unrealize virtio-gpu: Resource UUID hw/display/trace-events| 1 + hw/display/virtio-gpu-base.c | 2 ++ hw/display/virtio-gpu-virgl.c | 11 hw/display/virtio-gpu.c

Re: [PATCH v11 10/15] target/hexagon: manually add flex/bison/glib2 to remaining containers

2022-09-23 Thread Alex Bennée
Anton Johansson writes: > Adds our build-time dependencies to containers which build qemu-hexagon, > but aren't covered by libvirt-ci. > > Signed-off-by: Anton Johansson > --- > .gitlab-ci.d/windows.yml | 6 -- > tests/docker/dockerfiles/debian-riscv64-cross.do

Re: [PATCH v2 1/2] virtio-gpu: Unrealize

2022-09-23 Thread Marc-André Lureau
Hi On Fri, Sep 23, 2022 at 3:45 PM Antonio Caggiano < antonio.caggi...@collabora.com> wrote: > Implement an unrealize function for virtio gpu device. > > Signed-off-by: Antonio Caggiano > --- > hw/display/virtio-gpu.c | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/hw/displ

Re: [PATCH] virtio-gpu: Resource UUID

2022-09-23 Thread Antonio Caggiano
Hi Marc-André, On 23/09/2022 10:38, Marc-André Lureau wrote: Hi On Wed, Sep 21, 2022 at 1:24 PM Antonio Caggiano mailto:antonio.caggi...@collabora.com>> wrote: Enable resource UUID feature and implement command resource assign UUID. This is done by introducing a hash table to map re

Re: [PATCH v3 2/3] module: add Error arguments to module_load_one and module_load_qom_one

2022-09-23 Thread Claudio Fontana
On 9/21/22 13:56, Kevin Wolf wrote: > Am 21.09.2022 um 09:50 hat Claudio Fontana geschrieben: >> On 9/20/22 18:50, Kevin Wolf wrote: >>> Am 08.09.2022 um 19:36 hat Claudio Fontana geschrieben: On 9/8/22 19:10, Claudio Fontana wrote: > On 9/8/22 18:03, Richard Henderson wrote: >> On 9/8

Re: [PATCH] block: unmap (discard) blocks only if discard_zeros flag is true

2022-09-23 Thread Kevin Wolf
Am 23.09.2022 um 12:02 hat luzhipeng geschrieben: > From: lu zhipeng > > we can unmap(discard) blocks for block devices of supporting discard zeros > or regular file. > > Signed-off-by: lu zhipeng This more or less restores the state before commit 34fa110e. The commit message there explains th

[PATCH] file-posix: Remove unused s->discard_zeroes

2022-09-23 Thread Kevin Wolf
The field is unused (only ever set, but never read) since commit ac9185603. Additionally, the commit message of commit 34fa110e already explained earlier why it's unreliable. Remove it. Signed-off-by: Kevin Wolf --- block/file-posix.c | 9 - 1 file changed, 9 deletions(-) diff --git a/b

Re: [PATCH] block: unmap (discard) blocks only if discard_zeros flag is true

2022-09-23 Thread luzhipeng
在 2022/9/23 22:28, Kevin Wolf 写道: Am 23.09.2022 um 12:02 hat luzhipeng geschrieben: From: lu zhipeng we can unmap(discard) blocks for block devices of supporting discard zeros or regular file. Signed-off-by: lu zhipeng This more or less restores the state before commit 34fa110e. The com

Re: [PATCH v3 2/3] module: add Error arguments to module_load_one and module_load_qom_one

2022-09-23 Thread Kevin Wolf
Am 23.09.2022 um 16:10 hat Claudio Fontana geschrieben: > On 9/21/22 13:56, Kevin Wolf wrote: > > Am 21.09.2022 um 09:50 hat Claudio Fontana geschrieben: > >> On 9/20/22 18:50, Kevin Wolf wrote: > >>> Am 08.09.2022 um 19:36 hat Claudio Fontana geschrieben: > On 9/8/22 19:10, Claudio Fontana wr

Re: [PATCH] hw/xen: set pci Atomic Ops requests for passthrough device

2022-09-23 Thread Paul Durrant
On 21/09/2022 02:19, Ji, Ruili wrote: [AMD Official Use Only - General] Hi Paul and AFAIK: ^^^ you mean Anthony :-) Thanks for your help. When could we see this patch on the master branch? 😊 Our project urgently needs this solution. Anthony? Ping? Paul

Re: [PATCH v3 2/3] module: add Error arguments to module_load_one and module_load_qom_one

2022-09-23 Thread Claudio Fontana
On 9/23/22 16:42, Kevin Wolf wrote: > Am 23.09.2022 um 16:10 hat Claudio Fontana geschrieben: >> On 9/21/22 13:56, Kevin Wolf wrote: >>> Am 21.09.2022 um 09:50 hat Claudio Fontana geschrieben: On 9/20/22 18:50, Kevin Wolf wrote: > Am 08.09.2022 um 19:36 hat Claudio Fontana geschrieben: >>>

[PATCH v5 0/4] improve error handling for module load

2022-09-23 Thread Claudio Fontana
CHANGELOG: v4 -> v5: * added a patch to rename module_load_one and friends to module_load * qdev_new: just reuse module_object_class_by_name, to avoid duplicating code * changed return value of module_load to an int: -1 error (Error **errp set). 0 module or dependencies not installed, 1

[PATCH v5 2/4] module: rename module_load_one to module_load

2022-09-23 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- audio/audio.c | 2 +- block.c | 4 ++-- block/dmg.c | 4 ++-- hw/core/qdev.c| 2 +- include/qemu/module.h | 10 +- qom/object.c | 4 ++-- softmmu/qtest.c | 2 +- ui/console.c | 6 +++-

[PATCH v5 3/4] module: add Error arguments to module_load and module_load_qom

2022-09-23 Thread Claudio Fontana
improve error handling during module load, by changing: bool module_load(const char *prefix, const char *lib_name); void module_load_qom(const char *type); to: int module_load(const char *prefix, const char *name, Error **errp); int module_load_qom(const char *type, Error **errp); where the ret

[PATCH v5 4/4] accel: abort if we fail to load the accelerator plugin

2022-09-23 Thread Claudio Fontana
if QEMU is configured with modules enabled, it is possible that the load of an accelerator module will fail. Abort in this case, relying on module_object_class_by_name to report the specific load error if any. Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- accel/accel-softmmu

[PATCH v5 1/4] module: removed unused function argument "mayfail"

2022-09-23 Thread Claudio Fontana
mayfail is always passed as false for every invocation throughout the program. It controls whether to printf or not to printf an error on g_module_open failure. Remove this unused argument. Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- i

Re: [PATCH v11 10/15] target/hexagon: manually add flex/bison/glib2 to remaining containers

2022-09-23 Thread Anton Johansson via
On 9/23/22 15:42, Alex Bennée wrote: tricore doesn't build QEMU and debian10 went away in the last PR. To avoid confusion as the rest of the patch set makes its way through I've pulled 8, 9, and 10 into testing/next for my next PR. Thanks for taking a look, we'll submit a new version of the pat

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

2022-09-23 Thread Laurent Vivier
On 9/14/22 07:05, David Gibson wrote: On Tue, Sep 13, 2022 at 08:39:52AM +0200, Laurent Vivier wrote: 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. Is this also a bug i

Re: [PATCH v5 2/4] module: rename module_load_one to module_load

2022-09-23 Thread Philippe Mathieu-Daudé via
On 23/9/22 16:51, Claudio Fontana wrote: Signed-off-by: Claudio Fontana --- audio/audio.c | 2 +- block.c | 4 ++-- block/dmg.c | 4 ++-- hw/core/qdev.c| 2 +- include/qemu/module.h | 10 +- qom/object.c | 4 ++-- softmmu/qtes

Re: [PATCH v8 1/8] mm/memfd: Introduce userspace inaccessible memfd

2022-09-23 Thread Fuad Tabba
Hi, On Mon, Sep 19, 2022 at 8:10 PM Sean Christopherson wrote: > > +Will, Marc and Fuad (apologies if I missed other pKVM folks) > > On Mon, Sep 19, 2022, David Hildenbrand wrote: > > On 15.09.22 16:29, Chao Peng wrote: > > > From: "Kirill A. Shutemov" > > > > > > KVM can use memfd-provided memo

Re: [PATCH v8 1/8] mm/memfd: Introduce userspace inaccessible memfd

2022-09-23 Thread Fuad Tabba
Hi, <...> > > Regarding pKVM's use case, with the shim approach I believe this can be > > done by > > allowing userspace mmap() the "hidden" memfd, but with a ton of restrictions > > piled on top. > > > > My first thought was to make the uAPI a set of KVM ioctls so that KVM > > could tightly > >

Re: [PATCH v8 1/8] mm/memfd: Introduce userspace inaccessible memfd

2022-09-23 Thread Fuad Tabba
Hi, On Fri, Sep 23, 2022 at 1:53 AM Kirill A . Shutemov wrote: > > On Thu, Sep 22, 2022 at 07:49:18PM +, Sean Christopherson wrote: > > On Thu, Sep 22, 2022, Wang, Wei W wrote: > > > On Thursday, September 15, 2022 10:29 PM, Chao Peng wrote: > > > > +int inaccessible_get_pfn(struct file *file

Re: [PATCH v5 4/4] accel: abort if we fail to load the accelerator plugin

2022-09-23 Thread Philippe Mathieu-Daudé via
On 23/9/22 16:51, Claudio Fontana wrote: if QEMU is configured with modules enabled, it is possible that the load of an accelerator module will fail. Abort in this case, relying on module_object_class_by_name to report the specific load error if any. Signed-off-by: Claudio Fontana Reviewed-by:

  1   2   >