Re: [RFC PATCH] elfload: Fix alignment when unmapping excess reservation

2025-02-18 Thread Michael Tokarev
13.02.2025 17:35, Fabiano Rosas wrote: When complying with the alignment requested in the ELF and unmapping the excess reservation, having align_end not aligned to the guest page causes the unmap to be rejected by the alignment check at target_munmap and later brk adjustments hit an EEXIST. Fix

Re: [PATCH v4 0/3] Enable clang build on Windows

2025-02-18 Thread Stefan Weil via
Am 19.02.25 um 08:01 schrieb Pierrick Bouvier: On 2/18/25 22:39, Stefan Weil wrote: Am 19.02.25 um 00:17 schrieb Pierrick Bouvier: On 2/18/25 12:59, Stefan Weil wrote: I could run a QEMU cross compile on Debian with the llvm toolchain and msys2 clangarm64 packages installed with pacman. The

[PATCH v4 20/24] hw/uefi-vars-sysbus: add x64 variant

2025-02-18 Thread Gerd Hoffmann
The x86 variant of the device is mapped on the fixed address 0xfef1 and uses etc/hardware-info instead of FDT to pass the mapping location to the edk2 firmware. The latter allows to move the device to a different location should that turn out to be necessary in the future. Signed-off-by: Gerd

[PATCH v4 19/24] hw/uefi-vars-sysbus: qemu platform bus support

2025-02-18 Thread Gerd Hoffmann
Add and register function to create an device tree entry when the device is added to the qemu platform bus. Signed-off-by: Gerd Hoffmann --- hw/core/sysbus-fdt.c | 24 hw/uefi/var-service-sysbus.c | 1 + 2 files changed, 25 insertions(+) diff --git a/hw/core/sy

[PATCH v4 17/24] hw/uefi: add to meson

2025-02-18 Thread Gerd Hoffmann
Wire up uefi-vars in the build system. Signed-off-by: Gerd Hoffmann --- hw/meson.build | 1 + hw/uefi/meson.build | 19 +++ meson.build | 1 + 3 files changed, 21 insertions(+) diff --git a/hw/meson.build b/hw/meson.build index b827c82c5d7b..138f5d59e178 100644 --

[PATCH v4 23/24] hw/uefi: add MAINTAINERS entry

2025-02-18 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3848d37a38d2..56a3ca1afd0c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2801,6 +2801,12 @@ F: hw/misc/ivshmem-flat.c F: include/hw/misc/ivshmem-flat.h F: docs

[PATCH v4 12/24] hw/uefi: add var-service-pkcs7-stub.c

2025-02-18 Thread Gerd Hoffmann
pkcs7 stub which is used in case gnutls is not available. It throws EFI_WRITE_PROTECTED errors unconditionally, so all authenticated variables are readonly for the guest. Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-pkcs7-stub.c | 16 1 file changed, 16 insertions(+) c

[PATCH v4 10/24] hw/uefi: add var-service-core.c

2025-02-18 Thread Gerd Hoffmann
This is the core code for guest <-> host communication. This accepts request messages from the guest, dispatches them to the service called, and sends back the response message. Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-core.c | 321 + 1 file chang

[PATCH v4 14/24] hw/uefi: add var-service-json.c + qapi for NV vars.

2025-02-18 Thread Gerd Hoffmann
Define qapi schema for the uefi variable store state. Use it and the generated visitor helper functions to store persistent (EFI_VARIABLE_NON_VOLATILE) variables in JSON format on disk. Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-json.c | 243 + qapi

[PATCH v4 13/24] hw/uefi: add var-service-siglist.c

2025-02-18 Thread Gerd Hoffmann
Functions to serialize and de-serialize EFI signature databases. This is needed to merge signature databases (happens in practice when appending dbx updates) and also to extract the certificates for pkcs7 signature verification. Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-siglist.c | 2

[PATCH v4 22/24] hw/uefi-vars-sysbus: allow for pc and q35

2025-02-18 Thread Gerd Hoffmann
Allow the device being added to x86_64 pc and q35 VMs. Signed-off-by: Gerd Hoffmann --- hw/i386/pc_piix.c | 2 ++ hw/i386/pc_q35.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 04d2957adcd7..6c91e2d29298 100644 --- a/hw/i386/pc_piix.c +++ b/h

[PATCH v4 16/24] hw/uefi: add UEFI_VARS to Kconfig

2025-02-18 Thread Gerd Hoffmann
Add UEFI_VARS config option, enable by default for x86_64 and aarch64. Signed-off-by: Gerd Hoffmann --- hw/Kconfig | 1 + hw/uefi/Kconfig | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 hw/uefi/Kconfig diff --git a/hw/Kconfig b/hw/Kconfig index 1b4e9bb07f7d..c4dfe2e7af7c 1006

[PATCH v4 03/24] hw/uefi: add include/hw/uefi/var-service-edk2.h

