[PATCH v5 2/4] qapi: Accept bool for OnOffAuto and OnOffSplit

2025-02-07 Thread Akihiko Odaki
bool has representations of "on" and "off" different from OnOffAuto/OnOffSplit: - The command line syntax accepts on/yes/true/y and off/no/false/n for bool but only on and off for OnOffAuto. - JSON uses true/false for bool but "on" and "off" for OnOffAuto/OnOffSplit. This inconsistency causes

[PATCH v5 4/4] virtio: Convert feature properties to OnOffAuto

2025-02-07 Thread Akihiko Odaki
Some features are not always available with vhost. Legacy features are not available with vp_vdpa in particular. virtio devices used to disable them when not available even if the corresponding properties were explicitly set to "on". QEMU already has OnOffAuto type, which includes the "auto" value

[PATCH v5 3/4] qdev-properties: Add DEFINE_PROP_ON_OFF_AUTO_BIT64()

2025-02-07 Thread Akihiko Odaki
DEFINE_PROP_ON_OFF_AUTO_BIT64() corresponds to DEFINE_PROP_ON_OFF_AUTO() as DEFINE_PROP_BIT64() corresponds to DEFINE_PROP_BOOL(). The difference is that DEFINE_PROP_ON_OFF_AUTO_BIT64() exposes OnOffAuto instead of bool. Signed-off-by: Akihiko Odaki --- include/hw/qdev-properties.h | 18

[PATCH v5 1/4] qapi: Do not consume a value if failed

2025-02-07 Thread Akihiko Odaki
Do not consume a value if interpreting one failed so that we can reinterpret the value with a different type. Signed-off-by: Akihiko Odaki --- qapi/qobject-input-visitor.c | 103 +-- 1 file changed, 69 insertions(+), 34 deletions(-) diff --git a/qapi/qobj

[PATCH v5 0/4] virtio: Convert feature properties to OnOffAuto

