Re: [PATCH v1 1/4] physmem: disallow direct access to RAM DEVICE in address_space_write_rom()

2025-01-22 Thread David Hildenbrand
On 22.01.25 11:10, David Hildenbrand wrote: On 22.01.25 11:07, Philippe Mathieu-Daudé wrote: Hi David, On 20/1/25 12:14, David Hildenbrand wrote: As documented in commit 4a2e242bbb306 ("memory: Don't use memcpy for ram_device regions"), we disallow direct access to RAM DEVICE regions. Let's f

Re: [PATCH v1 1/4] physmem: disallow direct access to RAM DEVICE in address_space_write_rom()

2025-01-22 Thread David Hildenbrand
On 22.01.25 11:18, David Hildenbrand wrote: On 22.01.25 11:17, Philippe Mathieu-Daudé wrote: On 22/1/25 11:13, David Hildenbrand wrote: On 22.01.25 11:10, David Hildenbrand wrote: On 22.01.25 11:07, Philippe Mathieu-Daudé wrote: Hi David, On 20/1/25 12:14, David Hildenbrand wrote: As docume

[PATCH] target/i386: extract common bits of gen_repz/gen_repz_nz

2025-01-22 Thread Paolo Bonzini
Now that everything has been cleaned up, look at DF and prefixes in a single function, and call that one from gen_repz and gen_repz_nz. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 34 ++ 1 file changed, 14 insertions(+), 20 deletions(-) diff --

[PATCH] target/i386: extract common bits of gen_repz/gen_repz_nz

2025-01-22 Thread Paolo Bonzini
Now that everything has been cleaned up, look at DF and prefixes in a single function, and call that one from gen_repz and gen_repz_nz. Based-on: <20241215090613.89588-1-pbonz...@redhat.com> Suggested-by: Richard Henderson Signed-off-by: Paolo Bonzini --- This was requested in the review

[PATCH v2 02/10] gdbstub: Clarify no more than @gdb_num_core_regs can be accessed

2025-01-22 Thread Philippe Mathieu-Daudé
Both CPUClass::gdb_read_register() and CPUClass::gdb_write_register() handlers are called from common gdbstub code, and won't be called with register index over CPUClass::gdb_num_core_regs: int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) { CPUClass *cc = CPU_GET_CLASS(cpu)

[PATCH v2 08/10] gdbstub: Prefer cached CpuClass over CPU_GET_CLASS() macro

2025-01-22 Thread Philippe Mathieu-Daudé
CpuState caches its CPUClass since commit 6fbdff87062 ("cpu: cache CPUClass in CPUState for hot code paths"), use it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- gdbstub/gdbstub.c | 26 +- gdbstub/system.c | 7 ++- gdbstub/user-

[PATCH v2 00/10] cpus: Prefer cached CpuClass over CPU_GET_CLASS() macro

2025-01-22 Thread Philippe Mathieu-Daudé
Missing review: 1 & 2 v1 cover: Use cached CPUState::cc to get CPUClass. Main rationale is overall code style. Philippe Mathieu-Daudé (10): hw/core/generic-loader: Do not open-code cpu_set_pc() gdbstub: Clarify no more than @gdb_num_core_regs can be accessed cpus: Cache CPUClass early in in

Re: [PATCH 10/10] rust: vmstate: make order of parameters consistent in vmstate_clock

2025-01-22 Thread Philippe Mathieu-Daudé
On 17/1/25 10:00, Paolo Bonzini wrote: Place struct_name before field_name, similar to offset_of. Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device_class.rs | 2 +- rust/qemu-api/src/vmstate.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Ph

Re: [PATCH] hw/boards: Convert MachineClass bitfields to boolean