2025-02-18 Thread Gerd Hoffmann
A bunch of #defines and structs copied over from edk2, mostly needed to decode and encode the messages in the communication buffer. Signed-off-by: Gerd Hoffmann --- include/hw/uefi/var-service-edk2.h | 227 + 1 file changed, 227 insertions(+) create mode 100644 inclu

[PATCH v4 15/24] hw/uefi: add trace-events

2025-02-18 Thread Gerd Hoffmann
Add trace events for debugging and trouble shooting. Signed-off-by: Gerd Hoffmann --- hw/uefi/trace-events | 17 + 1 file changed, 17 insertions(+) create mode 100644 hw/uefi/trace-events diff --git a/hw/uefi/trace-events b/hw/uefi/trace-events new file mode 100644 index 00

[PATCH v4 18/24] hw/uefi: add uefi-vars-sysbus device

2025-02-18 Thread Gerd Hoffmann
This adds sysbus bindings for the variable service. Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-sysbus.c | 91 hw/uefi/meson.build | 3 +- 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 hw/uefi/var-service-sysbus.c di

[PATCH v4 07/24] hw/uefi: add var-service-vars.c

2025-02-18 Thread Gerd Hoffmann
This is the uefi variable service (EfiSmmVariableProtocol), providing functions for listing, reading and updating variables. Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-vars.c | 725 + 1 file changed, 725 insertions(+) create mode 100644 hw/uefi/var-

[PATCH v4 24/24] docs: add uefi variable service documentation

2025-02-18 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- docs/devel/index-internals.rst | 1 + docs/devel/uefi-vars.rst | 68 ++ hw/uefi/LIMITATIONS.md | 7 3 files changed, 76 insertions(+) create mode 100644 docs/devel/uefi-vars.rst create mode 100644 hw/uefi/LIMI

[PATCH v4 08/24] hw/uefi: add var-service-auth.c

2025-02-18 Thread Gerd Hoffmann
This implements authenticated variable handling (see AuthVariableLib in edk2). The by far most common use case for auth variables is secure boot. The secure boot certificate databases ('PK', 'KEK', 'db' and 'dbx') are authenticated variables, with update rules being specified in the UEFI specific

[PATCH v4 09/24] hw/uefi: add var-service-policy.c

2025-02-18 Thread Gerd Hoffmann
Implement variable policies (Edk2VariablePolicyProtocol). This EFI protocol allows to define restrictions for variables. It also allows to lock down variables (disallow write access). Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-policy.c | 370 +++ 1 file

[PATCH v4 11/24] hw/uefi: add var-service-pkcs7.c

2025-02-18 Thread Gerd Hoffmann
This implements pkcs7 signature verification using gnutls. Needed to check authenticated variable updates. Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-pkcs7.c | 436 1 file changed, 436 insertions(+) create mode 100644 hw/uefi/var-service-pkcs7.c d

[PATCH v4 21/24] hw/uefi-vars-sysbus: allow for arm virt

2025-02-18 Thread Gerd Hoffmann
Allow the device being added to aarch64 virt VMs. Signed-off-by: Gerd Hoffmann --- hw/arm/virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 4a5a9666e916..046835836fc5 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -81,6 +81,7 @@ #include "hw/mem

[PATCH v4 05/24] hw/uefi: add var-service-guid.c

2025-02-18 Thread Gerd Hoffmann
Add variables for a bunch of UEFI GUIDs we will need. Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-guid.c | 99 ++ 1 file changed, 99 insertions(+) create mode 100644 hw/uefi/var-service-guid.c diff --git a/hw/uefi/var-service-guid.c b/hw/uefi/var-se

[PATCH v4 02/24] hw/uefi: add include/hw/uefi/var-service-api.h

2025-02-18 Thread Gerd Hoffmann
This file defines the register interface of the uefi-vars device. It's only a handful of registers: magic value, command and status registers, location and size of the communication buffer. Signed-off-by: Gerd Hoffmann Reviewed-by: Laszlo Ersek --- include/hw/uefi/var-service-api.h | 48 +++

[PATCH v4 01/24] Add support for etc/hardware-info fw_cfg file

2025-02-18 Thread Gerd Hoffmann
edk2 looks for the etc/hardware-info fw_cfg file to discover hardware which can not easily be found in other ways. Entries consist of a header with hardware type and entry size (HARDWARE_INFO_HEADER), followed by the actual hardware description (which is type specific). The file can have multiple

[PATCH v4 06/24] hw/uefi: add var-service-utils.c

2025-02-18 Thread Gerd Hoffmann
Add utility functions. Helpers for UEFI (ucs2) string handling. Helpers for readable trace messages. Compare UEFI time stamps. Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-utils.c | 241 1 file changed, 241 insertions(+) create mode 100644 hw/uefi/

[PATCH v4 04/24] hw/uefi: add include/hw/uefi/var-service.h

2025-02-18 Thread Gerd Hoffmann
Add state structs and function declarations for the uefi-vars device. Signed-off-by: Gerd Hoffmann --- include/hw/uefi/var-service.h | 191 ++ 1 file changed, 191 insertions(+) create mode 100644 include/hw/uefi/var-service.h diff --git a/include/hw/uefi/var-ser