2025-02-07 Thread Akihiko Odaki
This series was spun off from: "[PATCH 0/3] virtio-net: Convert feature properties to OnOffAuto" (https://patchew.org/QEMU/20240714-auto-v3-0-e27401aab...@daynix.com/) Some features are not always available with vhost. Legacy features are not available with vp_vdpa in particular. virtio devices us

[PATCH 0/3] hw/loongarch/virt: Code cleanup

2025-02-07 Thread Bibo Mao
This is code cleanup with loongArch virt machine type. One separate file is added for fdt table building, also rename file acpi-build with virt-acpi-build. It is only cod movement and function rename. There is no any function change. Bibo Mao (3): hw/loongarch/virt: Rename filename acpi-build w

[PATCH 1/3] hw/loongarch/virt: Rename filename acpi-build with virt-acpi-build

2025-02-07 Thread Bibo Mao
File acpi-build.c is relative with virt machine type, rename it with virt-acpi-build.c Signed-off-by: Bibo Mao --- hw/loongarch/meson.build | 2 +- hw/loongarch/{acpi-build.c => virt-acpi-build.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename hw/loongarch/{a

[PATCH 3/3] hw/loongarch/virt: Add separate file for fdt building

2025-02-07 Thread Bibo Mao
Similiar with virt-acpi-build.c, file virt-fdt-build.c is added here. And move functions relative with fdt table building to the file. It is only code movement and there is no function change. Signed-off-by: Bibo Mao --- hw/loongarch/meson.build | 4 +- hw/loongarch/virt-fdt-build.c | 53

[PATCH 2/3] hw/loongarch/virt: Rename function prefix name

2025-02-07 Thread Bibo Mao
Replace function prefix name loongarch_xxx with virt_xxx in file virt-acpi-build.c Signed-off-by: Bibo Mao --- hw/loongarch/virt-acpi-build.c | 6 +++--- hw/loongarch/virt.c| 2 +- include/hw/loongarch/virt.h| 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/h

Re: [PATCH v4 00/15] vfio: VFIO migration support with vIOMMU

2025-02-07 Thread Zhangfei Gao
On Wed, Jan 22, 2025 at 12:43 AM Joao Martins wrote: > > On 07/01/2025 06:55, Zhangfei Gao wrote: > > Hi, Joao > > > > On Fri, Jun 23, 2023 at 5:51 AM Joao Martins > > wrote: > >> > >> Hey, > >> > >> This series introduces support for vIOMMU with VFIO device migration, > >> particurlarly related

[RFC] target/i386: sev: Add cmdline option to enable the Allowed SEV Features feature

2025-02-07 Thread Kim Phillips
The Allowed SEV Features feature allows the host kernel to control which SEV features it does not want the guest to enable [1]. This has to be explicitly opted-in by the user because it has the ability to break existing VMs if it were set automatically. Currently, both the PmcVirtualization and S

[PATCH v3 0/2] KVM: SEV: Add support for the ALLOWED_SEV_FEATURES feature

2025-02-07 Thread Kim Phillips
AMD EPYC 5th generation processors have introduced a feature that allows the hypervisor to control the SEV_FEATURES that are set for, or by, a guest [1]. ALLOWED_SEV_FEATURES can be used by the hypervisor to enforce that SEV-ES and SEV-SNP guests cannot enable features that the hypervisor does not

[PATCH v3 1/2] x86/cpufeatures: Add "Allowed SEV Features" Feature

2025-02-07 Thread Kim Phillips
From: Kishon Vijay Abraham I Add CPU feature detection for "Allowed SEV Features" to allow the Hypervisor to enforce that SEV-ES and SEV-SNP guest VMs cannot enable features (via SEV_FEATURES) that the Hypervisor does not support or wish to be enabled. Signed-off-by: Kishon Vijay Abraham I Sign

[PATCH v3 2/2] KVM: SEV: Configure "ALLOWED_SEV_FEATURES" VMCB Field

2025-02-07 Thread Kim Phillips
AMD EPYC 5th generation processors have introduced a feature that allows the hypervisor to control the SEV_FEATURES that are set for, or by, a guest [1]. ALLOWED_SEV_FEATURES can be used by the hypervisor to enforce that SEV-ES and SEV-SNP guests cannot enable features that the hypervisor does not

Re: [PATCH v5 5/5] tests/qtest/migration: consolidate set capabilities

2025-02-07 Thread Fabiano Rosas
Prasad Pandit writes: > From: Prasad Pandit > > Migration capabilities are set in multiple '.start_hook' > functions for various tests. Instead, consolidate setting > capabilities in 'set_migration_capabilities()' function > which is called from various 'test_*_common()' functions. > While simpl

[PATCH v4 1/9] meson: Drop tcg as a module

2025-02-07 Thread Richard Henderson
This reverts commit dae0ec159f9 ("accel: build tcg modular"). The attempt was only enabled for x86, only modularized a small portion of tcg, and in more than 3 years there have been no follow-ups to improve the situation. Reviewed-by: Thomas Huth Reviewed-by: Alex Bennée Reviewed-by: Philippe Ma

[PATCH v4 6/9] configure: Define TARGET_LONG_BITS in configs/targets/*.mak

2025-02-07 Thread Richard Henderson
Define TARGET_LONG_BITS in each target's configure fragment. Do this without removing the define in target/*/cpu-param.h so that errors are caught like so: In file included from .../src/include/exec/cpu-defs.h:26, from ../src/target/hppa/cpu.h:24, from ../src/linu

[PATCH v4 7/9] target/*: Remove TARGET_LONG_BITS from cpu-param.h

2025-02-07 Thread Richard Henderson
This is now handled by the configs/targets/*.mak fragment. Reviewed-by: Thomas Huth Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/alpha/cpu-param.h | 2 -- target/arm/cpu-param.h| 2 -- target/avr/cpu-param.h| 1 -

[PATCH v4 2/9] meson: Disallow 64-bit on 32-bit KVM emulation

2025-02-07 Thread Richard Henderson
Require a 64-bit host binary to spawn a 64-bit guest. Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- meson.build | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index e50a103f8a

[PULL 4/6] hw/hppa: Avoid creation of artist if disabled on command line

2025-02-07 Thread deller
From: Helge Deller Do not create the artist graphic card if the user disabled it with "-global artist.disable=true" on the command line. Signed-off-by: Helge Deller --- hw/hppa/machine.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa

[PATCH v4 8/9] meson: Disallow 64-bit on 32-bit emulation

2025-02-07 Thread Richard Henderson
For system mode, we can rarely support the amount of RAM that the guest requires. TCG emulation is restricted to round-robin mode, which solves many of the atomicity issues, but not those associated with virtio. In any case, round-robin does nothing to help the speed of emulation. For user mode,

[PATCH v4 3/9] meson: Disallow 64-bit on 32-bit Xen emulation

2025-02-07 Thread Richard Henderson
Require a 64-bit host binary to spawn a 64-bit guest. Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- meson.build | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 1af8aeb194..911955cfa

[PATCH v4 4/9] meson: Disallow 64-bit on 32-bit HVF/NVMM/WHPX emulation

2025-02-07 Thread Richard Henderson
Require a 64-bit host binary to spawn a 64-bit guest. For HVF this is trivially true because macOS 11 dropped support for 32-bit applications entirely. For NVMM, NetBSD only enables nvmm on x86_64: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/nvmm/Makefile?rev=1.1.6.2;content-type=text%2Fpl

[PULL 5/6] hw/pci-host/astro: Add LMMIO range support

2025-02-07 Thread deller
From: Helge Deller Each Astro on 64-bit machines supports up to four LMMIO regions. Those regions are used by graphic cards and other PCI devices which need to map huge memory areas. The LMMIO regions are configured and set up by SeaBIOS-hppa and then used as-is by the operating systems (Linux, H

[PATCH v4 9/9] meson: Deprecate 32-bit host support

2025-02-07 Thread Richard Henderson
We deprecated i686 system mode support for qemu 8.0. However, to make real cleanups to TCG we need to deprecate all 32-bit hosts. Reviewed-by: Thomas Huth Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- docs/about/deprecated.rst | 7 +++

[PATCH v4 0/9] meson: Deprecate 32-bit host support

2025-02-07 Thread Richard Henderson
v1: 20250128004254.33442-1-richard.hender...@linaro.org v2: 20250203031821.741477-1-richard.hender...@linaro.org v3: 20250204215359.1238808-1-richard.hender...@linaro.org For v4, tidy NVMM/WHPX per Thomas' review. Drop two more stubs patches which were intended to be dropped with v3. r~ Richar

[PULL 0/6] Hppa system for v10 diva artist patches

2025-02-07 Thread deller
From: Helge Deller The following changes since commit 6fccaa2fba391815308a746d68f7fa197bc93586: Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2025-02-02 11:09:10 -0500) are available in the Git repository at: https://github.com/hdeller/qemu-hppa.git tag

[PATCH v4 5/9] gitlab-ci: Replace aarch64 with arm in cross-i686-tci build

2025-02-07 Thread Richard Henderson
Configuration of 64-bit host on 32-bit guest will shortly be denied. Use a 32-bit guest instead. Reviewed-by: Thomas Huth Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- .gitlab-ci.d/crossbuilds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.d

[PULL 3/6] artist: Allow disabling artist on command line

2025-02-07 Thread deller
From: Helge Deller Allow users to disable the artist graphic card on the command line with the option "-global artist.disable=true". This change allows to use other graphic cards when using Linux, e.g. by adding "-device ati-vga". Signed-off-by: Helge Deller --- hw/display/artist.c | 9 ++-

[PULL 6/6] target/hppa: Update SeaBIOS-hppa

2025-02-07 Thread deller
From: Helge Deller Update to lastest SeaBIOS-hppa which sets up the LMMIO range for the internal artist graphic card. Signed-off-by: Helge Deller --- roms/seabios-hppa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roms/seabios-hppa b/roms/seabios-hppa index 1c516b4813..33

[PULL 2/6] hw/hppa: Wire up Diva GSP card

2025-02-07 Thread deller
From: Helge Deller Until now we used a standard serial-pci device to emulate a HP serial console. This worked nicely with 32-bit Linux and 32-bit HP-UX, but 64-bit HP-UX crashes with it and expects either a Diva GSP card, or a real 64-bit capable PCI graphic card (which we don't have yet). In or

[PULL 1/6] hw/char: Add emulation of Diva GSP PCI management boards

2025-02-07 Thread deller
From: Helge Deller The Diva GSP ("Guardian Service Processor") PCI boards are Remote Management cards for PA-RISC machines. They come with built-in 16550A UARTs for serial consoles and modem functionalities, as well as a mailbox-like memory area for hardware auto-reboot functionality. Latest ge

Re: [PATCH 1/2] i386/xen: Move KVM_XEN_HVM_CONFIG ioctl to kvm_xen_init_vcpu()

2025-02-07 Thread David Woodhouse
On 7 February 2025 15:37:40 GMT, Sean Christopherson wrote: >On Fri, Feb 07, 2025, David Woodhouse wrote: >> From: David Woodhouse >> >> At the time kvm_xen_init() is called, hyperv_enabled() doesn't yet work, so >> the correct MSR index to use for the hypercall page isn't known. >> >> Rather t

[PATCH v4 2/2] s390x/pci: indicate QEMU supports relaxed translation for passthrough

2025-02-07 Thread Matthew Rosato
Specifying this bit in the guest CLP response indicates that the guest can optionally choose to skip translation and instead use identity-mapped operations. Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c| 5 - include/hw/s390x/s390-pci-clp.h | 1 + 2 files changed, 5 inse

[PATCH v4 0/2] s390x/pci: relax I/O address translation requirement

2025-02-07 Thread Matthew Rosato
This series introduces the concept of the relaxed translation requirement for s390x guests in order to allow bypass of the guest IOMMU for more efficient PCI passthrough. With this series, QEMU can indicate to the guest that an IOMMU is not strictly required for a zPCI device. This would subseque

[PATCH v4 1/2] s390x/pci: add support for guests that request direct mapping

2025-02-07 Thread Matthew Rosato
When receiving a guest mpcifc(4) or mpcifc(6) instruction without the T bit set, treat this as a request to perform direct mapping instead of address translation. In order to facilitate this, pin the entirety of guest memory into the host iommu. Pinning for the direct mapping case is handled via

[PATCH v3] hw/arm/virt: Support larger highmem MMIO regions

2025-02-07 Thread Matthew R. Ochs
The MMIO region size required to support virtualized environments with large PCI BAR regions can exceed the hardcoded limit configured in QEMU. For example, a VM with multiple NVIDIA Grace-Hopper GPUs passed through requires more MMIO memory than the amount provided by VIRT_HIGH_PCIE_MMIO (currentl

Re: [PATCH] migration: use parameters.mode in cpr_state_save

2025-02-07 Thread Steven Sistare
On 2/5/2025 4:52 PM, Steven Sistare wrote: On 2/5/2025 4:28 PM, Peter Xu wrote: On Wed, Feb 05, 2025 at 12:54:01PM -0800, Steve Sistare wrote: qmp_migrate guarantees that cpr_channel is not null for MIG_MODE_CPR_TRANSFER when cpr_state_save is called: qmp_migrate() if (s->paramet

[RFC PATCH v3 8/8] migration: Check migration error after loadvm

2025-02-07 Thread Fabiano Rosas
We're currently only checking the QEMUFile error after qemu_loadvm_state(). This was causing a TLS termination error from multifd recv threads to be ignored. Start checking the migration error as well to avoid missing further errors. Regarding compatibility concerning the TLS termination error th

[RFC PATCH v3 5/8] io: Add a read flag for relaxed EOF

2025-02-07 Thread Fabiano Rosas
Add a read flag that can inform a channel that it's ok to receive an EOF at any moment. Channels that have some form of strict EOF tracking, such as TLS session termination, may choose to ignore EOF errors with the use of this flag. This is being added for compatibility with older migration stream

[RFC PATCH v3 6/8] migration/multifd: Terminate the TLS connection

2025-02-07 Thread Fabiano Rosas
The multifd recv side has been getting a TLS error of GNUTLS_E_PREMATURE_TERMINATION at the end of migration when the send side closes the sockets without ending the TLS session. This has been masked by the code not checking the migration error after loadvm. Start ending the TLS session at multifd

[RFC PATCH v3 7/8] migration/multifd: Add a compat property for TLS termination

2025-02-07 Thread Fabiano Rosas
We're currently changing the way the source multifd migration handles the shutdown of the multifd channels when TLS is in use to perform a clean termination by calling gnutls_bye(). Older src QEMUs will always close the channel without terminating the TLS session. New dst QEMUs treat an unclean te

[RFC PATCH v3 2/8] io: tls: Add qio_channel_tls_bye

2025-02-07 Thread Fabiano Rosas
Add a task dispatcher for gnutls_bye similar to the qio_channel_tls_handshake_task(). The gnutls_bye() call might be interrupted and so it needs to be rescheduled. The migration code will make use of this to help the migration destination identify a premature EOF. Once the session termination is i

[RFC PATCH v3 4/8] io: Add flags argument to qio_channel_readv_full_all_eof

2025-02-07 Thread Fabiano Rosas
We want to pass flags into qio_channel_tls_readv() but qio_channel_readv_full_all_eof() doesn't take a flags argument. No functional change. Signed-off-by: Fabiano Rosas --- hw/remote/mpqemu-link.c | 2 +- include/io/channel.h| 2 ++ io/channel.c| 9 ++--- 3 files changed, 9

[RFC PATCH v3 1/8] crypto: Allow gracefully ending the TLS session

2025-02-07 Thread Fabiano Rosas
QEMU's TLS session code provides no way to call gnutls_bye() to terminate a TLS session. Callers of qcrypto_tls_session_read() can choose to ignore a GNUTLS_E_PREMATURE_TERMINATION error by setting the gracefulTermination argument. The QIOChannelTLS ignores the premature termination error whenever

[RFC PATCH v3 3/8] crypto: Remove qcrypto_tls_session_get_handshake_status

2025-02-07 Thread Fabiano Rosas
The correct way of calling qcrypto_tls_session_handshake() requires calling qcrypto_tls_session_get_handshake_status() right after it so there's no reason to have a separate method. Refactor qcrypto_tls_session_handshake() to inform the status in its own return value and alter the callers accordin

[RFC PATCH v3 0/8] crypto,io,migration: Add support to gnutls_bye()

2025-02-07 Thread Fabiano Rosas
(cover-letter update I forgot on v2:) This series now contains the two approches we've been discussing to avoid the TLS termination error on the multifd_recv threads. The source machine now ends the TLS session with gnutls_bye() and the destination will consider a premature termination an error.

Re: [PATCH v4 17/33] migration/multifd: Make MultiFDSendData a struct

2025-02-07 Thread Maciej S. Szmigiero
On 7.02.2025 15:36, Fabiano Rosas wrote: "Maciej S. Szmigiero" writes: From: Peter Xu The newly introduced device state buffer can be used for either storing VFIO's read() raw data, but already also possible to store generic device states. After noticing that device states may not easily pr

Re: [RFC PATCH v2 0/8] crypto,io,migration: Add support to gnutls_bye()

2025-02-07 Thread Maciej S. Szmigiero
On 7.02.2025 15:27, Fabiano Rosas wrote: v2: Added the premature_ok logic; Added compat property for QEMU <9.1; Refactored the existing handshake code; CI run: https://gitlab.com/farosas/qemu/-/pipelines/1660800456 v1: https://lore.kernel.org/r/20250206175824.22664-1-faro...@suse.de Hi, We'v

Re: [PATCH 15/15] arm/cpu: Add generated files

2025-02-07 Thread Richard Henderson
On 2/7/25 03:02, Cornelia Huck wrote: And switch to using the generated definitions. Generated against Linux 6.14-rc1. Signed-off-by: Cornelia Huck --- target/arm/cpu-sysreg-properties.c | 716 - target/arm/cpu-sysregs.h | 116 + target/arm/cpu-sysr

Re: [PATCH v4 4/4] qapi: expose all schema features to code

2025-02-07 Thread John Snow
On Fri, Feb 7, 2025, 6:57 AM Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > This replaces use of the constants from the QapiSpecialFeatures > > enum, with constants from the auto-generate QapiFeatures enum > > in qapi-features.h > > > > The 'deprecated' and 'unstable' features still

Re: [PATCH 02/15] arm/kvm: add accessors for storing host features into idregs

2025-02-07 Thread Richard Henderson
On 2/7/25 03:02, Cornelia Huck wrote: +/* read a 32b sysreg value and store it in the idregs */ +static int get_host_cpu_reg32(int fd, ARMHostCPUFeatures *ahcf, ARMSysRegs sysreg) +{ +int index = get_sysreg_idx(sysreg); +uint64_t *reg; +int ret; + +if (index < 0) { +retur

Re: [PATCH 03/15] arm/cpu: Store aa64isar0 into the idregs arrays

2025-02-07 Thread Richard Henderson
On 2/7/25 03:02, Cornelia Huck wrote: -t = cpu->isar.id_aa64zfr0; +t = GET_IDREG(idregs, ID_AA64ZFR0); t = FIELD_DP64(t, ID_AA64ZFR0, SVEVER, 1); t = FIELD_DP64(t, ID_AA64ZFR0, AES, 2); /* FEAT_SVE_PMULL128 */ t = FIELD_DP64(t, ID_AA64ZFR0, BITPERM, 1); /* FEAT_S

Re: [PATCH 02/15] arm/kvm: add accessors for storing host features into idregs

2025-02-07 Thread Richard Henderson
On 2/7/25 03:02, Cornelia Huck wrote: +/* read a 32b sysreg value and store it in the idregs */ +static int get_host_cpu_reg32(int fd, ARMHostCPUFeatures *ahcf, ARMSysRegs sysreg) +{ +int index = get_sysreg_idx(sysreg); +uint64_t *reg; +int ret; + +if (index < 0) { +retur

Re: [RFC PATCH v2 8/8] migration/multifd: Add a compat property for TLS termination

2025-02-07 Thread Fabiano Rosas
Peter Xu writes: > On Fri, Feb 07, 2025 at 11:27:58AM -0300, Fabiano Rosas wrote: >> We're currently changing the way the source multifd migration handles >> the shutdown of the multifd channels when TLS is in use to perform a >> clean termination by calling gnutls_bye(). >> >> Older src QEMUs w

Re: [PATCH 01/15] arm/cpu: Add sysreg definitions in cpu-sysregs.h

2025-02-07 Thread Richard Henderson
On 2/7/25 03:02, Cornelia Huck wrote: diff --git a/target/arm/cpu-sysregs.h b/target/arm/cpu-sysregs.h new file mode 100644 index ..de09ebae91a5 --- /dev/null +++ b/target/arm/cpu-sysregs.h ... +static const uint32_t id_register_sysreg[NUM_ID_IDX] = { You can't place the data into

Re: [PATCH] target/arm/helper: Fix timer interrupt masking when HCR_EL2.E2H == 0

2025-02-07 Thread Alex Bennée
Richard Henderson writes: > On 2/7/25 07:45, Peter Maydell wrote: >> This is where things go wrong -- icount_start_warp_timer() >> notices that all CPU threads are currently idle, and >> decides it needs to warp the timer forwards to the >> next deadline, which is at the end of time -- INT64_MAX.

Re: [RFC PATCH v2 3/8] migration/multifd: Terminate the TLS connection

2025-02-07 Thread Fabiano Rosas
Peter Xu writes: > On Fri, Feb 07, 2025 at 11:27:53AM -0300, Fabiano Rosas wrote: >> The multifd recv side has been getting a TLS error of >> GNUTLS_E_PREMATURE_TERMINATION at the end of migration when the send >> side closes the sockets without ending the TLS session. This has been >> masked by

Re: [PATCH 4/5] hw/arm/smmuv3: Move reset to exit phase

2025-02-07 Thread Peter Maydell
On Fri, 7 Feb 2025 at 17:48, Peter Xu wrote: > > On Fri, Feb 07, 2025 at 04:58:39PM +, Peter Maydell wrote: > > (I wonder if we ought to suggest quiescing outstanding > > DMA in the enter phase? But it's probably easier to fix > > the iommus like this series does than try to get every > > dma-

Re: [PATCH 4/4] vfio/igd: sync GPU generation with i915 kernel driver

2025-02-07 Thread Tomita Moeko
On 2/6/25 20:13, Corvin Köhne wrote: > From: Corvin Köhne > > We're currently missing some GPU IDs already supported by the i915 > kernel driver. Additionally, we've treated IvyBridge as gen 6 in the > past. According to i915 it's gen 7 [1]. It shouldn't cause any issues > yet because we treat

Re: [RFC PATCH v2 1/8] crypto: Allow gracefully ending the TLS session

2025-02-07 Thread Peter Xu
On Fri, Feb 07, 2025 at 02:55:57PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Fri, Feb 07, 2025 at 11:27:51AM -0300, Fabiano Rosas wrote: > >> QEMU's TLS session code provides no way to call gnutls_bye() to > >> terminate a TLS session. Callers of qcrypto_tls_session_read() can > >>

Re: [RFC PATCH v2 8/8] migration/multifd: Add a compat property for TLS termination

2025-02-07 Thread Peter Xu
On Fri, Feb 07, 2025 at 11:27:58AM -0300, Fabiano Rosas wrote: > We're currently changing the way the source multifd migration handles > the shutdown of the multifd channels when TLS is in use to perform a > clean termination by calling gnutls_bye(). > > Older src QEMUs will always close the chann

Re: [PATCH v2 01/17] tests/docker: replicate the check-rust-tools-nightly CI job

2025-02-07 Thread Richard Henderson
On 2/7/25 07:30, Alex Bennée wrote: This allows people to run the test locally: make docker-test-rust@fedora-rust-nightly Signed-off-by: Alex Bennée --- v2 - update MAINTAINERS --- MAINTAINERS | 1 + tests/docker/Makefile.include | 3 +++ tests/docker/test-rust

Re: [PATCH v7 3/6] accel/kvm: Report the loss of a large memory page

2025-02-07 Thread William Roche
On 2/5/25 18:07, Peter Xu wrote: On Wed, Feb 05, 2025 at 05:27:13PM +0100, William Roche wrote: [...] The HMP command "info ramblock" is implemented with the ram_block_format() function which returns a message buffer built with a string for each ramblock (protected by the RCU_READ_LOCK_GUARD). O

Re: [RFC PATCH v2 4/8] migration: Check migration error after loadvm

2025-02-07 Thread Peter Xu
On Fri, Feb 07, 2025 at 11:27:54AM -0300, Fabiano Rosas wrote: > We're currently only checking the QEMUFile error after > qemu_loadvm_state(). Check the migration error as well to avoid > missing errors that might be set by the multifd recv thread. > > This doesn't break compat between 9.2 and 10.

Re: [RFC PATCH v2 3/8] migration/multifd: Terminate the TLS connection

2025-02-07 Thread Peter Xu
On Fri, Feb 07, 2025 at 11:27:53AM -0300, Fabiano Rosas wrote: > The multifd recv side has been getting a TLS error of > GNUTLS_E_PREMATURE_TERMINATION at the end of migration when the send > side closes the sockets without ending the TLS session. This has been > masked by the code not checking the

Re: [RFC PATCH v2 1/8] crypto: Allow gracefully ending the TLS session

2025-02-07 Thread Fabiano Rosas
Peter Xu writes: > On Fri, Feb 07, 2025 at 11:27:51AM -0300, Fabiano Rosas wrote: >> QEMU's TLS session code provides no way to call gnutls_bye() to >> terminate a TLS session. Callers of qcrypto_tls_session_read() can >> choose to ignore a GNUTLS_E_PREMATURE_TERMINATION error by setting the >> g

Re: [PATCH 4/5] hw/arm/smmuv3: Move reset to exit phase

2025-02-07 Thread Peter Xu
On Fri, Feb 07, 2025 at 04:58:39PM +, Peter Maydell wrote: > (I wonder if we ought to suggest quiescing outstanding > DMA in the enter phase? But it's probably easier to fix > the iommus like this series does than try to get every > dma-capable pci device to do something different.) I wonder i

Re: [PATCH 0/5] Fix vIOMMU reset order

2025-02-07 Thread Peter Xu
On Fri, Feb 07, 2025 at 05:06:20PM +, Peter Maydell wrote: > On Fri, 7 Feb 2025 at 16:54, Peter Xu wrote: > > > > On Thu, Feb 06, 2025 at 03:21:51PM +0100, Eric Auger wrote: > > > This is a follow-up of Peter's attempt to fix the fact that > > > vIOMMUs are likely to be reset before the device

Re: [PATCH 0/5] Fix vIOMMU reset order

2025-02-07 Thread Cédric Le Goater
On 2/7/25 17:54, Peter Xu wrote: On Thu, Feb 06, 2025 at 03:21:51PM +0100, Eric Auger wrote: This is a follow-up of Peter's attempt to fix the fact that vIOMMUs are likely to be reset before the device they protect: [PATCH 0/4] intel_iommu: Reset vIOMMU after all the rest of devices https://lor

Re: [PATCH v3 4/4] qapi: expose all schema features to code

2025-02-07 Thread John Snow
On Fri, Feb 7, 2025, 5:30 AM Markus Armbruster wrote: > John Snow writes: > > > On Fri, Jan 31, 2025 at 8:18 AM Markus Armbruster > wrote: > > > >> Cc: John Snow for Python typing expertise. > >> > >> Daniel P. Berrangé writes: > >> > >> > This replaces use of the constants from the QapiSpecia

Re: [PATCH] target/arm/helper: Fix timer interrupt masking when HCR_EL2.E2H == 0

2025-02-07 Thread Richard Henderson
On 2/7/25 07:45, Peter Maydell wrote: This is where things go wrong -- icount_start_warp_timer() notices that all CPU threads are currently idle, and decides it needs to warp the timer forwards to the next deadline, which is at the end of time -- INT64_MAX. But once timer_mod_ns() returns, the g

Re: [RFC PATCH v2 1/8] crypto: Allow gracefully ending the TLS session

2025-02-07 Thread Peter Xu
On Fri, Feb 07, 2025 at 11:27:51AM -0300, Fabiano Rosas wrote: > QEMU's TLS session code provides no way to call gnutls_bye() to > terminate a TLS session. Callers of qcrypto_tls_session_read() can > choose to ignore a GNUTLS_E_PREMATURE_TERMINATION error by setting the > gracefulTermination argume

Re: [PATCH 5/5] hw/vfio/common: Add a trace point in vfio_reset_handler

2025-02-07 Thread Cédric Le Goater
On 2/6/25 15:21, Eric Auger wrote: To ease the debug of reset sequence, let's add a trace point in vfio_reset_handler() Signed-off-by: Eric Auger Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/common.c | 1 + hw/vfio/trace-events | 1 + 2 files changed, 2 insertions(+) d

Re: [PATCH 0/5] Fix vIOMMU reset order

2025-02-07 Thread Peter Maydell
On Fri, 7 Feb 2025 at 16:54, Peter Xu wrote: > > On Thu, Feb 06, 2025 at 03:21:51PM +0100, Eric Auger wrote: > > This is a follow-up of Peter's attempt to fix the fact that > > vIOMMUs are likely to be reset before the device they protect: > > > > [PATCH 0/4] intel_iommu: Reset vIOMMU after all th

Re: [PATCH 4/5] hw/arm/smmuv3: Move reset to exit phase

2025-02-07 Thread Peter Maydell
On Fri, 7 Feb 2025 at 16:50, Eric Auger wrote: > > > > > On 2/7/25 5:37 PM, Peter Maydell wrote: > > On Thu, 6 Feb 2025 at 14:23, Eric Auger wrote: > >> Currently the iommu may be reset before the devices > >> it protects. For example this happens with virtio-scsi-pci. > >> when system_reset is i

Re: [PATCH 0/5] Fix vIOMMU reset order

2025-02-07 Thread Peter Xu
On Thu, Feb 06, 2025 at 03:21:51PM +0100, Eric Auger wrote: > This is a follow-up of Peter's attempt to fix the fact that > vIOMMUs are likely to be reset before the device they protect: > > [PATCH 0/4] intel_iommu: Reset vIOMMU after all the rest of devices > https://lore.kernel.org/all/202401170

Re: [PATCH 0/5] Fix vIOMMU reset order

2025-02-07 Thread Eric Auger
Hi Peter, Michael, On 2/7/25 5:40 PM, Peter Maydell wrote: > On Fri, 7 Feb 2025 at 11:10, Michael S. Tsirkin wrote: >> On Thu, Feb 06, 2025 at 03:21:51PM +0100, Eric Auger wrote: >>> This is a follow-up of Peter's attempt to fix the fact that >>> vIOMMUs are likely to be reset before the device

Re: [PATCH 4/5] hw/arm/smmuv3: Move reset to exit phase

2025-02-07 Thread Eric Auger
On 2/7/25 5:37 PM, Peter Maydell wrote: > On Thu, 6 Feb 2025 at 14:23, Eric Auger wrote: >> Currently the iommu may be reset before the devices >> it protects. For example this happens with virtio-scsi-pci. >> when system_reset is issued from qmp monitor, spurious >> "virtio: zero sized buffer

Re: [PATCH 0/5] Fix vIOMMU reset order

2025-02-07 Thread Peter Maydell
On Fri, 7 Feb 2025 at 11:10, Michael S. Tsirkin wrote: > > On Thu, Feb 06, 2025 at 03:21:51PM +0100, Eric Auger wrote: > > This is a follow-up of Peter's attempt to fix the fact that > > vIOMMUs are likely to be reset before the device they protect: > > > > [PATCH 0/4] intel_iommu: Reset vIOMMU af

Re: [PATCH 4/5] hw/arm/smmuv3: Move reset to exit phase

2025-02-07 Thread Peter Maydell
On Thu, 6 Feb 2025 at 14:23, Eric Auger wrote: > > Currently the iommu may be reset before the devices > it protects. For example this happens with virtio-scsi-pci. > when system_reset is issued from qmp monitor, spurious > "virtio: zero sized buffers are not allowed" warnings can > be observed. >

[PATCH v2 03/10] m68k: reset vcpu after it's created

2025-02-07 Thread Igor Mammedov
Reseting vcpu before its thread is created, caused various issues in the past for other targets. It doesn't cause issues for m68k at the moment but to be consistent with the rest of targets, move reset during realize time after qemu_init_vcpu(). That basically prevents reset being run when when vC

[PATCH v2 05/10] Revert "tcg/cputlb: remove other-cpu capability from TLB flushing"

2025-02-07 Thread Igor Mammedov
1) This reverts commit 30933c4fb4f3df95ae44c4c3c86a5df049852c01. ("tcg/cputlb: remove other-cpu capability from TLB flushing") The commit caused a regression which went unnoticed due to affected being disabled by default (DEBUG_TLB_GATE 0) Previous patch switched to using tcg_debug_assert() so t

[PATCH v2 09/10] accel/kvm: Assert vCPU is created when calling kvm_dirty_ring_reap*()

2025-02-07 Thread Igor Mammedov
From: Philippe Mathieu-Daudé Previous commits made sure vCPUs are realized before accelerators (such KVM) use them. Ensure that by asserting the vCPU is created, no need to return. For more context, see commit 56adee407fc ("kvm: dirty-ring: Fix race with vcpu creation"). Signed-off-by: Philippe

qemu-devel@nongnu.org

2025-02-07 Thread Igor Mammedov
cpu_list_add() was doing 2 distinct things: - assign some index to vCPU - add unrealized (thus in inconsistent state) vCPU to &cpus_queue Code using CPU_FOREACH() macro would iterate over possibly unrealized vCPUs, often dealt with special casing. Instead of working around of vCPU existence in cp

[PATCH v2 10/10] accel/kvm: Remove unreachable assertion in kvm_dirty_ring_reap*()

2025-02-07 Thread Igor Mammedov
From: Philippe Mathieu-Daudé Previous commit passed all our CI tests, this assertion being never triggered. Remove it as dead code. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Igor Mammedov --- CC: k...@vger.kernel.org --- accel/kvm/kvm-all.c | 7 -

[PATCH v2 02/10] loongarch: reset vcpu after it's created

2025-02-07 Thread Igor Mammedov
Reseting vcpu before its thread is created, caused various issues in the past for other targets. It doesn't cause issues for loongarch at the moment but to be consistent with the rest of targets, move reset during realize time after qemu_init_vcpu(). That basically prevents reset being run when wh

[PATCH v2 06/10] tcg: drop cpu->created check

2025-02-07 Thread Igor Mammedov
previous commits fixed 2 remaining cases where vcpu might have had 'cpu->created == false' during 1st vcpu reset (at realize time) that leads to call chain tcg_cpu_reset_hold() => tlb_flush_by_mmuidx() remove not need anymore check, with cpu->created always being true. Signed-off-by: Igor M

[PATCH v2 01/10] bsd-user: drop not longer used target_reset_cpu()

2025-02-07 Thread Igor Mammedov
target_reset_cpu() static inlines have no user, remove them. Signed-off-by: Igor Mammedov --- CC: Warner Losh CC: Kyle Evans --- bsd-user/aarch64/target_arch_cpu.h | 5 - bsd-user/arm/target_arch_cpu.h | 4 bsd-user/i386/target_arch_cpu.h| 5 - bsd-user/riscv/target_arch_c

[PATCH v2 07/10] accel/tcg: Simplify use of &first_cpu in rr_cpu_thread_fn()

2025-02-07 Thread Igor Mammedov
From: Philippe Mathieu-Daudé Let vCPUs wait for themselves being ready first, then other ones. This allows the first thread to starts without the global vcpu queue (thus &first_cpu) being populated. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Igor Mammedov --- accel/tcg/tcg-accel-ops

qemu-devel@nongnu.org

2025-02-07 Thread Igor Mammedov
Changelog: * drop wire/unwire hooks patches * drop unrealize related patches * include fixed up patches from [PATCH 0/6] tcg: fix qemu crash when add assert_cpu_is_self() is enabled and cleanups related to cpu->created check https://patchew.org/QEMU/20250129134436.12407

[PATCH v2 04/10] tcg:tlb: use tcg_debug_assert() in assert_cpu_is_self()

2025-02-07 Thread Igor Mammedov
that will enable assert_cpu_is_self when QEMU is configured with --enable-debug without need for manual patching DEBUG_TLB_GATE define. Need to manually path DEBUG_TLB_GATE define to enable assert, let regression caused by [1] creep in unnoticed. 1) 30933c4fb4f3d ("tcg/cputlb: remove other-cpu

qemu-devel@nongnu.org

2025-02-07 Thread Igor Mammedov
On Tue, 28 Jan 2025 15:21:43 +0100 Philippe Mathieu-Daudé wrote: > Hi, > > The goal of this series is to expose vCPUs in a stable state > to the accelerators, in particular the QDev 'REALIZED' step. I'll take some of your patches (with Richard's feedback fixed), and respin series focusing mostl

Re: [PATCH v2 05/17] tests/qtest: rename qtest_send_prefix and roll-up into qtest_send

2025-02-07 Thread Thomas Huth
On 07/02/2025 16.31, Alex Bennée wrote: qtest_send_prefix never actually sent something over the chardev, all it does is print the timestamp to the QTEST_LOG when enabled. So rename the function, make it static, remove the unused CharDev and simplify all the call sites by handling that directly w

Re: [PATCH v2 02/17] tests/qtest: don't attempt to clock_step while waiting for virtio ISR

2025-02-07 Thread Thomas Huth
On 07/02/2025 16.30, Alex Bennée wrote: This replicates the changes from 92cb8f8bf6 (tests/qtest: remove clock_steps from virtio tests) as there are no timers in the virtio code. We still busy wait and timeout though. Signed-off-by: Alex Bennée --- v2 - fix trailing space --- tests/qtest/

Re: [PATCH v3 18/26] hw/arm/boot: Mark all guest memory as RIPAS_RAM.

2025-02-07 Thread Jean-Philippe Brucker
On Tue, Feb 04, 2025 at 05:27:17PM +1000, Gavin Shan wrote: > On 11/26/24 5:56 AM, Jean-Philippe Brucker wrote: > > All Realm IPA states are by default RIPAS_EMPTY, and accessing them in > > that state causes injection of synchronous exception. Either the loader > > or the guest needs to set IPA st

Re: Call for GSoC internship project ideas

2025-02-07 Thread Stefan Hajnoczi
On Fri, Feb 7, 2025 at 10:34 AM Helge Deller wrote: > > On 2/7/25 15:47, Stefan Hajnoczi wrote: > > On Fri, Feb 7, 2025 at 9:39 AM Helge Deller wrote: > >> > >> Hi Stefan, > >> > >> On 1/28/25 17:16, Stefan Hajnoczi wrote: > >>> How to propose your idea > >>> -- > >>>

Re: [PATCH v3 09/26] target/arm/kvm-rme: Initialize Realm memory

2025-02-07 Thread Jean-Philippe Brucker
On Tue, Feb 04, 2025 at 03:30:00PM +1000, Gavin Shan wrote: > > +hwaddr ram_base; > > +size_t ram_size; > > }; > > s/size_t/hwaddr. To be consistent with RmeRamRegion, we may reuse > it like below. > > struct RmeGuest { > : > GSlist *populate_ram_regions; > RmeRamRegion init

Re: [PATCH v3 08/26] hw/core/loader: Add ROM loader notifier

2025-02-07 Thread Jean-Philippe Brucker
On Tue, Feb 04, 2025 at 03:33:10PM +1000, Gavin Shan wrote: > > diff --git a/include/hw/loader.h b/include/hw/loader.h > > index 7f6d06b956..0cd9905f97 100644 > > --- a/include/hw/loader.h > > +++ b/include/hw/loader.h > > @@ -353,6 +353,21 @@ void *rom_ptr_for_as(AddressSpace *as, hwaddr addr, >

Re: [PATCH v3 06/26] target/arm/kvm-rme: Initialize vCPU

2025-02-07 Thread Jean-Philippe Brucker
On Tue, Feb 04, 2025 at 03:02:41PM +1000, Gavin Shan wrote: > > +reg.id = AARCH64_CORE_REG(regs.pc); > > +reg.addr = (uintptr_t) &env->pc; > > +ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®); > > +if (ret) { > > +return ret; > > +} > > + > > +return 0; > > +} > > + >

  1   2   3   >