Re: [PATCH v2 0/3] qapi: allow unions to contain further unions

2023-04-13 Thread Het Gala
On 31/03/23 5:19 pm, Het Gala wrote: Hi all, On 17/03/23 9:25 pm, Markus Armbruster wrote: Daniel P. Berrangé writes: Currently it is not possible for a union type to contain a further union as one (or more) of its branches. This relaxes that restriction and adds the calls needed to valida

Re: [PATCH v2 03/10] tcg: Use one-insn-per-tb accelerator property in curr_cflags()

2023-04-13 Thread Richard Henderson
On 4/13/23 18:24, Peter Maydell wrote: On Mon, 3 Apr 2023 at 19:33, Richard Henderson wrote: On 4/3/23 07:46, Peter Maydell wrote: uint32_t curr_cflags(CPUState *cpu) { uint32_t cflags = cpu->tcg_cflags; +TCGState *tcgstate = TCG_STATE(current_accel()); As mentioned against

[RFC PATCH v2 05/10] tests/vm: add py310-expat to NetBSD

2023-04-13 Thread John Snow
NetBSD cannot successfully run "ensurepip" without access to the pyexpat module, which NetBSD debundles. Like the Debian patch, it would be strictly faster long term to install pip/setuptools, and I recommend developers at their workstations take that approach instead. For the purposes of a throwa

[RFC PATCH v2 06/10] mkvenv: generate console entry shims from inside the venv

2023-04-13 Thread John Snow
This patch is meant to ensure that console entry point scripts will always generate on Python 3.7 installations where we may not have access to importlib.metadata. By running it from a separate process *inside* the venv, we can be assured to have access to setuptools and by extension pkg_resources

[RFC PATCH v2 08/10] configure: create a python venv unconditionally

2023-04-13 Thread John Snow
This patch changes the configure script so that it always creates a python virtual environment unconditionally. Meson bootstrapping is temporarily altered to force the use of meson from git or vendored source. (A patch later in this series restores the use of a distribution-provided Meson.) Signe

[RFC PATCH v2 02/10] tests: add python3-venv dependency

2023-04-13 Thread John Snow
Several debian-based tests need the python3-venv dependency as a consequence of Debian debundling the "ensurepip" module normally included with Python. As mkvenv.py stands as of this commit, Debian requires EITHER: (A) setuptools and pip, or (B) ensurepip mkvenv is a few seconds faster if you ha

[RFC PATCH v2 04/10] tests/vm: Configure netbsd to use Python 3.10

2023-04-13 Thread John Snow
NetBSD removes some packages from the Python stdlib, but only re-packages them for Python 3.10. Switch to using Python 3.10. Signed-off-by: John Snow --- tests/vm/netbsd | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/vm/netbsd b/tests/vm/netbsd index 0b9536ca17..13eae109c0 100755 ---

[RFC PATCH v2 09/10] configure: remove --meson=; install meson to the pyvenv

2023-04-13 Thread John Snow
This patch changes how we detect and install meson. The previous patch creates a lightweight Python virtual environment unconditionally using the user's configured $python that inherits system packages. If Meson is installed there and meets our minimum version requirements, we will use that Meson.

[RFC PATCH v2 03/10] mkvenv: Add better error message for missing pyexapt module

2023-04-13 Thread John Snow
NetBSD debundles pyexpat from python, but ensurepip needs pyexpat. Try our best to offer a helpful error message instead of just failing catastrophically. Signed-off-by: John Snow --- python/scripts/mkvenv.py | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a

[RFC PATCH v2 01/10] python: add mkvenv.py

2023-04-13 Thread John Snow
This script will be responsible for building a lightweight Python virtual environment at configure time. It works with Python 3.7 or newer. It has been designed to: - work *offline*, no PyPI required. - work *quickly*, The fast path is only ~65ms on my machine. - work *robustly*, with multiple fal

[RFC PATCH v2 10/10] tests: Use configure-provided pyvenv for tests

2023-04-13 Thread John Snow
This patch changes how the avocado tests are provided, ever so slightly. Instead of creating a new testing venv, use instead the configure-provided 'pyvenv' and install optional packages into that. Note: At the time of writing, avocado tests require avocado-framework < 90 whereas the qemu.qmp self

[RFC PATCH v2 00/10] configure: create a python venv and install meson

2023-04-13 Thread John Snow
GitLab CI: https://gitlab.com/jsnow/qemu/-/pipelines/836855908 (All green. phew.) (This is a quick V2 RFC to freshen the patches on the list and consolidate some fixes made so far. See changes below.) This patch series creates a mandatory venv during configure time and uses it to insta

[RFC PATCH v2 07/10] mkvenv: work around broken pip installations on Debian 10

2023-04-13 Thread John Snow
This is a workaround intended for Debian 10, where the debian-patched pip does not function correctly if accessed from within a virtual environment. We don't support Debian 10 any longer, but it's possible that this bug might appear on other derivative platforms and this workaround may prove usefu

Re: [RFC PATCH 2/4] target/riscv: Add fcsr field in tb->flags

2023-04-13 Thread Mayuresh Chitale
On Tue, Apr 11, 2023 at 7:17 AM Richard Henderson wrote: > > On 4/10/23 07:13, Mayuresh Chitale wrote: > > The state of smstateen0.FCSR bit impacts the execution of floating point > > instructions when misa.F==0. Add a field in the tb->flags which stores > > the current state of smstateen0.fcsr an

Re: [RFC PATCH 3/4] target/riscv: check smstateen fcsr flag

2023-04-13 Thread Mayuresh Chitale
On Tue, Apr 11, 2023 at 7:23 AM Richard Henderson wrote: > > On 4/10/23 07:13, Mayuresh Chitale wrote: > > +#ifndef CONFIG_USER_ONLY > > +#define smstateen_fcsr_check(ctx) do { \ > > +if (!ctx->smstateen_fcsr_ok) { \ > > +if (ctx->virt_enabled) { \ > > +generate_exception(c

Re: [RFC PATCH 3/4] target/riscv: check smstateen fcsr flag

2023-04-13 Thread Mayuresh Chitale
On Mon, Apr 10, 2023 at 8:00 PM liweiwei wrote: > > > On 2023/4/10 22:13, Mayuresh Chitale wrote: > > If misa.F and smstateen_fcsr_ok flag are clear then all the floating > > point instructions must generate an appropriate exception. > > > > Signed-off-by: Mayuresh Chitale > > --- > > target/ri

Re: [RFC PATCH 1/4] target/riscv: smstateen check for fcsr

2023-04-13 Thread Mayuresh Chitale
On Mon, Apr 10, 2023 at 8:14 PM liweiwei wrote: > > > On 2023/4/10 22:13, Mayuresh Chitale wrote: > > If smstateen is implemented and sstateen0.fcsr is clear then the > > floating point operations must return illegal instruction exception > > or virtual instruction trap, if relevant. > > typo. sst

Re: [RFC PATCH v2 38/44] target/loongarch: Implement vbitsel vset

2023-04-13 Thread gaosong
在 2023/4/14 上午11:22, gaosong 写道: 在 2023/4/13 下午6:06, Richard Henderson 写道: On 4/13/23 04:53, gaosong wrote: 在 2023/4/12 下午2:53, Richard Henderson 写道: +#define SETANYEQZ(NAME, BIT, E) \ +void HELPER(NAME)(CPULoongArchState *env, uint32_t cd, uint32_t vj) \ +{ 

Re: [RFC PATCH v2 38/44] target/loongarch: Implement vbitsel vset

2023-04-13 Thread gaosong
在 2023/4/13 下午6:06, Richard Henderson 写道: On 4/13/23 04:53, gaosong wrote: 在 2023/4/12 下午2:53, Richard Henderson 写道: +#define SETANYEQZ(NAME, BIT, E) \ +void HELPER(NAME)(CPULoongArchState *env, uint32_t cd, uint32_t vj) \ +{

Re: [PATCH] rtl8139: fix large_send_mss divide-by-zero

2023-04-13 Thread Jason Wang
On Fri, Apr 14, 2023 at 2:24 AM Peter Maydell wrote: > > On Thu, 13 Apr 2023 at 18:21, Stefan Hajnoczi wrote: > > > > If the driver sets large_send_mss to 0 then a divide-by-zero occurs. > > Even if the division wasn't a problem, the for loop that emits MSS-sized > > packets would never terminate

Re: virtio-iommu hotplug issue

2023-04-13 Thread Akihiko Odaki
On 2023/04/13 22:39, Eric Auger wrote: Hi, On 4/13/23 13:01, Akihiko Odaki wrote: On 2023/04/13 19:40, Jean-Philippe Brucker wrote: Hello, On Thu, Apr 13, 2023 at 01:49:43PM +0900, Akihiko Odaki wrote: Hi, Recently I encountered a problem with the combination of Linux's virtio-iommu driver

RE: [PATCH] replication: compile out some staff when replication is not configured

2023-04-13 Thread Zhang, Chen
> -Original Message- > From: qemu-devel-bounces+chen.zhang=intel@nongnu.org devel-bounces+chen.zhang=intel@nongnu.org> On Behalf Of Vladimir > Sementsov-Ogievskiy > Sent: Thursday, April 13, 2023 9:47 PM > To: Zhang, Chen ; qemu-devel@nongnu.org > Cc: qemu-bl...@nongnu.org; pbonz

Re: [PATCH] exynos: Fix out-of-bounds access in exynos4210_gcomp_find

2023-04-13 Thread Feng Jiang
On Tue, 2023-04-11 at 14:02 +0100, Peter Maydell wrote: > On Tue, 4 Apr 2023 at 08:45, Feng Jiang wrote: > > > > When 'res' equals -1, the array 's->g_timer.reg.comp[]' is accessed > > out of bounds. > > > > Signed-off-by: Feng Jiang > > --- > > hw/timer/exynos4210_mct.c | 13 - > >

[RFC PATCH 2/6] mm: mempolicy: Refactor out mpol_init_from_nodemask

2023-04-13 Thread Ackerley Tng
Refactor out mpol_init_from_nodemask() to simplify logic in do_mbind(). mpol_init_from_nodemask() will be used to perform similar functionality in do_memfd_restricted_bind() in a later patch. Signed-off-by: Ackerley Tng --- mm/mempolicy.c | 32 +--- 1 file changed, 2

[RFC PATCH 4/6] mm: mempolicy: Add and expose mpol_create

2023-04-13 Thread Ackerley Tng
mpol_create builds a mempolicy based on mode, nmask and maxnode. mpol_create is exposed for use in memfd_restricted_bind() in a later patch. Signed-off-by: Ackerley Tng --- include/linux/mempolicy.h | 2 ++ mm/mempolicy.c| 39 +++ 2 files changed

[RFC PATCH 3/6] mm: mempolicy: Refactor out __mpol_set_shared_policy()

2023-04-13 Thread Ackerley Tng
Refactor out __mpol_set_shared_policy() to remove dependency on struct vm_area_struct, since only 2 parameters from struct vm_area_struct are used. __mpol_set_shared_policy() will be used in a later patch by restrictedmem_set_shared_policy(). Signed-off-by: Ackerley Tng --- include/linux/mempol

[RFC PATCH 6/6] selftests: mm: Add selftest for memfd_restricted_bind()

2023-04-13 Thread Ackerley Tng
This selftest uses memfd_restricted_bind() to set the mempolicy for a restrictedmem file, and then checks that pages were indeed allocated according to that policy. Because restrictedmem pages are never mapped into userspace memory, the usual ways of checking which NUMA node the page was allocated

[RFC PATCH 0/6] Setting memory policy for restrictedmem file

2023-04-13 Thread Ackerley Tng
Hello, This patchset builds upon the memfd_restricted() system call that was discussed in the 'KVM: mm: fd-based approach for supporting KVM' patch series [1]. The tree can be found at: https://github.com/googleprodkernel/linux-cc/tree/restrictedmem-set-memory-policy In this patchset, a new sysc

[RFC PATCH 5/6] mm: restrictedmem: Add memfd_restricted_bind() syscall

2023-04-13 Thread Ackerley Tng
memfd_restricted_bind() sets the NUMA memory policy, which consists of a policy mode and zero or more nodes, for an offset within a restrictedmem file with file descriptor fd and continuing for len bytes. This is intended to be like mbind() but specially for restrictedmem files, which cannot be mm

[RFC PATCH 1/6] mm: shmem: Refactor out shmem_shared_policy() function

2023-04-13 Thread Ackerley Tng
Refactor out shmem_shared_policy() to allow reading of a file's shared mempolicy Signed-off-by: Ackerley Tng --- include/linux/shmem_fs.h | 7 +++ mm/shmem.c | 10 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/linux/shmem_fs.h b/include/lin

Re: [PULL 19/54] acpi: pc: isa bridge: use AcpiDevAmlIf interface to build ISA device descriptors

2023-04-13 Thread Mike Maslenkin
Hibernate is disabled by default, that is why "shutdown /h" fails. It can be enabled by 'powercfg.exe /h /size 100; powercfg.exe /h on' anyway, my hypotheses can be checked easily: just run the VM with changed RAM size (±1). This should have to drop hibernate state. BTW I couldn't reproduce probl

[ANNOUNCE] QEMU 8.0.0-rc4 is now available

2023-04-13 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the fifth release candidate for the QEMU 8.0 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu.org/qemu-8.0.0-rc4.tar.xz http://download.qemu.

Re: [RFC PATCH v3 1/2] mm: restrictedmem: Allow userspace to specify mount for memfd_restricted

2023-04-13 Thread Sean Christopherson
On Thu, Apr 13, 2023, Ackerley Tng wrote: > Christian Brauner writes: > > I'm curious, is there an LSFMM session for this? > > As far as I know, there is no LSFMM session for this. Correct, no LSFMM session. In hindsight, that's obviously something we should have pursued :-(

Re: [RFC PATCH v3 1/2] mm: restrictedmem: Allow userspace to specify mount for memfd_restricted

2023-04-13 Thread Ackerley Tng
Christian Brauner writes: On Wed, Apr 05, 2023 at 09:58:44PM +, Ackerley Tng wrote: ... > > Why do you even need this flag? It seems that @mount_fd being < 0 is > > sufficient to indicate that a new restricted memory fd is supposed to be > > created in the system instance. I'm

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

2023-04-13 Thread Sean Christopherson
On Thu, Apr 13, 2023, Christian Brauner wrote: > On Thu, Aug 18, 2022 at 04:24:21PM +0300, Kirill A . Shutemov wrote: > > On Wed, Aug 17, 2022 at 10:40:12PM -0700, Hugh Dickins wrote: > > > Here's what I would prefer, and imagine much easier for you to maintain; > > > but I'm no system designer, an

Re: [PATCH] tests/avocado: require netdev 'user' for kvm_xen_guest

2023-04-13 Thread John Snow
On Thu, Apr 13, 2023 at 5:43 PM John Snow wrote: > > The tests will fail mysteriously with EOFError otherwise, because the VM > fails to boot and quickly disconnects from the QMP socket. Skip these > tests when we didn't compile with slirp. > Full disclosure: I only tested this patch in conjuncti

[PATCH] tests/avocado: require netdev 'user' for kvm_xen_guest

2023-04-13 Thread John Snow
The tests will fail mysteriously with EOFError otherwise, because the VM fails to boot and quickly disconnects from the QMP socket. Skip these tests when we didn't compile with slirp. Fixes: c8cb603293fd (tests/avocado: Test Xen guest support under KVM) Signed-off-by: John Snow --- tests/avocado

Re: [PATCH 0/3] SDL2 usability fixes

2023-04-13 Thread Volker Rümelin
Am 13.04.23 um 22:43 schrieb Bernhard Beschow: Am 13. April 2023 17:54:34 UTC schrieb "Volker Rümelin" : I'm trying to use QEMU on Windows hosts for fun and for profit. While the GTK GUI doesn't seem to support OpenGL under Windows the SDL2 GUI does. Hence I used the SDL2 GUI where I ran into s

Re: [PATCH] hw/display/sm501: Remove unneeded increment from loop

2023-04-13 Thread Daniel Henrique Barboza
On 4/5/23 12:57, BALATON Zoltan wrote: As Coverity points out (CID 1508621) the calculation to increment i in the fill fallback loop is ineffective as it is overwritten in next statement. This was left there by mistake from a previous version but is not needed in the current approach so remove

Re: [PATCH 00/21] Patch Round-up for stable 7.2.2, freeze on 2023-04-20

2023-04-13 Thread Konstantin Kostiuk
Hi Michael, You cherry-picked one of my patch qga/win32: Remove change action from MSI installer but it is part of the CVE fix. Please cherry-pick one more patch. Original mail: https://patchew.org/QEMU/20230303192008.109549-1-kkost...@redhat.com/ Best Regards, Konstantin Kostiuk. On Thu, Apr

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-13 Thread Stefan Hajnoczi
On Thu, 13 Apr 2023 at 13:55, Hanna Czenczek wrote: > > On 13.04.23 13:38, Stefan Hajnoczi wrote: > > On Thu, 13 Apr 2023 at 05:24, Hanna Czenczek wrote: > >> On 12.04.23 23:06, Stefan Hajnoczi wrote: > >>> On Tue, Apr 11, 2023 at 05:05:13PM +0200, Hanna Czenczek wrote: > So-called "internal

Re: [PATCH 00/21] Patch Round-up for stable 7.2.2, freeze on 2023-04-20

2023-04-13 Thread Michael Tokarev
13.04.2023 23:50, Konstantin Kostiuk wrote: Hi Michael, You cherry-picked one of my patch qga/win32: Remove change action from MSI installer but it is part of the CVE fix. Please cherry-pick one more patch. Original mail: https://patchew.org/QEMU/20230303192008.109549-1-kkost...@redhat.com/

Re: [PATCH 0/3] SDL2 usability fixes

2023-04-13 Thread Bernhard Beschow
Am 13. April 2023 17:54:34 UTC schrieb "Volker Rümelin" : >> I'm trying to use QEMU on Windows hosts for fun and for profit. While the GTK >> GUI doesn't seem to support OpenGL under Windows the SDL2 GUI does. Hence I >> used the SDL2 GUI where I ran into several issues of which three are fixed

Re: QEMU developers fortnightly conference call for agenda for 2023-04-18

2023-04-13 Thread Juan Quintela
Hi Please, send any topic that you are interested in covering. [google calendar is very, very bad to compose messages, but getting everybody cc'd is very complicated otherwise] At the end of Monday I will send an email with the agenda or the cancellation of the call, so hurry up. After discu

[PATCH 10/21] aio-posix: fix race between epoll upgrade and aio_set_fd_handler()

2023-04-13 Thread Michael Tokarev
From: Stefan Hajnoczi If another thread calls aio_set_fd_handler() while the IOThread event loop is upgrading from ppoll(2) to epoll(7) then we might miss new AioHandlers. The epollfd will not monitor the new AioHandler's fd, resulting in hangs. Take the AioHandler list lock while upgrading to e

[PATCH 15/21] linux-user: fix sockaddr_in6 endianness

2023-04-13 Thread Michael Tokarev
From: Mathis Marion The sin6_scope_id field uses the host byte order, so there is a conversion to be made when host and target endianness differ. Signed-off-by: Mathis Marion Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230307154256.101528-2-mathis.mar...@sil

[PATCH 18/21] target/arm: Handle m-profile in arm_is_secure

2023-04-13 Thread Michael Tokarev
From: Richard Henderson Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1421 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20230227225832.816605-2-richard.hender...@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 9094f9551df849f68d40236092d8

[PATCH 05/21] target/s390x/arch_dump: Fix memory corruption in s390x_write_elf64_notes()

2023-04-13 Thread Michael Tokarev
From: Thomas Huth "note_size" can be smaller than sizeof(note), so unconditionally calling memset(notep, 0, sizeof(note)) could cause a memory corruption here in case notep has been allocated dynamically, thus let's use note_size as length argument for memset() instead. Reported-by: Sebastian Mi

[PATCH 08/21] target/s390x: Fix EXECUTE of relative long instructions

2023-04-13 Thread Michael Tokarev
From: Ilya Leoshkevich The code uses the wrong base for relative addressing: it should use the target instruction address and not the EXECUTE's address. Fix by storing the target instruction address in the new CPUS390XState member and loading it from the code generated by gen_ri2(). Reported-by

[PATCH 07/21] target/s390x: Split out gen_ri2

2023-04-13 Thread Michael Tokarev
From: Richard Henderson Use tcg_constant_i64. Adjust in2_mri2_* to allocate a new temporary for the output, using gen_ri2 for the address. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson (cherry picked from commit bdbc87e323ee417735141ed2b11dab0091b57593) Signed-off-by: M

[PATCH 14/21] qemu/osdep: Switch position of "extern" and "G_NORETURN"

2023-04-13 Thread Michael Tokarev
From: Bernhard Beschow Fixes the Windows build under msys2 using GCC 12 which fails with the following error: [184/579] Compiling C++ object qga/vss-win32/qga-vss.dll.p/install.cpp.obj FAILED: qga/vss-win32/qga-vss.dll.p/install.cpp.obj "c++" "-m64" "-mcx16" "-Iqga/vss-win32/qga-vss.dll.p"

[PATCH 09/21] hw/arm: do not free machine->fdt in arm_load_dtb()

2023-04-13 Thread Michael Tokarev
From: Markus Armbruster At this moment, arm_load_dtb() can free machine->fdt when binfo->dtb_filename is NULL. If there's no 'dtb_filename', 'fdt' will be retrieved by binfo->get_dtb(). If get_dtb() returns machine->fdt, as is the case of machvirt_dtb() from hw/arm/virt.c, fdt now has a pointer t

[PATCH 01/21] qga: Drop dangling reference to QERR_QGA_LOGGING_DISABLED

2023-04-13 Thread Michael Tokarev
From: Markus Armbruster slog()'s function comment advises to use QERR_QGA_LOGGING_DISABLED. This macro never existed. The reference got added in commit e3d4d25206a "guest agent: add guest agent RPCs/commands" along with QERR_QGA_LOGGING_FAILED, so maybe that one was meant. However, QERR_QGA_LOG

[PATCH 16/21] linux-user: Fix unaligned memory access in prlimit64 syscall

2023-04-13 Thread Michael Tokarev
From: Ilya Leoshkevich target_rlimit64 contains uint64_t fields, so it's 8-byte aligned on some hosts, while some guests may align their respective type on a 4-byte boundary. This may lead to an unaligned access, which is an UB. Fix by defining the fields as abi_ullong. This makes the host align

[PATCH 13/21] ui: fix crash on serial reset, during init

2023-04-13 Thread Michael Tokarev
From: Marc-André Lureau For ex, when resetting the xlnx-zcu102 machine: (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x50) * frame #0: 0x10020a740 gd_vc_send_chars(vc=0x0) at gtk.c:1759:41 [opt] frame #1: 0x100636264 qemu_c

[PATCH 20/21] hw/nvme: fix memory leak in nvme_dsm

2023-04-13 Thread Michael Tokarev
From: Klaus Jensen The iocb (and the allocated memory to hold LBA ranges) leaks if reading the LBA ranges fails. Fix this by adding a free and an unref of the iocb. Reported-by: Coverity (CID 1508281) Fixes: d7d1474fd85d ("hw/nvme: reimplement dsm to allow cancellation") Reviewed-by: Philippe M

[PATCH 19/21] io: tls: Inherit QIO_CHANNEL_FEATURE_SHUTDOWN on server side

2023-04-13 Thread Michael Tokarev
From: Peter Xu TLS iochannel will inherit io_shutdown() from the master ioc, however we missed to do that on the server side. This will e.g. allow qemu_file_shutdown() to work on dest QEMU too for migration. Acked-by: Daniel P. Berrangé Signed-off-by: Peter Xu Reviewed-by: Juan Quintela Sign

[PATCH 03/21] hw/net/vmxnet3: allow VMXNET3_MAX_MTU itself as a value

2023-04-13 Thread Michael Tokarev
From: Fiona Ebner Currently, VMXNET3_MAX_MTU itself (being 9000) is not considered a valid value for the MTU, but a guest running ESXi 7.0 might try to set it and fail the assert [0]. In the Linux kernel, dev->max_mtu itself is a valid value for the MTU and for the vmxnet3 driver it's 9000, so a

[PATCH 00/21] Patch Round-up for stable 7.2.2, freeze on 2023-04-20

2023-04-13 Thread Michael Tokarev
Despite 8.0 release is almost here, I'd love to make another 7.2.x release, adding more fixes which has been collected so far. The following new patches are queued for QEMU stable v7.2.2: https://gitlab.com/mjt0k/qemu/-/commits/stable-7.2-staging/ Patch freeze is 2023-04-20, and the release is

[PATCH 12/21] qga/vss-win32: fix warning for clang++-15

2023-04-13 Thread Michael Tokarev
From: Pierrick Bouvier Reported when compiling with clang-windows-arm64. ../qga/vss-win32/install.cpp:537:9: error: variable 'hr' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (!(ControlService(service, SERVICE_CONTROL_STOP, NULL))) {

[PATCH 17/21] linux-user: fix timerfd read endianness conversion

2023-04-13 Thread Michael Tokarev
From: Mathis Marion When reading the expiration count from a timerfd, the endianness of the 64bit value read is the one of the host, just as for eventfds. Signed-off-by: Mathis Marion Reviewed-by: Laurent Vivier Message-Id: <20230220085822.626798-2-mathis.mar...@silabs.com> Signed-off-by: Laur

[PATCH 02/21] qga/win32: Remove change action from MSI installer

2023-04-13 Thread Michael Tokarev
From: Konstantin Kostiuk Remove the 'change' button from "Programs and Features" because it does not checks if a user is an admin or not. The installer has no components to choose from and always installs everything. So the 'change' button is not obviously needed but can create a security issue.

[PATCH 11/21] target/s390x: Fix float_comp_to_cc() prototype

2023-04-13 Thread Michael Tokarev
From: Cédric Le Goater GCC13 reports an error : ../target/s390x/tcg/fpu_helper.c:123:5: error: conflicting types for ‘float_comp_to_cc’ due to enum/integer mismatch; have ‘int(CPUS390XState *, FloatRelation)’ {aka ‘int(struct CPUArchState *, FloatRelation)’} [-Werror=enum-int-mismatch] 123

[PATCH 06/21] target/s390x: Fix emulation of C(G)HRL

2023-04-13 Thread Michael Tokarev
From: Nina Schoetterl-Glausch The second operand of COMPARE HALFWORD RELATIVE LONG is a signed halfword, it does not have the same size as the first operand. Fixes: a7e836d5eb ("target-s390: Convert COMPARE, COMPARE LOGICAL") Signed-off-by: Nina Schoetterl-Glausch Reviewed-by: Richard Henderson

[PATCH 21/21] block/vhdx: fix dynamic VHDX BAT corruption

2023-04-13 Thread Michael Tokarev
From: Lukas Tschoke The corruption occurs when a BAT entry aligned to 4096 bytes is changed. Specifically, the corruption occurs during the creation of the LOG Data Descriptor. The incorrect behavior involves copying 4088 bytes from the original 4096 bytes aligned offset to `tmp[8..4096]` and th

[PATCH 04/21] hw/pvrdma: Protect against buggy or malicious guest driver

2023-04-13 Thread Michael Tokarev
From: Yuval Shaia Guest driver might execute HW commands when shared buffers are not yet allocated. This could happen on purpose (malicious guest) or because of some other guest/host address mapping error. We need to protect againts such case. Fixes: CVE-2022-1050 Reported-by: Raven Signed-off

Re: [PATCH v3] memory: Optimize replay of guest mapping

2023-04-13 Thread Peter Xu
On Thu, Apr 13, 2023 at 07:00:19PM +0800, Zhenzhong Duan wrote: > On x86, there are two notifiers registered due to vtd-ir memory > region splitting the entire address space. During replay of the > address space for each notifier, the whole address space is > scanned which is unnecessary. We only n

[PATCH] hw/core: Move numa.c into the target independent source set

2023-04-13 Thread Thomas Huth
There is nothing that depends on target specific macros in this file, so we can move it to the common source set to avoid that we have to compile this file multiple times (one time for each target). Signed-off-by: Thomas Huth --- hw/core/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 dele

Re: [PATCH] rtl8139: fix large_send_mss divide-by-zero

2023-04-13 Thread Peter Maydell
On Thu, 13 Apr 2023 at 18:21, Stefan Hajnoczi wrote: > > If the driver sets large_send_mss to 0 then a divide-by-zero occurs. > Even if the division wasn't a problem, the for loop that emits MSS-sized > packets would never terminate. > > Solve these issues by skipping offloading when large_send_ms

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-13 Thread Hanna Czenczek
On 13.04.23 13:38, Stefan Hajnoczi wrote: On Thu, 13 Apr 2023 at 05:24, Hanna Czenczek wrote: On 12.04.23 23:06, Stefan Hajnoczi wrote: On Tue, Apr 11, 2023 at 05:05:13PM +0200, Hanna Czenczek wrote: So-called "internal" virtio-fs migration refers to transporting the back-end's (virtiofsd's)

Re: [PATCH 0/3] SDL2 usability fixes

2023-04-13 Thread Volker Rümelin
I'm trying to use QEMU on Windows hosts for fun and for profit. While the GTK GUI doesn't seem to support OpenGL under Windows the SDL2 GUI does. Hence I used the SDL2 GUI where I ran into several issues of which three are fixed in this series, which are: * Alt+Tab switches tasks on the host rath

Re: [Virtio-fs] [PATCH 0/4] vhost-user-fs: Internal migration

2023-04-13 Thread Hanna Czenczek
On 13.04.23 18:11, Michael S. Tsirkin wrote: On Tue, Apr 11, 2023 at 05:05:11PM +0200, Hanna Czenczek wrote: RFC: https://lists.nongnu.org/archive/html/qemu-devel/2023-03/msg04263.html Hi, Patch 2 of this series adds new vhost methods (only for vhost-user at this point) for transferring the ba

Re: [PATCH 1/4] vhost: Re-enable vrings after setting features

2023-04-13 Thread Hanna Czenczek
On 13.04.23 13:03, Stefan Hajnoczi wrote: On Tue, 11 Apr 2023 at 11:05, Hanna Czenczek wrote: If the back-end supports the VHOST_USER_F_PROTOCOL_FEATURES feature, setting the vhost features will set this feature, too. Doing so disables all vrings, which may not be intended. For example, enabl

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-13 Thread Hanna Czenczek
On 13.04.23 12:14, Eugenio Perez Martin wrote: On Wed, Apr 12, 2023 at 11:06 PM Stefan Hajnoczi wrote: On Tue, Apr 11, 2023 at 05:05:13PM +0200, Hanna Czenczek wrote: So-called "internal" virtio-fs migration refers to transporting the back-end's (virtiofsd's) state through qemu's migration str

Re: [PATCH for-7.2 v3 3/3] rtl8139: honor large send MSS value

2023-04-13 Thread Stefan Hajnoczi
On Thu, Apr 13, 2023 at 04:38:52PM +0100, Peter Maydell wrote: > On Thu, 17 Nov 2022 at 16:58, Stefan Hajnoczi wrote: > > > > The Large-Send Task Offload Tx Descriptor (9.2.1 Transmit) has a > > Large-Send MSS value where the driver specifies the MSS. See the > > datasheet here: > > http://realtek

Re: [PATCH v10 1/9] mm: Introduce memfd_restricted system call to create restricted user memory

2023-04-13 Thread Ackerley Tng
Chao Peng writes: From: "Kirill A. Shutemov" Introduce 'memfd_restricted' system call with the ability to create memory areas that are restricted from userspace access through ordinary MMU operations (e.g. read/write/mmap). The memory content is expected to be used through the new in-kernel

[PATCH] rtl8139: fix large_send_mss divide-by-zero

2023-04-13 Thread Stefan Hajnoczi
If the driver sets large_send_mss to 0 then a divide-by-zero occurs. Even if the division wasn't a problem, the for loop that emits MSS-sized packets would never terminate. Solve these issues by skipping offloading when large_send_mss=0. This issue was found by OSS-Fuzz as part of Alexander Bulek

Re: [RFC PATCH 1/3] python: add mkvenv.py

2023-04-13 Thread John Snow
On Wed, Mar 29, 2023 at 8:56 AM Paolo Bonzini wrote: > > BTW, another way to repair Debian 10's pip is to create a symbolic link > to sys.base_prefix + '/share/python-wheels' in sys.prefix + > '/share/python-wheels'. Since this is much faster, perhaps it can be > done unconditionally and checkpip

Re: [PATCH] hw/mips/malta: Fix the malta machine on big endian hosts

2023-04-13 Thread Peter Maydell
On Thu, 13 Apr 2023 at 17:08, Michael Tokarev wrote: > > 30.03.2023 18:26, Thomas Huth wrote: > > Booting a Linux kernel with the malta machine is currently broken > > on big endian hosts. The cpu_to_gt32 macro wants to byteswap a value > > for little endian targets only, but uses the wrong way to

Re: [PATCH v2 03/10] tcg: Use one-insn-per-tb accelerator property in curr_cflags()

2023-04-13 Thread Peter Maydell
On Mon, 3 Apr 2023 at 19:33, Richard Henderson wrote: > > On 4/3/23 07:46, Peter Maydell wrote: > > uint32_t curr_cflags(CPUState *cpu) > > { > > uint32_t cflags = cpu->tcg_cflags; > > +TCGState *tcgstate = TCG_STATE(current_accel()); > > As mentioned against the cover, this is a ver

Re: [PATCH 0/4] vhost-user-fs: Internal migration

2023-04-13 Thread Michael S. Tsirkin
On Tue, Apr 11, 2023 at 05:05:11PM +0200, Hanna Czenczek wrote: > RFC: > https://lists.nongnu.org/archive/html/qemu-devel/2023-03/msg04263.html > > Hi, > > Patch 2 of this series adds new vhost methods (only for vhost-user at > this point) for transferring the back-end’s internal state to/from qe

Re: [RFC PATCH 1/3] python: add mkvenv.py

2023-04-13 Thread John Snow
On Wed, Mar 29, 2023 at 8:56 AM Paolo Bonzini wrote: > > On 3/28/23 23:11, John Snow wrote: > > +for entry_point in entry_points: > > +# Python 3.8 doesn't have 'module' or 'attr' attributes > > +if not (hasattr(entry_point, 'module') and > > +

Re: [PATCH] hw/mips/malta: Fix the malta machine on big endian hosts

2023-04-13 Thread Michael Tokarev
30.03.2023 18:26, Thomas Huth wrote: Booting a Linux kernel with the malta machine is currently broken on big endian hosts. The cpu_to_gt32 macro wants to byteswap a value for little endian targets only, but uses the wrong way to do this: cpu_to_[lb]e32 works the other way round on big endian hos

Re: [PATCH v10 0/9] KVM: mm: fd-based approach for supporting KVM

2023-04-13 Thread Kirill A. Shutemov
On Wed, Apr 12, 2023 at 06:07:28PM -0700, Sean Christopherson wrote: > On Wed, Jan 25, 2023, Kirill A. Shutemov wrote: > > On Wed, Jan 25, 2023 at 12:20:26AM +, Sean Christopherson wrote: > > > On Tue, Jan 24, 2023, Liam Merwick wrote: > > > > On 14/01/2023 00:37, Sean Christopherson wrote: > >

Re: [PATCH] hw/intc/riscv_aplic: Zero init APLIC internal state

2023-04-13 Thread Anup Patel
On Thu, Apr 13, 2023 at 7:04 PM Ivan Klokov wrote: > > Since g_new is used to initialize the RISCVAPLICState->state structure, > in some case we get behavior that is not as expected. This patch > changes this to g_new0, which allows to initialize the APLIC in the correct > state. > > Signed-off-b

[RFC PATCH v3] riscv: Add support for the Zfa extension

2023-04-13 Thread Christoph Muellner
From: Christoph Müllner This patch introduces the RISC-V Zfa extension, which introduces additional floating-point extensions: * fli (load-immediate) with pre-defined immediates * fminm/fmaxm (like fmin/fmax but with different NaN behaviour) * fround/froundmx (round to integer) * fcvtmod.w.d (Mod

Re: [PATCH 1/4] vhost: Re-enable vrings after setting features

2023-04-13 Thread Michael S. Tsirkin
On Thu, Apr 13, 2023 at 05:24:36PM +0300, Anton Kuchin wrote: > But is there a valid use-case for logging some dirty memory but not all? > I can't understand if this is a feature or a just flaw in specification. IRC the use-case originally conceived was for shadow VQs. If you use shadow VQs the V

Re: [PATCH for-7.2 v3 3/3] rtl8139: honor large send MSS value

2023-04-13 Thread Peter Maydell
On Thu, 17 Nov 2022 at 16:58, Stefan Hajnoczi wrote: > > The Large-Send Task Offload Tx Descriptor (9.2.1 Transmit) has a > Large-Send MSS value where the driver specifies the MSS. See the > datasheet here: > http://realtek.info/pdf/rtl8139cp.pdf > > The code ignores this value and uses a hardcode

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

2023-04-13 Thread Christian Brauner
On Thu, Aug 18, 2022 at 04:24:21PM +0300, Kirill A . Shutemov wrote: > On Wed, Aug 17, 2022 at 10:40:12PM -0700, Hugh Dickins wrote: > > On Wed, 6 Jul 2022, Chao Peng wrote: > > > This is the v7 of this series which tries to implement the fd-based KVM > > > guest private memory. > > > > Here at la

[PATCH v3 3/6] virtio-input: add a virtio-mulitouch device

2023-04-13 Thread Sergio Lopez
Add a virtio-multitouch device to the family of devices emulated by virtio-input implementing the Multi-touch protocol as descripted here: https://www.kernel.org/doc/html/latest/input/multi-touch-protocol.html?highlight=multi+touch This patch just add the device itself, without connecting it to a

[PATCH] hw/i386/vmmouse:add relative packet flag for button status

2023-04-13 Thread Zongmin Zhou
The buttons value use macros instead of direct numbers. If request relative mode, have to add this for guest vmmouse driver to judge this is a relative packet. otherwise,vmmouse driver will not match the condition 'status & VMMOUSE_RELATIVE_PACKET', and can't report events on the correct(relative)

[PATCH v3 5/6] ui: add helpers for virtio-multitouch events

2023-04-13 Thread Sergio Lopez
Add helpers for generating Multi-touch events from the UI backends that can be sent to the guest through a virtio-multitouch device. Signed-off-by: Sergio Lopez Reviewed-by: Marc-André Lureau --- include/ui/input.h | 5 + ui/input.c | 36 2 file

[PATCH v3 0/6] Implement virtio-multitouch and enable GTK3 to use it

2023-04-13 Thread Sergio Lopez
This series adds a virtio-multitouch device to the family of devices emulated by virtio-input implementing the Multi-touch protocol as descripted here: https://www.kernel.org/doc/html/latest/input/multi-touch-protocol.html?highlight=multi+touch It also extends the GTK UI backend to be able to rec

[PATCH v3 2/6] ui: add the infrastructure to support MT events

2023-04-13 Thread Sergio Lopez
Add the required infrastructure to support generating multitouch events. Signed-off-by: Sergio Lopez Reviewed-by: Marc-André Lureau --- include/ui/input.h| 3 +++ qapi/ui.json | 46 --- replay/replay-input.c | 18 + ui/input.

[PATCH v3 6/6] ui/gtk: enable backend to send multi-touch events

2023-04-13 Thread Sergio Lopez
GTK3 provides the infrastructure to receive and process multi-touch events through the "touch-event" signal and the GdkEventTouch type. Make use of it to transpose events from the host to the guest. This allows users of machines with hardware capable of receiving multi-touch events to run guests t

[PATCH v3 4/6] virtio-input-pci: add virtio-multitouch-pci

2023-04-13 Thread Sergio Lopez
Add virtio-multitouch-pci, a Multitouch-capable input device, to the list of devices that can be provided by virtio-input-pci. Signed-off-by: Sergio Lopez Reviewed-by: Marc-André Lureau --- hw/virtio/virtio-input-pci.c | 25 + 1 file changed, 21 insertions(+), 4 deletion

[PATCH v3 1/6] virtio-input: generalize virtio_input_key_config()

2023-04-13 Thread Sergio Lopez
As there are other bitmap-based config properties that need to be dealt in a similar fashion as VIRTIO_INPUT_CFG_EV_BITS, generalize the function to receive select and subsel as arguments, and rename it to virtio_input_extend_config() Signed-off-by: Sergio Lopez Reviewed-by: Marc-André Lureau --

[PATCH 2/2] tests: tcg: ppc64: Add tests for Vector Extract Mask Instructions

2023-04-13 Thread Shivaprasad G Bhat
Add test for vextractbm, vextractwm, vextractdm and vextractqm instructions. Test works for both qemu-ppc64 and qemu-ppc64le. Based on the test case written by John Platts posted at [1] References: [1]: https://gitlab.com/qemu-project/qemu/-/issues/1536 Signed-off-by: John Platts Signed-off-by:

[PATCH 1/2] tcg: ppc64: Fix mask generation for vextractdm

2023-04-13 Thread Shivaprasad G Bhat
In function do_extractm() the mask is calculated as dup_const(1 << (element_width - 1)). '1' being signed int works fine for MO_8,16,32. For MO_64, on PPC64 host this ends up becoming 0 on compilation. The vextractdm uses MO_64, and it ends up having mask as 0. Explicitly use 1ULL instead of signe

[PATCH 0/2] tcg: ppc64: Fix mask generation for vextractdm

2023-04-13 Thread Shivaprasad G Bhat
While debugging gitlab issue[1] 1536, I happen to try the vextract[X]m instructions on the real hardware. The test used in [1] is failing for vextractdm. On debugging it is seen, in function do_extractm() the mask is calculated as dup_const(1 << (element_width - 1)). '1' being signed int works fin

  1   2   >