[PATCH v4 00/24] hw/uefi: add uefi variable service

2025-02-18 Thread Gerd Hoffmann
This patch adds a virtual device to qemu which the uefi firmware can use to store variables. This moves the UEFI variable management from privileged guest code (managing vars in pflash) to the host. Main advantage is that the need to have privilege separation in the guest goes away. On x86 privi

Re: [PATCH v6 2/4] migration: enable multifd and postcopy together

2025-02-18 Thread Prasad Pandit
On Tue, 18 Feb 2025 at 16:47, Juraj Marcin wrote: > > +error_report("%s: unknown channel magic: %u", > > +__func__, channel_magic); > > Here, the number reported in the error will have incorrect endianness on > a non-BE system. I think it would be be

[PATCH] target/loongarch: Correct maximum physical address in KVM mode

2025-02-18 Thread Bibo Mao
On 3A5000 system, the physical address space width for host is 48, however 47 bit for KVM VM. For KVM VM, size of physical address space is the same with that of virtual user space address. Here modify physical address space width with 47 bit in KVM mode. Signed-off-by: Bibo Mao --- target/loon

Re: [PATCH v4 0/3] Enable clang build on Windows

2025-02-18 Thread Pierrick Bouvier
On 2/18/25 22:39, Stefan Weil wrote: Am 19.02.25 um 00:17 schrieb Pierrick Bouvier: On 2/18/25 12:59, Stefan Weil wrote: I could run a QEMU cross compile on Debian with the llvm toolchain and msys2 clangarm64 packages installed with pacman. The resulting installer is here: Have you install

Re: [PATCH] physmem: replace assertion with error