2025-01-22 Thread Daniel P . Berrangé
On Wed, Jan 22, 2025 at 11:32:23AM +0100, Philippe Mathieu-Daudé wrote: > As Daniel mentioned: > > "The number of instances of MachineClass is not large enough > that we save a useful amount of memory through bitfields." > > Also, see recent commit ecbf3567e21 ("docs/devel/style: add a > secti

Re: [PATCH v7 2/4] chardev/char-hub: implement backend chardev aggregator

2025-01-22 Thread Alex Bennée
Roman Penyaev writes: > This patch implements a new chardev backend `hub` device, which > aggregates input from multiple backend devices and forwards it to a > single frontend device. Additionally, `hub` device takes the output > from the frontend device and sends it back to all the connected > b

Re: [PATCH v3 2/3] scripts: validate SPDX license choices

2025-01-22 Thread Peter Maydell
On Fri, 17 Jan 2025 at 12:42, Daniel P. Berrangé wrote: > > We expect all new code to be contributed with the "GPL-2.0-or-later" > license tag. Divergence is permitted if the new file is derived from > pre-existing code under a different license, whether from elsewhere > in QEMU codebase, or outsi

Re: [PATCH v3 17/26] hw/arm/virt: Reserve one bit of guest-physical address for RME

2025-01-22 Thread Jean-Philippe Brucker
Hi Gavin, On Fri, Dec 13, 2024 at 10:03:08PM +1000, Gavin Shan wrote: > Hi Jean, > > On 11/26/24 5:56 AM, Jean-Philippe Brucker wrote: > > When RME is enabled, the upper GPA bit is used to distinguish protected > > from unprotected addresses. Reserve it when setting up the guest memory > > map. >

Re: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset

2025-01-22 Thread Paolo Bonzini
On 1/22/25 15:34, Zhao Liu wrote: On Fri, Jan 17, 2025 at 10:26:50AM +0100, Paolo Bonzini wrote: Date: Fri, 17 Jan 2025 10:26:50 +0100 From: Paolo Bonzini Subject: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset X-Mailer: git-send-email 2.47.1 As an added bonus, this also makes

Re: [PATCH 04/10] rust: pl011: extract CharBackend receive logic into a separate function

2025-01-22 Thread Paolo Bonzini
On 1/22/25 15:59, Zhao Liu wrote: if size > 0 { debug_assert!(!buf.is_null()); -state.as_mut().put_fifo(c_uint::from(buf.read_volatile())) An extra question...here I'm not sure, do we really need read_volatile? No, the buffer is not guest visible. It will

Re: [PATCH v2 4/5] hw/arm: enable secure EL2 timers for virt machine

2025-01-22 Thread Alex Bennée
Peter Maydell writes: > On Wed, 18 Dec 2024 at 18:15, Alex Bennée wrote: >> >> Signed-off-by: Alex Bennée >> Cc: qemu-sta...@nongnu.org >> --- >> hw/arm/virt.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/hw/arm/virt.c b/hw/arm/virt.c >> index 333eaf67ea..5e3589dc6a 100644 >>

Re: [PATCH 03/10] rust: vmstate: add varray support to vmstate_of!

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:00:39AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:00:39 +0100 > From: Paolo Bonzini > Subject: [PATCH 03/10] rust: vmstate: add varray support to vmstate_of! > X-Mailer: git-send-email 2.47.1 > > Signed-off-by: Paolo Bonzini > --- > rust/qemu-api/src/vms

Re: [PATCH 2/2] docs/cpu-features: Update "PAuth" (Pointer Authentication) details

2025-01-22 Thread Kashyap Chamarthy
On Sat, Jan 18, 2025 at 10:04:37AM +, Marc Zyngier wrote: > On Fri, 17 Jan 2025 19:11:06 +, > Kashyap Chamarthy wrote: > > > > PAuth (Pointer Authentication), a security feature in software, is > > relevant for both KVM and QEMU. Relect this fact into the docs: > > > > - For KVM, `pau

Re: [PATCH 02/10] rust: pl011: hide unnecessarily "pub" items from outside pl011::device

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:49AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:49 +0100 > From: Paolo Bonzini > Subject: [PATCH 02/10] rust: pl011: hide unnecessarily "pub" items from > outside pl011::device > X-Mailer: git-send-email 2.47.1 > > The only public interfaces for pl01

Re: [PATCH 01/10] rust: pl011: remove unnecessary "extern crate"

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:48AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:48 +0100 > From: Paolo Bonzini > Subject: [PATCH 01/10] rust: pl011: remove unnecessary "extern crate" > X-Mailer: git-send-email 2.47.1 > > Signed-off-by: Paolo Bonzini > --- > rust/hw/char/pl011/src/

Re: [PATCH v3 4/4] tests/qtest/migration: add postcopy test with multifd

2025-01-22 Thread Peter Xu
On Wed, Jan 22, 2025 at 01:26:21PM +0530, Prasad Pandit wrote: > Hi, > On Tue, 21 Jan 2025 at 21:17, Peter Xu wrote: > > https://lore.kernel.org/qemu-devel/ZykJBq7ME5jgSzCA@x1n/ > > Would you please add all the tests mentioned there? > > /x86_64/migration/multifd/file/mapped-ram/ > /x86_6

Re: [PATCH 9/9] aspeed: Create sd devices only when defaults are enabled

2025-01-22 Thread Philippe Mathieu-Daudé
On 22/1/25 08:09, Cédric Le Goater wrote: When the -nodefaults option is set, sd devices should not be automatically created by the machine. Instead they should be defined on the command line. Note that it is not currently possible to define which bus an "sd-card" device is attached to: -blo

[PATCH 8/9] iotests: Add filter_qtest()

2025-01-22 Thread Kevin Wolf
The open-coded form of this filter has been copied into enough tests that it's better to move it into iotests.py. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 4 tests/qemu-iotests/041| 4 +--- tests/qemu-iotests/165

[PATCH v4] hw/i386/cpu: remove default_cpu_version and simplify

2025-01-22 Thread Ani Sinha
commit 0788a56bd1ae3 ("i386: Make unversioned CPU models be aliases") introduced 'default_cpu_version' for PCMachineClass. This created three categories of CPU models: - Most unversioned CPU models would use version 1 by default. - For machines 4.0.1 and older that do not support cpu model aliase

[PATCH v2 0/2] tests/functional: Fix broken decorators

2025-01-22 Thread Thomas Huth
Many of the new decorators of the functional tests don't work as expected (and simply always allow to run the tests). Let's fix them! v2: - Use importlib.import_module() to check whether we can import a module - Split the import check into a separate patch Thomas Huth (2): tests/functional/qemu

[PATCH v2 2/2] tests/functional: Fix broken decorators with lamda functions

2025-01-22 Thread Thomas Huth
The decorators that use a lambda function are currently broken and do not properly skip the test if the condition is not met. Using "return skipUnless(lambda: ...)" does not work as expected. To fix it, rewrite the decorators without lambda, it's simpler that way anyway. Reviewed-by: Daniel P. Ber

[PATCH v2 1/2] tests/functional/qemu_test/decorators: Fix bad check for imports

2025-01-22 Thread Thomas Huth
skipIfMissingImports should use importlib.import_module() for checking whether a module with the name stored in the "impname" variable is available or not, otherwise the code tries to import a module with the name "impname" instead. (This bug hasn't been noticed before since there is another issue

Re: [PATCH] vhost-user: Silence unsupported VHOST_USER_PROTOCOL_F_RARP error

2025-01-22 Thread Stefano Garzarella
On Tue, Jan 21, 2025 at 11:00:29AM +0100, Laurent Vivier wrote: In vhost_user_receive() if vhost_net_notify_migration_done() reports an error we display on the console: Vhost user backend fails to broadcast fake RARP This message can be useful if there is a problem to execute VHOST_USER_SEND_R

Re: [PATCH 2/2] improve precision of throttle_pct

2025-01-22 Thread fuqiang wang
On 2025/1/21 20:25, Yong Huang wrote: On Tue, Dec 31, 2024 at 9:56 AM fuqiang wang wrote: Using the current algorithm, there are issues with precision not being handled correctly during division operations. (Even though double type casting is used in the function, it does not seem to have an

Re: [PATCH v2 1/2] tests/functional/qemu_test/decorators: Fix bad check for imports

2025-01-22 Thread Daniel P . Berrangé
On Wed, Jan 22, 2025 at 02:43:13PM +0100, Thomas Huth wrote: > skipIfMissingImports should use importlib.import_module() for checking > whether a module with the name stored in the "impname" variable is > available or not, otherwise the code tries to import a module with > the name "impname" instea

Re: [PATCH v2 0/3] scripts/qemu-gdb: Make coroutine dumps to work with coredumps

2025-01-22 Thread Kevin Wolf
Am 12.12.2024 um 21:47 hat Peter Xu geschrieben: > v1: https://lore.kernel.org/r/20241211201739.1380222-1-pet...@redhat.com > > Changelog: in previous v1, I got a wrong cut-off accident in commit > message, which is now fixed (along with some small touchup elsewhere). > When at it, I also tried to

Re: [RFC v3 1/5] vhost-vdpa: Decouple the IOVA allocator

2025-01-22 Thread Jonah Palmer
On 1/21/25 12:25 PM, Eugenio Perez Martin wrote: On Tue, Jan 21, 2025 at 3:53 PM Jonah Palmer wrote: On 1/16/25 11:44 AM, Eugenio Perez Martin wrote: On Fri, Jan 10, 2025 at 6:09 PM Jonah Palmer wrote: Decouples the IOVA allocator from the full IOVA->HVA tree to support a SVQ IOVA->HV

Re: [PATCH] vhost-user: Silence unsupported VHOST_USER_PROTOCOL_F_RARP error

2025-01-22 Thread Michael S. Tsirkin
On Wed, Jan 22, 2025 at 05:20:06PM +0100, Stefano Garzarella wrote: > On Wed, Jan 22, 2025 at 08:59:22AM -0500, Michael S. Tsirkin wrote: > > On Wed, Jan 22, 2025 at 02:42:14PM +0100, Stefano Garzarella wrote: > > > On Tue, Jan 21, 2025 at 11:00:29AM +0100, Laurent Vivier wrote: > > > > In vhost_us

Re: [PULL v2 0/9] s390x and test patches 2025-01-21

2025-01-22 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: [PATCH] vhost-user: Silence unsupported VHOST_USER_PROTOCOL_F_RARP error

2025-01-22 Thread Stefano Garzarella
On Wed, Jan 22, 2025 at 08:59:22AM -0500, Michael S. Tsirkin wrote: On Wed, Jan 22, 2025 at 02:42:14PM +0100, Stefano Garzarella wrote: On Tue, Jan 21, 2025 at 11:00:29AM +0100, Laurent Vivier wrote: > In vhost_user_receive() if vhost_net_notify_migration_done() reports > an error we display on

Re: [PATCH 05/10] rust: pl011: pull interrupt updates out of read/write ops

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:52AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:52 +0100 > From: Paolo Bonzini > Subject: [PATCH 05/10] rust: pl011: pull interrupt updates out of > read/write ops > X-Mailer: git-send-email 2.47.1 > > qemu_irqs are not part of the vmstate, therefore

Re: [PATCH 02/10] rust: vmstate: implement VMState for non-leaf types

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:00:38AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:00:38 +0100 > From: Paolo Bonzini > Subject: [PATCH 02/10] rust: vmstate: implement VMState for non-leaf types > X-Mailer: git-send-email 2.47.1 > > Arrays, pointers and cells use a VMStateField that is bas

Re: [PATCH v2] hw/misc: i2c-echo: add tracing

2025-01-22 Thread Corey Minyard
On Tue, Jan 21, 2025 at 10:59:34AM +, Titus Rwantare wrote: > This has been useful when debugging and unsure if the guest is > generating i2c traffic. Acked-by: Corey Minyard > > Signed-off-by: Titus Rwantare > --- > hw/misc/i2c-echo.c | 8 > hw/misc/trace-events | 5 + > 2

Re: [PATCH 10/10] rust: vmstate: make order of parameters consistent in vmstate_clock

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:00:46AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:00:46 +0100 > From: Paolo Bonzini > Subject: [PATCH 10/10] rust: vmstate: make order of parameters consistent > in vmstate_clock > X-Mailer: git-send-email 2.47.1 > > Place struct_name before field_name, s

Re: [PATCH 07/10] rust: qemu_api: add vmstate_struct

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:00:43AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:00:43 +0100 > From: Paolo Bonzini > Subject: [PATCH 07/10] rust: qemu_api: add vmstate_struct > X-Mailer: git-send-email 2.47.1 > > It is not type safe, but it's the best that can be done without > const_re

[PATCH 01/11] acpi/ghes: Prepare to support multiple sources on ghes

2025-01-22 Thread Mauro Carvalho Chehab
The current code is actually dependent on having just one error structure with a single source. As the number of sources should be arch-dependent, as it will depend on what kind of synchronous/assynchronous notifications will exist, change the logic to dynamically build the table. Yet, for a prop

[PATCH 06/11] acpi/ghes: add a notifier to notify when error data is ready

2025-01-22 Thread Mauro Carvalho Chehab
Some error injection notify methods are async, like GPIO notify. Add a notifier to be used when the error record is ready to be sent to the guest OS. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 5 - include/hw/acpi/ghes.h | 3 +++ 2 files changed, 7 insertions(+), 1 del

[PATCH 03/11] acpi/ghes: Use HEST table offsets when preparing GHES records

2025-01-22 Thread Mauro Carvalho Chehab
There are two pointers that are needed during error injection: 1. The start address of the CPER block to be stored; 2. The address of the ack, which needs a reset before next error. It is preferable to calculate them from the HEST table. This allows checking the source ID, the size of the table

[PATCH 02/11] acpi/ghes: add a firmware file with HEST address

2025-01-22 Thread Mauro Carvalho Chehab
Store HEST table address at GPA, placing its content at hest_addr_le variable. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- Change from v8: - hest_addr_lr is now pointing to the error source size and data. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c

[PATCH 04/11] acpi/generic_event_device: Update GHES migration to cover hest addr

2025-01-22 Thread Mauro Carvalho Chehab
The GHES migration logic at GED should now support HEST table location too. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_device.c | 29 + 1 file changed, 29 insertions(+) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c i

[PATCH 05/11] acpi/generic_event_device: add logic to detect if HEST addr is available

2025-01-22 Thread Mauro Carvalho Chehab
Create a new property (x-has-hest-addr) and use it to detect if the GHES table offsets can be calculated from the HEST address (qemu 9.2 and upper) or via the legacy way via an offset obtained from the hardware_errors firmware file. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_

[PATCH 10/11] qapi/acpi-hest: add an interface to do generic CPER error injection

2025-01-22 Thread Mauro Carvalho Chehab
Creates a QMP command to be used for generic ACPI APEI hardware error injection (HEST) via GHESv2, and add support for it for ARM guests. Error injection uses ACPI_HEST_SRC_ID_QMP source ID to be platform independent. This is mapped at arch virt bindings, depending on the types supported by QEMU a

[PATCH 07/11] acpi/ghes: Cleanup the code which gets ghes ged state

2025-01-22 Thread Mauro Carvalho Chehab
Move the check logic into a common function and simplify the code which checks if GHES is enabled and was properly setup. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes-stub.c| 4 ++-- hw/acpi/ghes.c | 33 +++-- include/hw/acpi/ghes.h | 9 +---

[PATCH 00/11] Change ghes to use HEST-based offsets and add support for error inject

2025-01-22 Thread Mauro Carvalho Chehab
Now that the ghes preparation patches were merged, let's add support for error injection. I'm opting to fold two patch series into one here: 1. https://lore.kernel.org/qemu-devel/20250113130854.848688-1-mchehab+hua...@kernel.org/ It is the first 5 patches containing changes to the math used to

[PATCH 11/11] scripts/ghes_inject: add a script to generate GHES error inject

2025-01-22 Thread Mauro Carvalho Chehab
Using the QMP GHESv2 API requires preparing a raw data array containing a CPER record. Add a helper script with subcommands to prepare such data. Currently, only ARM Processor error CPER record is supported. Signed-off-by: Mauro Carvalho Chehab --- MAINTAINERS| 3 + scrip

[PATCH 08/11] acpi/generic_event_device: add an APEI error device

2025-01-22 Thread Mauro Carvalho Chehab
Adds a generic error device to handle generic hardware error events as specified at ACPI 6.5 specification at 18.3.2.7.2: https://uefi.org/specs/ACPI/6.5/18_Platform_Error_Interfaces.html#event-notification-for-generic-error-sources using HID PNP0C33. The PNP0C33 device is used to report hardware

[PATCH 09/11] arm/virt: Wire up a GED error device for ACPI / GHES

2025-01-22 Thread Mauro Carvalho Chehab
Adds support to ARM virtualization to allow handling generic error ACPI Event via GED & error source device. It is aligned with Linux Kernel patch: https://lore.kernel.org/lkml/1272350481-27951-8-git-send-email-ying.hu...@intel.com/ Co-authored-by: Mauro Carvalho Chehab Co-authored-by: Jonathan

[PATCH 6/9] nbd/server: Support inactive nodes

2025-01-22 Thread Kevin Wolf
In order to support running an NBD export on inactive nodes, we must make sure to return errors for any operations that aren't allowed on inactive nodes. Reads are the only operation we know we need for inactive images, so to err on the side of caution, return errors for everything else, even if so

[PATCH 7/9] block: Add blockdev-set-active QMP command

2025-01-22 Thread Kevin Wolf
The system emulator tries to automatically activate and inactivate block nodes at the right point during migration. However, there are still cases where it's necessary that the user can do this manually. Images are only activated on the destination VM of a migration when the VM is actually resumed

[PATCH 9/9] iotests: Add qsd-migrate case

2025-01-22 Thread Kevin Wolf
Test that it's possible to migrate a VM that uses an image on shared storage through qemu-storage-daemon. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/qsd-migrate | 132 +++ tests/qemu-iotests/tests/qsd-migrate.out | 51 + 2 files changed, 183 insertion

[PATCH 0/9] block: Managing inactive nodes (QSD migration)

2025-01-22 Thread Kevin Wolf
This series adds a mechanism that allows the user or management tool to manually activate and inactivate block nodes instead of fully relying on the automatic management in the migration code. One case where this is needed is for migration with shared storage and devices backed by qemu-storage-dae

[PATCH 2/9] block: Add option to create inactive nodes

2025-01-22 Thread Kevin Wolf
In QEMU, nodes are automatically created inactive while expecting an incoming migration (i.e. RUN_STATE_INMIGRATE). In qemu-storage-daemon, the notion of runstates doesn't exist. It also wouldn't necessarily make sense to introduce it because a single daemon can serve multiple VMs that can be in di

[PATCH 4/9] block/export: Don't ignore image activation error in blk_exp_add()

2025-01-22 Thread Kevin Wolf
Currently, block jobs can't handle inactive images correctly. Incoming write requests would run into assertion failures. Make sure that we return an error when creating an export can't activate the image. Signed-off-by: Kevin Wolf --- block/export/export.c | 6 +- 1 file changed, 5 insertion

[PATCH 5/9] block/export: Add option to allow export of inactive nodes

2025-01-22 Thread Kevin Wolf
Add an option in BlockExportOptions to allow creating an export on an inactive node without activating the node. This mode needs to be explicitly supported by the export type (so that it doesn't perform any operations that are forbidden for inactive nodes), so this patch alone doesn't allow this op

[PATCH 3/9] block: Support inactive nodes in blk_insert_bs()

2025-01-22 Thread Kevin Wolf
Device models have a relatively complex way to set up their block backends, in which blk_attach_dev() sets blk->disable_perm = true. We want to support inactive images in exports, too, so that qemu-storage-daemon can be used with migration. Because they don't use blk_attach_dev(), they need another

Re: [PATCH 05/10] rust: vmstate: implement VMState for scalar types

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:00:41AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:00:41 +0100 > From: Paolo Bonzini > Subject: [PATCH 05/10] rust: vmstate: implement VMState for scalar types > X-Mailer: git-send-email 2.47.1 > > Scalar types are those that have their own VMStateInfo. Th

Re: [PATCH] hw/boards: Convert MachineClass bitfields to boolean

2025-01-22 Thread BALATON Zoltan
On Wed, 22 Jan 2025, Philippe Mathieu-Daudé wrote: As Daniel mentioned: "The number of instances of MachineClass is not large enough that we save a useful amount of memory through bitfields." Also, see recent commit ecbf3567e21 ("docs/devel/style: add a section about bitfield, and disallow the

Re: [PATCH v3] hw/i386/cpu: remove default_cpu_version and simplify

2025-01-22 Thread Ani Sinha
On Tue, Jan 21, 2025 at 4:58 PM Zhao Liu wrote: > > Hi Ani, > > Sorry for late reply. > > On Thu, Jan 16, 2025 at 09:04:18AM +0530, Ani Sinha wrote: > > Date: Thu, 16 Jan 2025 09:04:18 +0530 > > From: Ani Sinha > > Subject: [PATCH v3] hw/i386/cpu: remove default_cpu_version and simplify > > X-Mai

[PATCH 1/9] block: Allow inactivating already inactive nodes

2025-01-22 Thread Kevin Wolf
What we wanted to catch with the assertion is cases where the recursion finds that a child was inactive before its parent. This should never happen. But if the user tries to inactivate an image that is already inactive, that's harmless and we don't want to fail the assertion. Signed-off-by: Kevin

Re: [PATCH v5 4/8] virtio-gpu: Support asynchronous fencing

2025-01-22 Thread Dmitry Osipenko
On 1/20/25 16:56, Alex Bennée wrote: ... >> @@ -972,15 +973,29 @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, >> >> trace_virtio_gpu_fence_ctrl(cmd->cmd_hdr.fence_id, cmd->cmd_hdr.type); >> >> -/* >> - * Unlike other virglrenderer functions, this one returns a positive >> -

Re: [PATCH] vvfat: fix out of bounds array write

2025-01-22 Thread BALATON Zoltan
On Wed, 22 Jan 2025, Michael Tokarev wrote: 22.01.2025 02:14, Pierrick Bouvier wrote: .. I agree the existing code (and this patch) is pretty cryptic for anyone not familiar with FAT format. However, I think it could be a good thing to first merge this one (which is correct, and works), and ref

Re: [PATCH v5 0/8] Support virtio-gpu DRM native context

2025-01-22 Thread Dmitry Osipenko
On 1/20/25 18:41, Alex Bennée wrote: > Dmitry Osipenko writes: > >> This patchset adds DRM native context support to VirtIO-GPU on Qemu. >> >> Contarary to Virgl and Venus contexts that mediates high level GFX APIs, >> DRM native context [1] mediates lower level kernel driver UAPI, which >> refle

Re: [PATCH] hw/boards: Convert MachineClass bitfields to boolean

2025-01-22 Thread Thomas Huth
On 22/01/2025 15.33, Peter Maydell wrote: On Wed, 22 Jan 2025 at 12:36, Thomas Huth wrote: On 22/01/2025 11.32, Philippe Mathieu-Daudé wrote: As Daniel mentioned: "The number of instances of MachineClass is not large enough that we save a useful amount of memory through bitfields." A

[PATCH] tests/functional: Fix the aarch64_tcg_plugins test

2025-01-22 Thread Thomas Huth
Unfortunately, this test had not been added to meson.build, so we did not notice a regression: Looking for 'Kernel panic - not syncing: VFS:' as the indication for the final boot state of the kernel was a bad idea since 'Kernel panic - not syncing' is the default failure message of the LinuxKernelT

[PATCH v2 03/10] cpus: Cache CPUClass early in instance_init() handler

2025-01-22 Thread Philippe Mathieu-Daudé
Cache CPUClass as early as possible, when the instance is initialized. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- cpu-target.c | 3 --- hw/core/cpu-common.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu-target.c b/cpu-target.c

Re: [RFC PATCH] Fix race in live migration failure path

2025-01-22 Thread Shivam Kumar
On 13 Jan 2025, at 9:59 PM, Peter Xu wrote: !---| CAUTION: External Email |---! On Fri, Jan 10, 2025 at 10:09:38AM -0300, Fabiano Rosas wrote: Shivam Kumar writes:

Re: [PATCH] hw/boards: Convert MachineClass bitfields to boolean

2025-01-22 Thread Thomas Huth
On 22/01/2025 11.32, Philippe Mathieu-Daudé wrote: As Daniel mentioned: "The number of instances of MachineClass is not large enough that we save a useful amount of memory through bitfields." Also, see recent commit ecbf3567e21 ("docs/devel/style: add a section about bitfield, and disallow

Re: [PATCH] vvfat: fix out of bounds array write

2025-01-22 Thread Michael Tokarev
22.01.2025 15:19, BALATON Zoltan wrote: On Wed, 22 Jan 2025, Michael Tokarev wrote: 22.01.2025 02:14, Pierrick Bouvier wrote: .. I agree the existing code (and this patch) is pretty cryptic for anyone not familiar with FAT format. However, I think it could be a good thing to first merge this o

Re: [PULL 00/68] tcg patch queue

2025-01-22 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 4/5] cpu: Introduce cpu_get_phys_bits()

2025-01-22 Thread Cédric Le Goater
The Intel CPU has a complex history regarding setting of the physical address space width on KVM. A 'phys_bits' field and a "phys-bits" property were added by commit af45907a1328 ("target-i386: Allow physical address bits to be set") to tune this value. In certain circumstances, it is interesting

[PATCH 5/5] vfio: Check compatibility of CPU and IOMMU address space width

2025-01-22 Thread Cédric Le Goater
Print a warning if IOMMU address space width is smaller than the physical address width. In this case, PCI peer-to-peer transactions on BARs are not supported and failures of device MMIO regions are to be expected. This can occur with the 39-bit IOMMU address space width as found on consumer grade

Re: [PATCH v7 2/4] chardev/char-hub: implement backend chardev aggregator

2025-01-22 Thread Roman Penyaev
On Wed, Jan 22, 2025 at 3:44 PM Alex Bennée wrote: > > Roman Penyaev writes: > > > This patch implements a new chardev backend `hub` device, which > > aggregates input from multiple backend devices and forwards it to a > > single frontend device. Additionally, `hub` device takes the output > > fr

[PATCH 1/5] vfio/pci: Replace "iommu_device" by "vIOMMU"

2025-01-22 Thread Cédric Le Goater
This is to be consistent with other reported errors related to vIOMMU devices. Signed-off-by: Cédric Le Goater --- hw/vfio/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index cf14987e42bd9188d5040b51a2f84cfa959f632d..ad326839db49cf3a5052

[PATCH 2/5] vfio: Modify vfio_viommu_preset() parameter

2025-01-22 Thread Cédric Le Goater
We plan to use vfio_viommu_preset() in MemoryListener handlers which operate at the container level. Change the parameter to VFIOContainerBase to ease future changes. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio/common.c | 4 ++-- hw/vfio/migrati

[PATCH 0/5] vfio: Improve error reporting when MMIO region mapping fails

2025-01-22 Thread Cédric Le Goater
Hello, Under certain circumstances, a MMIO region of a device fails to map because the region is outside the supported IOVA ranges of the VM. In this case, PCI peer-to-peer transactions on BARs are not supported. This typically occurs when the IOMMU address space width is less than the physical ad

[PATCH 3/5] vfio: Improve error reporting when MMIO region mapping fails

2025-01-22 Thread Cédric Le Goater
When the IOMMU address space width is smaller than the physical address width, a MMIO region of a device can fail to map because the region is outside the supported IOVA ranges of the VM. In this case, PCI peer-to-peer transactions on BARs are not supported. This can occur with the 39-bit IOMMU ad

Re: [PATCH v1 1/4] physmem: disallow direct access to RAM DEVICE in address_space_write_rom()

2025-01-22 Thread Philippe Mathieu-Daudé
On 22/1/25 11:13, David Hildenbrand wrote: On 22.01.25 11:10, David Hildenbrand wrote: On 22.01.25 11:07, Philippe Mathieu-Daudé wrote: Hi David, On 20/1/25 12:14, David Hildenbrand wrote: As documented in commit 4a2e242bbb306 ("memory: Don't use memcpy for ram_device regions"), we disallow d

Re: [PATCH v1 1/4] physmem: disallow direct access to RAM DEVICE in address_space_write_rom()

2025-01-22 Thread David Hildenbrand
On 22.01.25 11:17, Philippe Mathieu-Daudé wrote: On 22/1/25 11:13, David Hildenbrand wrote: On 22.01.25 11:10, David Hildenbrand wrote: On 22.01.25 11:07, Philippe Mathieu-Daudé wrote: Hi David, On 20/1/25 12:14, David Hildenbrand wrote: As documented in commit 4a2e242bbb306 ("memory: Don't

[RFC v2 4/5] i386/kvm: Support event with masked entry format in KVM PMU filter

2025-01-22 Thread Zhao Liu
KVM_SET_PMU_EVENT_FILTER of x86 KVM supports masked events mode, which accepts masked entry format event to flexibly represent a group of PMU events. Support masked entry format in kvm-pmu-filter object and handle this in i386 kvm codes. Signed-off-by: Zhao Liu --- Changes since RFC v1: * Bump

[PATCH v2 04/10] cpus: Prefer cached CpuClass over CPU_GET_CLASS() macro

2025-01-22 Thread Philippe Mathieu-Daudé
CpuState caches its CPUClass since commit 6fbdff87062 ("cpu: cache CPUClass in CPUState for hot code paths"), use it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/core/cpu.h | 10 +++- cpu-common.c | 10 cpu-target.c | 6 ++-

[PATCH v2 10/10] target/arm: Prefer cached CpuClass over CPU_GET_CLASS() macro

2025-01-22 Thread Philippe Mathieu-Daudé
CpuState caches its CPUClass since commit 6fbdff87062 ("cpu: cache CPUClass in CPUState for hot code paths"), use it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/arm/cpu.c | 3 +-- target/arm/tcg/cpu-v7m.c | 3 +-- 2 files changed, 2 insertions(+), 4

[PATCH] hw/boards: Convert MachineClass bitfields to boolean

2025-01-22 Thread Philippe Mathieu-Daudé
As Daniel mentioned: "The number of instances of MachineClass is not large enough that we save a useful amount of memory through bitfields." Also, see recent commit ecbf3567e21 ("docs/devel/style: add a section about bitfield, and disallow them for packed structures"). Convert the MachineClas

Re: [PATCH 06/22] exec/cpu: Call cpu_remove_sync() once in cpu_common_unrealize()

2025-01-22 Thread Igor Mammedov
On Thu, 16 Jan 2025 19:05:46 +0100 Philippe Mathieu-Daudé wrote: > On 28/11/23 17:42, Igor Mammedov wrote: > > On Mon, 18 Sep 2023 18:02:39 +0200 > > Philippe Mathieu-Daudé wrote: > > > >> While create_vcpu_thread() creates a vCPU thread, its counterpart > >> is cpu_remove_sync(), which join

Re: [PATCH] hw/boards: Convert MachineClass bitfields to boolean

2025-01-22 Thread Peter Maydell
On Wed, 22 Jan 2025 at 12:36, Thomas Huth wrote: > > On 22/01/2025 11.32, Philippe Mathieu-Daudé wrote: > > As Daniel mentioned: > > > > "The number of instances of MachineClass is not large enough > >that we save a useful amount of memory through bitfields." > > > > Also, see recent commit

Re: [PATCH 04/10] rust: pl011: extract CharBackend receive logic into a separate function

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:51AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:51 +0100 > From: Paolo Bonzini > Subject: [PATCH 04/10] rust: pl011: extract CharBackend receive logic into > a separate function > X-Mailer: git-send-email 2.47.1 > > Prepare for moving all references

[PATCH v2 05/10] accel: Prefer cached CpuClass over CPU_GET_CLASS() macro

2025-01-22 Thread Philippe Mathieu-Daudé
CpuState caches its CPUClass since commit 6fbdff87062 ("cpu: cache CPUClass in CPUState for hot code paths"), use it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/accel-target.c | 12 +--- accel/tcg/tcg-accel-ops.c | 3 +-- accel/tcg/translate-all

[PATCH v2 06/10] user: Prefer cached CpuClass over CPU_GET_CLASS() macro

2025-01-22 Thread Philippe Mathieu-Daudé
CpuState caches its CPUClass since commit 6fbdff87062 ("cpu: cache CPUClass in CPUState for hot code paths"), use it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- linux-user/alpha/target_proc.h | 2 +- bsd-user/signal.c | 4 ++-- linux-user/signal.c

[PATCH v2 07/10] disas: Prefer cached CpuClass over CPU_GET_CLASS() macro

2025-01-22 Thread Philippe Mathieu-Daudé
CpuState caches its CPUClass since commit 6fbdff87062 ("cpu: cache CPUClass in CPUState for hot code paths"), use it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- disas/disas-common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/disas/disa

[PATCH v2 09/10] hw/acpi: Prefer cached CpuClass over CPU_GET_CLASS() macro

2025-01-22 Thread Philippe Mathieu-Daudé
CpuState caches its CPUClass since commit 6fbdff87062 ("cpu: cache CPUClass in CPUState for hot code paths"), use it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/acpi/cpu.c | 4 ++-- hw/acpi/cpu_hotplug.c | 3 +-- 2 files changed, 3 insertions(+), 4 delet

[PATCH v2 01/10] hw/core/generic-loader: Do not open-code cpu_set_pc()

2025-01-22 Thread Philippe Mathieu-Daudé
Directly call cpu_set_pc() instead of open-coding it. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/generic-loader.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index fb354693aff..1b9ab600c9c 100644 --- a/hw/core

Re: [PATCH v2 02/10] gdbstub: Clarify no more than @gdb_num_core_regs can be accessed

2025-01-22 Thread Philippe Mathieu-Daudé
On 22/1/25 10:30, Philippe Mathieu-Daudé wrote: Both CPUClass::gdb_read_register() and CPUClass::gdb_write_register() handlers are called from common gdbstub code, and won't be called with register index over CPUClass::gdb_num_core_regs: int gdb_read_register(CPUState *cpu, GByteArray *buf, i

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-22 Thread Xu Yilun
On Wed, Jan 22, 2025 at 03:30:05PM +1100, Alexey Kardashevskiy wrote: > > > On 22/1/25 02:18, Peter Xu wrote: > > On Tue, Jun 25, 2024 at 12:31:13AM +0800, Xu Yilun wrote: > > > On Mon, Jan 20, 2025 at 03:46:15PM -0500, Peter Xu wrote: > > > > On Mon, Jan 20, 2025 at 09:22:50PM +1100, Alexey Kard

Re: [PATCH] tests/functional: Fix broken decorators with lamda functions

2025-01-22 Thread Daniel P . Berrangé
On Tue, Jan 21, 2025 at 07:58:14AM +0100, Thomas Huth wrote: > The decorators that use a lambda function are currently broken > and do not properly skip the test if the condition is not met. > Using "return skipUnless(lambda: ...)" does not work as expected. > To fix it, rewrite the decorators with

Re: [PATCH v1 1/4] physmem: disallow direct access to RAM DEVICE in address_space_write_rom()

2025-01-22 Thread Philippe Mathieu-Daudé
Hi David, On 20/1/25 12:14, David Hildenbrand wrote: As documented in commit 4a2e242bbb306 ("memory: Don't use memcpy for ram_device regions"), we disallow direct access to RAM DEVICE regions. Let's factor out the "supports direct access" check from memory_access_is_direct() so we can reuse it,

Re: [PATCH v1 3/4] hmp: use cpu_get_phys_page_debug() in hmp_gva2gpa()

2025-01-22 Thread Philippe Mathieu-Daudé
On 20/1/25 12:15, David Hildenbrand wrote: We don't need the MemTxAttrs, so let's simply use the simpler function variant. Signed-off-by: David Hildenbrand --- monitor/hmp-cmds-target.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v1 1/4] physmem: disallow direct access to RAM DEVICE in address_space_write_rom()

2025-01-22 Thread David Hildenbrand
On 22.01.25 11:07, Philippe Mathieu-Daudé wrote: Hi David, On 20/1/25 12:14, David Hildenbrand wrote: As documented in commit 4a2e242bbb306 ("memory: Don't use memcpy for ram_device regions"), we disallow direct access to RAM DEVICE regions. Let's factor out the "supports direct access" check

  1   2   >