2025-02-18 Thread Gupta, Pankaj
On 2/17/2025 1:08 PM, Paolo Bonzini wrote: It is possible to start QEMU with a confidential-guest-support object even in TCG mode. While there is already a check in qemu_machine_creation_done: if (machine->cgs && !machine->cgs->ready) { error_setg(errp, "accelerator does not suppo

Re: [PATCH v4 0/3] Enable clang build on Windows

2025-02-18 Thread Stefan Weil via
Am 19.02.25 um 00:17 schrieb Pierrick Bouvier: On 2/18/25 12:59, Stefan Weil wrote: I could run a QEMU cross compile on Debian with the llvm toolchain and msys2 clangarm64 packages installed with pacman. The resulting installer is here: Have you installed the msys2 clangarm64 packages on a

Re: [PATCH v2 3/6] memory-attribute-manager: Introduce MemoryAttributeManager to manage RAMBLock with guest_memfd

2025-02-18 Thread Chenyi Qiang
On 2/19/2025 11:49 AM, Alexey Kardashevskiy wrote: > > > On 19/2/25 12:20, Chenyi Qiang wrote: >> >> >> On 2/18/2025 5:19 PM, Alexey Kardashevskiy wrote: >>> >>> >> >> [..] >> diff --git a/include/system/memory-attribute-manager.h b/include/ system/memory-attribute-manager.h new

Re: [PATCH v2 09/11] rust/block: Add read support for block drivers

2025-02-18 Thread Paolo Bonzini
On 2/18/25 19:20, Kevin Wolf wrote: +/// The described blocks are stored in a child node. +Data { +/// Child node in which the data is stored +node: Arc, Having Arc<> here shouldn't be necessary, since the BdrvChild is already reference counted. Since the code is calle

Re: [PATCH v2 05/11] rust/block: Add empty crate

2025-02-18 Thread Zhao Liu
> diff --git a/rust/block/Cargo.toml b/rust/block/Cargo.toml > new file mode 100644 > index 00..fbc2f2d6ef > --- /dev/null > +++ b/rust/block/Cargo.toml > @@ -0,0 +1,16 @@ > +[package] > +name = "block" > +version = "0.1.0" > +edition = "2021" > +authors = ["Kevin Wolf "] > +license = "GPL-

Re: [PATCH v2 00/19] intel_iommu: Add ATS support

2025-02-18 Thread CLEMENT MATHIEU--DRIF
Kindly ping Thanks everyone >cmd On 20/01/2025 18:41, CLEMENT MATHIEU--DRIF wrote: > From: Clement Mathieu--Drif > > This patch set belongs to a list of series that add SVM support for VT-d. > > Here we focus on implementing ATS support in the IOMMU and adding a > PCI-level API to be used by v

Re: [PATCH] hw/timer/hpet: Detect invalid access to TN registers

2025-02-18 Thread Zhao Liu
On Tue, Feb 18, 2025 at 09:53:00AM +0100, Paolo Bonzini wrote: > Date: Tue, 18 Feb 2025 09:53:00 +0100 > From: Paolo Bonzini > Subject: Re: [PATCH] hw/timer/hpet: Detect invalid access to TN registers > > On 2/18/25 08:37, Zhao Liu wrote: > > "addr & 0x18" ignores invalid address, so that the tra

Re: [PATCH 2/2] [NOT-FOR-MERGE] Add qtest for migration over RDMA

2025-02-18 Thread Zhijian Li (Fujitsu)
On 19/02/2025 06:40, Peter Xu wrote: > On Tue, Feb 18, 2025 at 06:03:48PM -0300, Fabiano Rosas wrote: >> Li Zhijian via writes: >> >>> This qtest requirs there is RXE link in the host. >>> >>> Here is an example to show how to add this RXE link: >>> $ ./new-rdma-link.sh >>> 192.168.22.93 >>> >>>

Re: [PATCH v2 3/6] memory-attribute-manager: Introduce MemoryAttributeManager to manage RAMBLock with guest_memfd

2025-02-18 Thread Alexey Kardashevskiy
On 19/2/25 12:20, Chenyi Qiang wrote: On 2/18/2025 5:19 PM, Alexey Kardashevskiy wrote: [..] diff --git a/include/system/memory-attribute-manager.h b/include/ system/memory-attribute-manager.h new file mode 100644 index 00..72adc0028e --- /dev/null +++ b/include/system/memory-

Re: [PATCH] hw/timer/hpet: Detect invalid access to TN registers

2025-02-18 Thread Zhao Liu
On Tue, Feb 18, 2025 at 10:07:18AM +0100, Philippe Mathieu-Daudé wrote: > Date: Tue, 18 Feb 2025 10:07:18 +0100 > From: Philippe Mathieu-Daudé > Subject: Re: [PATCH] hw/timer/hpet: Detect invalid access to TN registers > > On 18/2/25 09:53, Paolo Bonzini wrote: > > On 2/18/25 08:37, Zhao Liu wrot

[PATCH] hw/elf_ops: Use physical address about kernel entry

2025-02-18 Thread Bibo Mao
With load_elf() API, if input parameter translate_fn is set, loading address is converted to physical address. It should be the same for entry address, since MMU is disabled when system power on, the first instruction of PC should be physical address. Signed-off-by: Bibo Mao --- include/hw/elf_o

Re: [PULL v2 00/14] Mem next patches

2025-02-18 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL v3 00/28] tcg patch queue

2025-02-18 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes. signature.asc Description: PGP signature

[PATCH v2] vhost: Don't set vring call if guest notifier is disabled

2025-02-18 Thread oenhan
From: Huaitong Han The vring call fd is set even when the guest does not use MSIX (e.g., virtio PMD). This results in unnecessary CPU overhead for handling virtio interrupts. The previous patch only optimized the condition when query_queue_notifier was enabled and the vector was unset. However, i

Re: [PATCH v2 4/6] memory-attribute-manager: Introduce a callback to notify the shared/private state change

2025-02-18 Thread Chenyi Qiang
On 2/18/2025 5:19 PM, Alexey Kardashevskiy wrote: > > > On 17/2/25 19:18, Chenyi Qiang wrote: >> Introduce a new state_change() callback in MemoryAttributeManagerClass to >> efficiently notify all registered RamDiscardListeners, including VFIO >> listeners about the memory conversion events in

Re: [PATCH] aspeed: Remove duplicate typename in AspeedSoCClass

2025-02-18 Thread Andrew Jeffery
On Tue, 2025-02-18 at 08:35 +0100, Cédric Le Goater wrote: > The SoC type name is stored under AspeedSoCClass which is > redundant. Use object_get_typename() instead where needed. > > Signed-off-by: Cédric Le Goater Reviewed-by: Andrew Jeffery

Re: [RFC] migration: Introduce migration throttle event

2025-02-18 Thread Yong Huang
On Wed, Feb 19, 2025 at 4:24 AM Markus Armbruster wrote: > Peter Xu writes: > > > On Tue, Feb 18, 2025 at 10:39:55AM +0800, yong.hu...@smartx.com wrote: > >> From: Hyman Huang > >> > >> When the developer is examining the time distribution of > >> the migration, it is useful to record the migra

Re: [PATCH v2 3/6] memory-attribute-manager: Introduce MemoryAttributeManager to manage RAMBLock with guest_memfd

2025-02-18 Thread Chenyi Qiang
On 2/18/2025 5:19 PM, Alexey Kardashevskiy wrote: > > [..] >> diff --git a/include/system/memory-attribute-manager.h b/include/ >> system/memory-attribute-manager.h >> new file mode 100644 >> index 00..72adc0028e >> --- /dev/null >> +++ b/include/system/memory-attribute-manager.h >>

Re: [PATCH] vdpa: Allow vDPA to work on big-endian machine

2025-02-18 Thread Jason Wang
On Tue, Feb 18, 2025 at 10:03 PM Philippe Mathieu-Daudé wrote: > > Hi Konstantin, > > (Cc'ing more developers) > > On 18/2/25 14:27, Konstantin Shkolnyy wrote: > > On 2/12/2025 14:01, Konstantin Shkolnyy wrote: > >> On 2/12/2025 12:07, Philippe Mathieu-Daudé wrote: > >>> On 12/2/25 18:24, Konstant

Re: [PATCH v4 0/3] Enable clang build on Windows

2025-02-18 Thread Pierrick Bouvier
On 2/18/25 12:59, Stefan Weil wrote: Am 18.02.25 um 17:22 schrieb Pierrick Bouvier: On 2/17/25 20:11, Brian Cain wrote: Is this toolchain available publicly or did you build it yourself?  It would be handy if there were a linux x86_64 hosted cross-toolchain that can target Windows-aarch64.  Or

Re: [PATCH 29/42] qapi: Add "Details:" disambiguation marker

2025-02-18 Thread John Snow
On Mon, Feb 17, 2025 at 7:13 AM Markus Armbruster wrote: > John Snow writes: > > > This clarifies sections that are mistaken by the parser as "intro" > > sections to be "details" sections instead. > > > > Signed-off-by: John Snow > > This is rather terse. > Mea culpa. I can write more at lengt

Trying to boot VM from powershell Windows 11

2025-02-18 Thread Trace Oliver
Hi guys! My name is Trace Oliver and I just downloaded qemu using the 64-bit Stefan Weil link on the qemu.org website but, when I try to do the command "qemu-system-x86_64.exe -boot d -cdrom .\ubuntu-24.04.1-desktop-amd64.iso -m 2048", qemu pops up but, it gives me this error message "Guest has not

Re: [PATCH 2/2] [NOT-FOR-MERGE] Add qtest for migration over RDMA

2025-02-18 Thread Peter Xu
On Tue, Feb 18, 2025 at 06:03:48PM -0300, Fabiano Rosas wrote: > Li Zhijian via writes: > > > This qtest requirs there is RXE link in the host. > > > > Here is an example to show how to add this RXE link: > > $ ./new-rdma-link.sh > > 192.168.22.93 > > > > Signed-off-by: Li Zhijian > > --- > > Th

Re: [PATCH 29/42] qapi: Add "Details:" disambiguation marker

2025-02-18 Thread John Snow
On Mon, Feb 17, 2025 at 5:51 AM Markus Armbruster wrote: > John Snow writes: > > > This clarifies sections that are mistaken by the parser as "intro" > > sections to be "details" sections instead. > > > > Signed-off-by: John Snow > > Is this missing announce-self in net.json? > > diff --git a/q

Re: [PATCH 29/42] qapi: Add "Details:" disambiguation marker

2025-02-18 Thread John Snow
On Wed, Feb 12, 2025 at 4:37 AM Markus Armbruster wrote: > John Snow writes: > > > This clarifies sections that are mistaken by the parser as "intro" > > sections to be "details" sections instead. > > Impact on output? See notes inline. > It's very possible that there is none; in cases where t

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

2025-02-18 Thread Peter Xu
On Tue, Feb 18, 2025 at 07:25:30PM +0100, Eric Auger wrote: > With current reset scheme, DMA capable devices are reset after > the vIOMMU which translate them. This holds for the different > IOMMUs and various DMA capable devices such as virtio devices > and VFIO ones. With virtio devices, spurious

Re: [PATCH 29/42] qapi: Add "Details:" disambiguation marker

2025-02-18 Thread John Snow
On Mon, Feb 17, 2025 at 6:55 AM Markus Armbruster wrote: > John Snow writes: > > > This clarifies sections that are mistaken by the parser as "intro" > > sections to be "details" sections instead. > > > > Signed-off-by: John Snow > > --- > > qapi/machine.json | 2 ++ > > qapi/migration.js

[PATCH] target/arm: Fix signed integer overflow undefined behavior.

2025-02-18 Thread Stephen Longfield
The problem is internal to t32_expandimm_imm, the imm intermediate immediate value. This value is sourced from x, which always comes from the return of a deposit32 call, which returns uint32_t already. It's extracted via: int imm = extract32(x, 0, 8);, so the value will be between 0-255 It is the

Re: [PULL v2 11/14] os: add an ability to lock memory on_fault

2025-02-18 Thread Peter Xu
On Tue, Feb 18, 2025 at 04:36:31PM +, Daniel P. Berrangé wrote: > Yes, or actually turn on the warning about unused params and mark > the rest. It is initially noisey, but IME does end up flagging > real problems periodically. Anyway, given we're inconsistent already > there's no need to respin

Re: [PATCH 1/2] migration: Prioritize RDMA in ram_save_target_page()

2025-02-18 Thread Peter Xu
On Tue, Feb 18, 2025 at 05:30:40PM -0300, Fabiano Rosas wrote: > Li Zhijian via writes: > > > Address an error in RDMA-based migration by ensuring RDMA is prioritized > > when saving pages in `ram_save_target_page()`. > > > > Previously, the RDMA protocol's page-saving step was placed after other

Re: [PATCH 28/42] qapi/parser: prohibit untagged sections between tagged sections

2025-02-18 Thread John Snow
On Wed, Feb 12, 2025 at 4:06 AM Markus Armbruster wrote: > John Snow writes: > > > This is being done primarily to ensure consistency between the source > > documents and the final, rendered HTML output. Because > > member/feature/returns sections will always appear in a visually grouped > > ele

[PATCH 1/4] target/rx: Set exception vector base to 0xffffff80

2025-02-18 Thread Keith Packard via
The documentation says the vector is at 0xff80, instead of the previous value of 0xffc0. That value must have been a bug because the standard vector values (20, 21, 23, 25, 30) were all past the end of the array. Signed-off-by: Keith Packard --- target/rx/helper.c | 2 +- 1 file changed,

[PATCH 4/4] rx: Support loading of ELF files too

2025-02-18 Thread Keith Packard via
The existing loader supports raw binary blobs with the entry point defined as the start of the blob. Add support for loading ELF files by first checking if the provided filename has a valid ELF header, falling back to the existing loader code when that fails. Signed-off-by: Keith Packard --- hw/

[PATCH 0/4] Renesas RX target fixes (v2)

2025-02-18 Thread Keith Packard via
With feedback from Peter Maydell and Richard Henderson, I've updated this series to address two concerns: 1. The hardware model is now responsible for guiding the CPU reset process. 2. Loading the reset vector from memory is now delayed until cpu_reset is finished to ensure memory_dispa

[PATCH 2/4] target/rx: Remove TCG_CALL_NO_WG from helpers which write env

2025-02-18 Thread Keith Packard via
Functions which modify virtual machine state (such as virtual registers stored in memory) must not be marked TCG_CALL_NO_WG as that tells the optimizer that virtual registers values already loaded in machine registers are still valid, hence discards any changes which these helpers may have made. Th

[PATCH 3/4] hw/rx: Reset the CPU at qemu reset time

2025-02-18 Thread Keith Packard via
This ensure that the CPU gets reset every time QEMU resets. Use either the kernel entry point or the reset vector if no kernel was loaded. Signed-off-by: Keith Packard --- hw/rx/rx-gdbsim.c | 36 +++- target/rx/cpu.c | 9 ++--- target/rx/cpu.h | 3 +++ 3

Re: [PATCH 2/2] [NOT-FOR-MERGE] Add qtest for migration over RDMA

2025-02-18 Thread Fabiano Rosas
Li Zhijian via writes: > This qtest requirs there is RXE link in the host. > > Here is an example to show how to add this RXE link: > $ ./new-rdma-link.sh > 192.168.22.93 > > Signed-off-by: Li Zhijian > --- > The RDMA migration was broken again...due to lack of sufficient test/qtest. > > It's ur

Re: [PATCH v4 0/3] Enable clang build on Windows

2025-02-18 Thread Stefan Weil via
Am 18.02.25 um 17:22 schrieb Pierrick Bouvier: On 2/17/25 20:11, Brian Cain wrote: Is this toolchain available publicly or did you build it yourself?  It would be handy if there were a linux x86_64 hosted cross-toolchain that can target Windows-aarch64.  Or linux aarch64 hosted would be pretty g

Re: [PATCH 27/42] qapi: differentiate "intro" and "detail" sections

2025-02-18 Thread John Snow
On Tue, Feb 11, 2025 at 10:00 AM Markus Armbruster wrote: > John Snow writes: > > > This patch begins distinguishing "Plain" sections as being either > > "Intro" or "Details" sections for the purpose of knowing when and where > > to inline those sections. > > > > Signed-off-by: John Snow > > [.

Re: [PATCH 1/2] migration: Prioritize RDMA in ram_save_target_page()

2025-02-18 Thread Fabiano Rosas
Li Zhijian via writes: > Address an error in RDMA-based migration by ensuring RDMA is prioritized > when saving pages in `ram_save_target_page()`. > > Previously, the RDMA protocol's page-saving step was placed after other > protocols due to a refactoring in commit bc38dc2f5f3. This led to migrat

Re: [PATCH 4/5] target/rx: Load reset vector from memory after first run

2025-02-18 Thread Keith Packard via
> > By delaying the load of the reset vector to the reset_exit phase, > > you can always load from rom. > I'm not sure how -- the ROM image is discarded when it gets loaded into > read-only memory. If loaded to read-write memory, I bet it would > stay around. Ah, but by delaying until after cpu_

Re: [RFC] migration: Introduce migration throttle event

2025-02-18 Thread Markus Armbruster
Peter Xu writes: > On Tue, Feb 18, 2025 at 10:39:55AM +0800, yong.hu...@smartx.com wrote: >> From: Hyman Huang >> >> When the developer is examining the time distribution of >> the migration, it is useful to record the migration throttle >> timestamp. Consequently, include the migration throttl

Re: [PATCH 4/5] target/rx: Load reset vector from memory after first run

2025-02-18 Thread Keith Packard via
> So I'm OK with this patch doing this the way it does, > except that I have one question: what's that > process_queued_cpu_work() call doing? We don't need > that on the Arm equivalent... Yup, I needed that because I was running this bit at cpu_reset_hold time, not waiting until after cpu reset

Re: [PATCH 4/5] target/rx: Load reset vector from memory after first run

2025-02-18 Thread Keith Packard via
From: Richard Henderson Date: Sat, 15 Feb 2025 10:24:05 -0800 > By delaying the load of the reset vector to the reset_exit phase, > you can always load from rom. I'm not sure how -- the ROM image is discarded when it gets loaded into read-only memory. If loaded to read-write memory, I bet it wou

Re: [PATCH 3/5] target/rx: Reset the CPU at qemu reset time

2025-02-18 Thread Keith Packard via
From: Peter Maydell Date: Mon, 17 Feb 2025 09:53:58 + > Reset of devices not plugged into buses (of which CPUs > are the most common kind) is a mess. But having them > call qemu_register_reset() themselves in their own > realize method isn't the usual workaround. Instead we > get the board co

Re: [PATCH 00/42] docs: add sphinx-domain rST generator to qapidoc

2025-02-18 Thread John Snow
"The text handler you add looks just like the existing latex handler. Does LaTeX output lack "little headings", too?" Yes, almost certainly. Can you let me know which output formats we actually "care about"? I'll have to test them all. In the meantime, I upgraded my patch so that the text translat

Re: [PATCH v9 0/3] TPM TIS SPI Support

2025-02-18 Thread Stefan Berger
On 2/17/25 3:24 PM, dan tan wrote: Stefan, I have yet found a ppc64le Linux distro that has SPI enabled in the kernel. Attempts to build my own was not successful either. I am trying to get the LTC (Linux Technology Center) involved. They have more expertise in building the ppc64le kernel.

Re: [PULL 3/9] meson: Disallow 64-bit on 32-bit Xen emulation

2025-02-18 Thread Stefano Stabellini
On Tue, 18 Feb 2025, Andrew Cooper wrote: > On 18/02/2025 11:20 am, Philippe Mathieu-Daudé wrote: > > Hi, > > > > Adding Xen community. > > > > On 8/2/25 21:57, Richard Henderson wrote: > >> Require a 64-bit host binary to spawn a 64-bit guest. > >> > >> Reviewed-by: Thomas Huth > >> Reviewed-by:

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

2025-02-18 Thread Nicolin Chen
On Tue, Feb 18, 2025 at 11:02:40AM -0800, Matthew R. Ochs wrote: > +static void virt_get_highmem_mmio_size(Object *obj, Visitor *v, const char > *name, > + void *opaque, Error **errp) Just some coding style nit: static void virt_get_highmem_mmio_size(Object *obj, Visitor

Re: [PATCH v7 05/52] i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIES

2025-02-18 Thread Francesco Lavra
On Fri, 24 Jan 2025 08:20:01 -0500, Xiaoyao Li wrote: > diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c > index 4ff94860815d..bd212abab865 100644 > --- a/target/i386/kvm/tdx.c > +++ b/target/i386/kvm/tdx.c > @@ -10,17 +10,122 @@ > */ > > #include "qemu/osdep.h" > +#include "qemu/err

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

2025-02-18 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 v3 2/2] KVM: SEV: Configure "ALLOWED_SEV_FEATURES" VMCB Field

2025-02-18 Thread Sean Christopherson
On Mon, Feb 17, 2025, Naveen N Rao wrote: > On Thu, Feb 13, 2025 at 04:55:13PM -0800, Sean Christopherson wrote: > > On Thu, Feb 13, 2025, Kim Phillips wrote: > > > On 2/11/25 3:46 PM, Sean Christopherson wrote: > > > > On Mon, Feb 10, 2025, Tom Lendacky wrote: > > > > > On 2/7/25 17:34, Kim Philli

[PATCH v2 08/11] rust/block: Add driver module

2025-02-18 Thread Kevin Wolf
This adds a barebones module for a block driver interface. Because there is no native QAPI support for Rust yet, opening images takes a few unsafe functions to call into C visitor functions. This should be cleaned up later. Signed-off-by: Kevin Wolf --- rust/block/src/driver.rs | 195 +++

[PATCH v3 3/5] hw/arm/smmuv3: Move reset to exit phase

2025-02-18 Thread Eric Auger
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. This happens because outstanding DMA requests are still happe

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

2025-02-18 Thread Eric Auger
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 Acked-by: Michael S. Tsirkin Reviewed-by: Zhenzhong Duan --- hw/vfio/common.c | 1 + hw/vfio/trace-events | 1 + 2 files changed, 2 insertions(+) d

[PATCH v3 2/5] hw/i386/intel-iommu: Migrate to 3-phase reset

2025-02-18 Thread Eric Auger
Currently the IOMMU may be reset before the devices it protects. For example this happens with virtio devices but also with VFIO devices. In this latter case this produces spurious translation faults on host. Let's use 3-phase reset mechanism and reset the IOMMU on exit phase after all DMA capable

[PATCH v3 5/5] docs/devel/reset: Document reset expectations for DMA and IOMMU

2025-02-18 Thread Eric Auger
To avoid any translation faults, the IOMMUs are expected to be reset after the devices they protect. Document that we expect DMA requests to be stopped during the 'enter' or 'hold' phase while IOMMUs should be reset during the 'exit' phase. Signed-off-by: Eric Auger Reviewed-by: Zhenzhong Duan -

[PATCH v3 0/5] Fix vIOMMU reset order

2025-02-18 Thread Eric Auger
With current reset scheme, DMA capable devices are reset after the vIOMMU which translate them. This holds for the different IOMMUs and various DMA capable devices such as virtio devices and VFIO ones. With virtio devices, spurious traces can be observed at qemu level such as "virtio: zero sized bu

[PATCH v3 1/5] hw/virtio/virtio-iommu: Migrate to 3-phase reset

2025-02-18 Thread Eric Auger
Currently the iommu may be reset before the devices it protects. For example this happens with virtio-net. Let's use 3-phase reset mechanism and reset the IOMMU on exit phase after all DMA capable devices have been reset during the 'enter' or 'hold' phase. Signed-off-by: Eric Auger Acked-by: Mic

[PATCH v2 10/11] bochs-rs: Add bochs block driver reimplementation in Rust

2025-02-18 Thread Kevin Wolf
This adds a separate block driver for the bochs image format called 'bochs-rs' so that for the moment both the C implementation and the Rust implementation can be present in the same build. The intention is to remove the C implementation eventually and rename this one into 'bochs'. This can only ha

[PATCH v2 07/11] block: Add bdrv_open_blockdev_ref_file()

2025-02-18 Thread Kevin Wolf
This is the equivalent of bdrv_open_file_child() to be used in cases where the caller is QAPI based and has a BlockdevRef rather than a filename and an options QDict. Signed-off-by: Kevin Wolf --- include/block/block-global-state.h | 4 block.c| 31 +

[PATCH v2 04/11] rust/qemu-api: Add wrappers to run futures in QEMU

2025-02-18 Thread Kevin Wolf
This adds helper functions that allow running Rust futures to completion using QEMU's event loops. Signed-off-by: Kevin Wolf --- include/qemu/coroutine-rust.h | 24 +++ rust/wrapper.h| 1 + util/qemu-co-rust-async.c | 55 + rust/qemu-api/meson

[PATCH v2 09/11] rust/block: Add read support for block drivers

2025-02-18 Thread Kevin Wolf
This adds a map() function to the BlockDriver trait and makes use of it to implement reading from an image. Signed-off-by: Kevin Wolf --- rust/block/src/driver.rs | 95 1 file changed, 95 insertions(+) diff --git a/rust/block/src/driver.rs b/rust/block/s

[PATCH v2 11/11] rust/block: Add format probing

2025-02-18 Thread Kevin Wolf
This adds format probing both to the BlockDriver trait and the bochs-rs block driver. With this, bochs-rs achieves feature parity with its C counterpart. Its probe function returns a higher priority so that it is preferred when both drivers are available. Signed-off-by: Kevin Wolf --- rust/block

[PATCH v2 05/11] rust/block: Add empty crate

2025-02-18 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- MAINTAINERS| 1 + rust/Cargo.lock| 8 rust/Cargo.toml| 1 + rust/block/Cargo.toml | 16 rust/block/README.md | 3 +++ rust/block/meson.build | 20 rust/block/src/lib.rs | 1 + rust/me

[PATCH v2 03/11] rust: Add some block layer bindings

2025-02-18 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- rust/wrapper.h| 4 rust/qemu-api/src/zeroable.rs | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rust/wrapper.h b/rust/wrapper.h index f203fd13ac..303d7bba7f 100644 --- a/rust/wrapper.h +++ b/rust/wrapper.h @@ -54,3 +54,

[PATCH v2 00/11] rust/block: Add minimal block driver bindings

2025-02-18 Thread Kevin Wolf
This series adds minimal bindings for writing block drivers in Rust and converts the bochs block driver as an example. Some parts (such as the open functions) are still essentially C written in Rust syntax, while other parts already try to provide somewhat idiomatic abstractions. The main purpose

[PATCH v2 06/11] rust/block: Add I/O buffer traits

2025-02-18 Thread Kevin Wolf
Types that implement IoBuffer can be used with safe I/O functions. Signed-off-by: Kevin Wolf --- rust/block/src/iobuffer.rs | 94 ++ rust/block/src/lib.rs | 2 + 2 files changed, 96 insertions(+) create mode 100644 rust/block/src/iobuffer.rs diff --git

[PATCH v2 02/11] meson: Add rust_block_ss and link tools with it

2025-02-18 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- meson.build| 36 storage-daemon/meson.build | 2 +- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 6ee1757828..a08d029032 100644 --- a/meson.build +++ b/meson.build

[PATCH v2 01/11] rust: Build separate qemu_api_tools and qemu_api_system

2025-02-18 Thread Kevin Wolf
The existing qemu_api library can't be linked into tools because it contains a few bindings for things that only exist in the system emulator. This adds a new "system" feature to the qemu_api crate that enables the system emulator parts in it, and build the crate twice: qemu_api_tools is the core

  1   2   3   >