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

2025-01-23 Thread Zhao Liu
Hi Ani, [snip] > --- a/include/hw/i386/x86.h > +++ b/include/hw/i386/x86.h > @@ -114,7 +114,10 @@ void init_topo_info(X86CPUTopoInfo *topo_info, const > X86MachineState *x86ms); > uint32_t x86_cpu_apic_id_from_index(X86MachineState *x86ms, > unsigned int cpu

Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets disabled

2025-01-23 Thread Eric Auger
Hi Jason, On 1/23/25 2:34 AM, Jason Wang wrote: > On Wed, Jan 22, 2025 at 3:55 PM Eric Auger wrote: >> Hi Jason, >> >> >> On 1/22/25 8:17 AM, Jason Wang wrote: >>> On Wed, Jan 22, 2025 at 12:25 AM Eric Auger wrote: Hi Jason, On 1/21/25 4:27 AM, Jason Wang wrote: > On Tue, Jan

RE: [RFC PATCH 0/5] hw/arm/virt: Add support for user-creatable nested SMMUv3

2025-01-23 Thread Shameerali Kolothum Thodi via
> -Original Message- > From: Nicolin Chen > Sent: Thursday, January 23, 2025 4:10 AM > To: Donald Dutile > Cc: Shameerali Kolothum Thodi > ; eric.au...@redhat.com; Peter > Maydell ; Jason Gunthorpe ; > Daniel P. Berrangé ; qemu-...@nongnu.org; > qemu-devel@nongnu.org; Linuxarm ; Wangzh

Re: [PATCH v5 3/4] audio: Add functions to initialize buffers

2025-01-23 Thread Philippe Mathieu-Daudé
Hi Akihiko, On 23/1/25 08:18, Akihiko Odaki wrote: These functions can be used to re-initialize buffers when hardware parameters change due to device hotplug, for example. Signed-off-by: Akihiko Odaki Reviewed-by: Phil Dennis-Jordan Reviewed-by: Christian Schoenebeck --- audio/audio_int.h

[PATCH v9 4/4] qemu-options.hx: describe hub chardev and aggregation of several backends

2025-01-23 Thread Roman Penyaev
This adds a few lines describing `hub` aggregator configuration for aggregation of several backend devices with a single frontend device. Signed-off-by: Roman Penyaev Reviewed-by: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- qemu-options.hx | 49

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

2025-01-23 Thread Roman Penyaev
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 backend devices. This allows for se

[PATCH v9 3/4] tests/unit/test-char: add unit tests for hub chardev backend

2025-01-23 Thread Roman Penyaev
This commit introduces a new test function `char_hub_test` to validate the functionality and constraints of the "hub" chardev backend in QEMU. The test includes multiple scenarios: 1. Invalid hub creation: - Creating a hub without defining `chardevs.N` (expects an error). - Creating a hub wi

[PATCH v2] tests/functional: Fix the aarch64_tcg_plugins test

2025-01-23 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

Re: [PATCH v5 1/4] coreaudio: Improve naming

2025-01-23 Thread Philippe Mathieu-Daudé
On 23/1/25 08:18, Akihiko Odaki wrote: coreaudio had names that are not conforming to QEMU codding style. coreaudioVoiceOut also had some members that are prefixed with redundant words like "output" or "audio". Global names included "out" to tell they are specific to output devices, but this rule

Re: [RFC PATCH 0/5] hw/arm/virt: Add support for user-creatable nested SMMUv3

2025-01-23 Thread Nicolin Chen
On Thu, Jan 23, 2025 at 08:28:34AM +, Shameerali Kolothum Thodi wrote: > > -Original Message- > > From: Nicolin Chen > > I wonder if we can make some progress in Feb? If so, we can start > > to wrap up the iommufd uAPI patches for HWPT, which was a part of > > intel's series but never

[PATCH v9 1/4] chardev/char-pty: send CHR_EVENT_CLOSED on disconnect

2025-01-23 Thread Roman Penyaev
Change makes code symmetric to the code, which handles the "connected" state, i.e. send CHR_EVENT_CLOSED when state changes from "connected" to "disconnected". This behavior is similar to char-socket, for example. Signed-off-by: Roman Penyaev Reviewed-by: "Marc-André Lureau" Reviewed-by: "Alex

[PATCH v9 0/4] chardev: implement backend chardev multiplexing

2025-01-23 Thread Roman Penyaev
Mux is a character backend (host side) device, which multiplexes multiple frontends with one backend device. The following is a few lines from the QEMU manpage [1]: A multiplexer is a "1:N" device, and here the "1" end is your specified chardev backend, and the "N" end is the various parts o

Re: [PATCH 07/10] rust: pl011: wrap registers with BqlRefCell

2025-01-23 Thread Zhao Liu
> > > #[repr(C)] > > > -#[derive(Debug, qemu_api_macros::Object, qemu_api_macros::offsets)] > > > > This is the issue I also met, so why not drive "Debug" for BqlRefCell? > > > > Because it is not entirely possible to do it safely--there could be > outstanding borrows that break invariants and ca

[PATCH] tcg: drop qemu_cpu_is_self() in tlb_flush_by_mmuidx[_async_work]

2025-01-23 Thread Igor Mammedov
QEMU will crash with following debug enabled # define DEBUG_TLB_GATE 1 # define DEBUG_TLB_LOG_GATE 1 due to [1] introduced assert and as it happenstlb_flush_by_mmuidx[_async_work] functions are called not only from vcpu thread but also from reset handler that is called from main thread at cpu r

Re: [v7 00/26] vfio-user client

2025-01-23 Thread John Levon
On Wed, Jan 08, 2025 at 11:50:06AM +, John Levon wrote: > Hi, this is the 7th revision of the vfio-user client implementation. > > First of all, thank you for your time reviewing the previous versions. > > The vfio-user framework consists of 3 parts: > 1) The VFIO user protocol specificatio

Re: [PATCH] tcg: drop qemu_cpu_is_self() in tlb_flush_by_mmuidx[_async_work]

2025-01-23 Thread Alex Bennée
Igor Mammedov writes: > QEMU will crash with following debug enabled > # define DEBUG_TLB_GATE 1 > # define DEBUG_TLB_LOG_GATE 1 > due to [1] introduced assert and as it happenstlb_flush_by_mmuidx[_async_work] > functions are called not only from vcpu thread but also from reset handler > that

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

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 16:46:22 +0100 Mauro Carvalho Chehab wrote: > 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 firmwar

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

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 16:46:23 +0100 Mauro Carvalho Chehab wrote: > 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 Reviewed-by: Jonathan Cameron

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

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 16:46:24 +0100 Mauro Carvalho Chehab wrote: > 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 Seems a reasonable cleanup to me. Reviewed-by: Jonathan Cameron

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

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 16:46:26 +0100 Mauro Carvalho Chehab wrote: > 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...@

Re: [PATCH] tcg: drop qemu_cpu_is_self() in tlb_flush_by_mmuidx[_async_work]

2025-01-23 Thread Igor Mammedov
On Thu, 23 Jan 2025 10:52:15 + Alex Bennée wrote: > Igor Mammedov writes: > > > QEMU will crash with following debug enabled > > # define DEBUG_TLB_GATE 1 > > # define DEBUG_TLB_LOG_GATE 1 > > due to [1] introduced assert and as it > > happenstlb_flush_by_mmuidx[_async_work] > > functi

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

2025-01-23 Thread Dmitry Osipenko
On 1/22/25 20:00, 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] Fix a data race with goflag in rcutorture test

2025-01-23 Thread Paolo Bonzini
On Wed, Jan 22, 2025 at 2:59 PM Vitalii Mordan wrote: > > This patch addresses a potential data race involving the global variable > goflag in the rcutorture test. The issue is resolved by adding the atomic > qualifier to ensure proper synchronization. Hello! QEMU does not use _Atomic; in genera

Re: [PATCH 0/4] intel_iommu: Reset vIOMMU after all the rest of devices

2025-01-23 Thread Eric Auger
Hi, On 1/17/24 10:15 AM, pet...@redhat.com wrote: > From: Peter Xu > > There're issue reported that when syetem_reset the VM with an intel iommu > device and MT2892 PF(mlx5_core driver), the host kernel throws DMAR error. > > https://issues.redhat.com/browse/RHEL-7188 > > Alex quickly spot a po

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

2025-01-23 Thread Shivam Kumar
> On 22 Jan 2025, at 10:10 PM, Peter Xu wrote: > > !---| > CAUTION: External Email > > |---! > > Hi, Shivam, > > On Wed, Jan 22, 2025 at 10:54:17AM +, Shivam K

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

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 16:46:18 +0100 Mauro Carvalho Chehab wrote: > 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 w

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

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 16:46:19 +0100 Mauro Carvalho Chehab wrote: > Store HEST table address at GPA, placing its content at > hest_addr_le variable. > > Signed-off-by: Mauro Carvalho Chehab > Reviewed-by: Jonathan Cameron > A few trivial things inline. Jonathan > --- > > Change from v8: > -

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

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 16:46:20 +0100 Mauro Carvalho Chehab wrote: > 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 fr

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

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 16:46:21 +0100 Mauro Carvalho Chehab wrote: > The GHES migration logic at GED should now support HEST table > location too. > > Signed-off-by: Mauro Carvalho Chehab I'm not an expert on migration logic, but with that in mind, this looks fine to me. Reviewed-by: Jonathan Ca

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

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 16:46:27 +0100 Mauro Carvalho Chehab wrote: > 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

RE: [RFC PATCH 0/5] hw/arm/virt: Add support for user-creatable nested SMMUv3

2025-01-23 Thread Duan, Zhenzhong
Hi Shameer, >-Original Message- >From: Shameerali Kolothum Thodi >Subject: RE: [RFC PATCH 0/5] hw/arm/virt: Add support for user-creatable nested >SMMUv3 > > > >> -Original Message- >> From: Nicolin Chen >> Sent: Thursday, January 23, 2025 4:10 AM >> To: Donald Dutile >> Cc: Sha

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

2025-01-23 Thread Prasad Pandit
On Wed, 22 Jan 2025 at 21:40, Peter Xu wrote: > I believe many of the tests can be avoided, but still below is a list of > minimum tests that I think might still be good to add: > > # /x86_64/migration/postcopy/plain > # /x86_64/migration/postcopy/recovery/tls/psk > # /x86_

Re: [PATCH] spapr: nested: Add support for reporting Hostwide state counter

2025-01-23 Thread Harsh Prateek Bora
Hi Vaibhav, On 1/15/25 12:37, Vaibhav Jain wrote: Add support for reporting Hostwide state counters for nested KVM pseries guests running with 'cap-nested-hv' with Qemu-TCG acting as I hope you meant cap-nested-papr for APIv2 (cap-nested-hv is APIv1). L0-hypervisor. sPAPR supports reporting

Re: [PATCH] spapr: nested: Add support for reporting Hostwide state counter

2025-01-23 Thread Vaibhav Jain
Updated the recipients list. Thanks Harsh for reviewing the patch. I have addressed your review comments in the v2 of the patch located at [1]. [1] https://lore.kernel.org/all/20250123115538.86821-1-vaib...@linux.ibm.com Harsh Prateek Bora writes: > Hi Vaibhav, > > On 1/15/25 12:37, Vaibhav

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

2025-01-23 Thread Alex Bennée
Dmitry Osipenko writes: > On 1/22/25 20:00, 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

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

2025-01-23 Thread Ani Sinha
On Thu, Jan 23, 2025 at 1:56 PM Zhao Liu wrote: > > Hi Ani, > > [snip] > > > --- a/include/hw/i386/x86.h > > +++ b/include/hw/i386/x86.h > > @@ -114,7 +114,10 @@ void init_topo_info(X86CPUTopoInfo *topo_info, const > > X86MachineState *x86ms); > > uint32_t x86_cpu_apic_id_from_index(X86MachineSt

Re: [PATCH] tcg: drop qemu_cpu_is_self() in tlb_flush_by_mmuidx[_async_work]

2025-01-23 Thread Alex Bennée
Igor Mammedov writes: > On Thu, 23 Jan 2025 10:52:15 + > Alex Bennée wrote: > >> Igor Mammedov writes: >> >> > QEMU will crash with following debug enabled >> > # define DEBUG_TLB_GATE 1 >> > # define DEBUG_TLB_LOG_GATE 1 >> > due to [1] introduced assert and as it >> > happenstlb_flu

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

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 16:46:28 +0100 Mauro Carvalho Chehab wrote: > 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

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

2025-01-23 Thread Mauro Carvalho Chehab
Em Thu, 23 Jan 2025 10:02:17 + Jonathan Cameron escreveu: > > --- > > > > Change from v8: > > - hest_addr_lr is now pointing to the error source size and data. > > > > Signed-off-by: Mauro Carvalho Chehab > Bonus. I guess you really like this patch :) There is something wrong here with

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

2025-01-23 Thread Xu Yilun
On Wed, Jan 22, 2025 at 11:43:01AM -0500, Peter Xu wrote: > On Wed, Jan 22, 2025 at 05:41:31PM +0800, Xu Yilun wrote: > > 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

Re: [PATCH 1/2] hw/cxl: Remove unused component_registers::io_registers[] array

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 07:56:23 +0100 Philippe Mathieu-Daudé wrote: > Avoid wasting 4K for each component, remove unused io_registers[]. > > Signed-off-by: Philippe Mathieu-Daudé These may need to come back for correctness if anyone starts actually accessing them in the OS, but for now this is fi

Re: [PATCH 2/2] hw/cxl: Allow tracing component I/O accesses

2025-01-23 Thread Jonathan Cameron via
On Wed, 22 Jan 2025 07:56:24 +0100 Philippe Mathieu-Daudé wrote: > Map the component I/O region as UnimplementedDevice > to be able to trace guest I/O accesses with '-d unimp'. > > Signed-off-by: Philippe Mathieu-Daudé I'm not that familiar with this infrastructure but seems fine to me. I'd de

Re: [PATCH 07/10] rust: pl011: wrap registers with BqlRefCell

2025-01-23 Thread Paolo Bonzini
Il gio 23 gen 2025, 10:05 Zhao Liu ha scritto: > > I will double check. But I do see that there is no mut access inside, at > > least not until the qemu_chr_fe_accept_input() is moved here. > Unfortunately > > until all MemoryRegion and CharBackend bindings are available the uses of > > &mut and

[PATCH v2] spapr: nested: Add support for reporting Hostwide state counter

2025-01-23 Thread Vaibhav Jain
Add support for reporting Hostwide state counters for nested KVM pseries guests running with 'cap-nested-papr' on Qemu-TCG acting as L0-hypervisor. sPAPR supports reporting various stats counters for Guest-Management-Area(GMA) thats owned by L0-Hypervisor and are documented at [1]. These stats coun

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

2025-01-23 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

Re: [RFC 1/1 v3] target/riscv: use tcg ops generation to emulate whole reg rvv loads/stores.

2025-01-23 Thread Paolo Savini
Hi Alex, thanks for the review! On 1/22/25 17:43, Alex Bennée wrote: Paolo Savini writes: This patch replaces the use of a helper function with direct tcg ops generation in order to emulate whole register loads and stores. This is done in order to improve the performance of QEMU. Generally h

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

2025-01-23 Thread Zhao Liu
> hw/i386/microvm.c | 3 +- > hw/i386/pc.c | 14 + > hw/i386/pc_piix.c | 6 ++-- > hw/i386/pc_q35.c | 6 ++-- > hw/i386/x86-common.c | 4 +-- > include/hw/i386/pc.h | 7 +++-- > include/hw/i386/x86.h | 2 +- > target/i386/cpu.c | 69 ++-

Re: [PATCH v5 1/4] coreaudio: Improve naming

2025-01-23 Thread BALATON Zoltan
On Thu, 23 Jan 2025, Akihiko Odaki wrote: coreaudio had names that are not conforming to QEMU codding style. coreaudioVoiceOut also had some members that are prefixed with redundant words like "output" or "audio". Global names included "out" to tell they are specific to output devices, but this r

Re: [PATCH v5 1/4] coreaudio: Improve naming

2025-01-23 Thread BALATON Zoltan
On Thu, 23 Jan 2025, Akihiko Odaki wrote: coreaudio had names that are not conforming to QEMU codding style. coreaudioVoiceOut also had some members that are prefixed with redundant words like "output" or "audio". Global names included "out" to tell they are specific to output devices, but this r

[PATCH] target/s390x: Fix PPNO execution with icount

2025-01-23 Thread Ilya Leoshkevich
Executing PERFORM RANDOM NUMBER OPERATION makes QEMU exit with "Bad icount read" when using record/replay. This is caused by icount_get_raw_locked() if the current instruction is not the last one in the respective translation block. For the x86_64's rdrand this is resolved by calling translator_io

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

2025-01-23 Thread Dmitry Osipenko
On 1/23/25 14:58, Alex Bennée wrote: > Dmitry Osipenko writes: > >> On 1/22/25 20:00, 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, >>

Re: [PATCH v6 40/60] hw/i386: add eoi_intercept_unsupported member to X86MachineState

2025-01-23 Thread Igor Mammedov
On Tue, 5 Nov 2024 01:23:48 -0500 Xiaoyao Li wrote: > Add a new bool member, eoi_intercept_unsupported, to X86MachineState > with default value false. Set true for TDX VM. I'd rename it to enable_eoi_intercept, by default set to true for evrything and make TDX override this to false. > > Inabi

Re: [PATCH v6 41/60] hw/i386: add option to forcibly report edge trigger in acpi tables

2025-01-23 Thread Igor Mammedov
On Tue, 14 Jan 2025 21:01:27 +0800 Xiaoyao Li wrote: > On 12/13/2024 6:39 AM, Ira Weiny wrote: > > On Tue, Nov 05, 2024 at 01:23:49AM -0500, Xiaoyao Li wrote: > >> From: Isaku Yamahata > >> > >> When level trigger isn't supported on x86 platform, it used to be level before this patch like for

[PATCH v4 4/4] overcommit: introduce mem-lock=on-fault

2025-01-23 Thread Daniil Tatianin
Locking the memory without MCL_ONFAULT instantly prefaults any mmaped anonymous memory with a write-fault, which introduces a lot of extra overhead in terms of memory usage when all you want to do is to prevent kcompactd from migrating and compacting QEMU pages. Add an option to only lock pages laz

[PATCH v4 0/4] overcommit: introduce mem-lock-onfault

2025-01-23 Thread Daniil Tatianin
Currently, passing mem-lock=on to QEMU causes memory usage to grow by huge amounts: no memlock: $ ./qemu-system-x86_64 -overcommit mem-lock=off $ ps -p $(pidof ./qemu-system-x86_64) -o rss= 45652 $ ./qemu-system-x86_64 -overcommit mem-lock=off -enable-kvm $ ps -p $(pidof ./qem

[PATCH v4 2/4] system/vl: extract overcommit option parsing into a helper

2025-01-23 Thread Daniil Tatianin
This will be extended in the future commits, let's move it out of line right away so that it's easier to read. Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Peter Xu Signed-off-by: Daniil Tatianin --- system/vl.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletion

[PATCH v4 3/4] system: introduce a new MlockState enum

2025-01-23 Thread Daniil Tatianin
Replace the boolean value enable_mlock with an enum and add a helper to decide whether we should be calling os_mlock. This is a stepping stone towards introducing a new mlock mode, which will be the third possible state of this enum. Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Peter X

[PATCH v4 1/4] os: add an ability to lock memory on_fault

2025-01-23 Thread Daniil Tatianin
This will be used in the following commits to make it possible to only lock memory on fault instead of right away. Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Peter Xu Signed-off-by: Daniil Tatianin --- include/system/os-posix.h | 2 +- include/system/os-win32.h | 3 ++- migration

Re: [PATCH 07/10] rust: pl011: wrap registers with BqlRefCell

2025-01-23 Thread Paolo Bonzini
Il gio 23 gen 2025, 06:27 Zhao Liu ha scritto: > On Fri, Jan 17, 2025 at 10:26:54AM +0100, Paolo Bonzini wrote: > > Date: Fri, 17 Jan 2025 10:26:54 +0100 > > From: Paolo Bonzini > > Subject: [PATCH 07/10] rust: pl011: wrap registers with BqlRefCell > > X-Mailer: git-send-email 2.47.1 > > > > Thi

Re: [PATCH 06/10] rust: pl011: extract PL011Registers

2025-01-23 Thread Paolo Bonzini
Il gio 23 gen 2025, 04:25 Zhao Liu ha scritto: > > --- a/rust/hw/char/pl011/src/device_class.rs > > +++ b/rust/hw/char/pl011/src/device_class.rs > > @@ -6,11 +6,11 @@ > > use std::os::raw::{c_int, c_void}; > > > > use qemu_api::{ > > -bindings::*, c_str, vmstate_clock, vmstate_fields, vmsta

[PATCH v1 1/2] aspeed/wdt: Fix coding style

2025-01-23 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl. Signed-off-by: Jamin Lin --- hw/watchdog/wdt_aspeed.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/wdt_aspeed.c index 81f5c5189a..22e94e7b9c 100644 --- a/hw/watchdog/wdt_aspeed.c +++ b/hw/

[PATCH v1 2/2] aspeed/wdt: Support software reset mode for AST2600

2025-01-23 Thread Jamin Lin via
On the AST2400 and AST2500 platforms, the system can only be reset by enabling the WDT (Watchdog Timer) and waiting for the WDT timeout. However, starting from the AST2600 platform, the reset event can be triggered directly and intentionally by software, without relying on the WDT timeout. This me

[PATCH v1 0/2] wdt/aspeed: Support software reset mode for AST2600

2025-01-23 Thread Jamin Lin via
v1: Support software reset mode for AST2600 Jamin Lin (2): aspeed/wdt: Fix coding style aspeed/wdt: Support software reset mode for AST2600 hw/watchdog/wdt_aspeed.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) -- 2.34.1

Re: [RFC 06/13] rust: add bindings for memattrs

2025-01-23 Thread Paolo Bonzini
On 1/23/25 16:10, Zhao Liu wrote: Another solution would be to implement Zeroable for __BindgenBitfieldUnit in bindings.rs, but this is much nicer! It works even with old Rust versions and, even though it needs manual implementation of the trait each type, it doesn't require enumerating the fiel

[PATCH 1/2] hw/cxl/cxl-mailbox-utils: Add support for Media operations discovery commands (8.2.9.9.5.3)

2025-01-23 Thread Vinayak Holikatti
CXL spec 3.1 section 8.2.9.9.5.3 describes media operations commands. CXL devices supports media operations discovery command. Signed-off-by: Vinayak Holikatti --- hw/cxl/cxl-mailbox-utils.c | 130 - 1 file changed, 128 insertions(+), 2 deletions(-) d

[PATCH 2/2] hw/cxl/cxl-mailbox-utils: Add support for Media operations Sanitize and Write Zeros commands (8.2.9.9.5.3)

2025-01-23 Thread Vinayak Holikatti
CXL spec 3.1 section 8.2.9.9.5.3 describes media operations commands. CXL devices supports media operations Sanitize and Write zero command. Signed-off-by: Vinayak Holikatti --- hw/cxl/cxl-mailbox-utils.c | 217 ++-- include/hw/cxl/cxl_device.h | 11 ++

[PATCH 0/2] CXL CCI Media Operations

2025-01-23 Thread Vinayak Holikatti
CXL CCI media operations commands implmented as per CXL Specification 3.1 8.2.9.9.5.3 1) General(00h) - Discovery (00h) 2) Sanitize(01h - Sanitize (00h) Write zeros (01h) The patches are generated against the Johnathan's tree https://gitlab.com/jic23/qemu.git and branch cxl-2024-

[PATCH] rust/zeroable: Implement Zeroable with const_zero macro

2025-01-23 Thread Zhao Liu
`const_zero` crate provides a nice macro to zero type-specific constants, which doesn't need to enumerates the fields one by one. Introduce `const_zero` macro to QEMU (along with its documentation), and use it to simplify the implementation of `Zeroable` trait. This is valid since current types t

Save the date: KVM Forum 2025, Milan, Italy, September 4-5

2025-01-23 Thread Christian Borntraeger
### KVM Forum 2025 September 4-5, 2025 Milan, Italy ### On behalf of the program committee for the KVM Forum, I am pleased to announce KVM Forum 2025, September 4-5 2025 in Milan Italy. The call for papers will follow, but we want to give you the opportunity to pre

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

2025-01-23 Thread Mauro Carvalho Chehab
Em Thu, 23 Jan 2025 10:29:19 + Jonathan Cameron escreveu: > On Wed, 22 Jan 2025 16:46:20 +0100 > Mauro Carvalho Chehab wrote: > > > 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, whi

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

2025-01-23 Thread Igor Mammedov
On Thu, 23 Jan 2025 17:26:12 +0530 Ani Sinha wrote: > 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. > - F

Re: [PATCH] hw/mem: support zero memory size CXL device

2025-01-23 Thread Gregory Price
On Tue, Dec 24, 2024 at 03:13:15PM +, Jonathan Cameron wrote: > On Tue, 10 Dec 2024 14:13:29 -0500 > Gregory Price wrote: > > > On Tue, Dec 03, 2024 at 09:15:51PM +, Hongjian Fan wrote: > > > Hi Jonathan, > > > > > > I'm trying to emulate our memory appliance which is similar to a MH-SLD

Re: [PATCH v4 0/4] overcommit: introduce mem-lock-onfault

2025-01-23 Thread Peter Xu
On Thu, Jan 23, 2025 at 04:19:40PM +0300, Daniil Tatianin wrote: > Currently, passing mem-lock=on to QEMU causes memory usage to grow by > huge amounts: > > no memlock: > $ ./qemu-system-x86_64 -overcommit mem-lock=off > $ ps -p $(pidof ./qemu-system-x86_64) -o rss= > 45652 > > $

[RFC 0/6] RFC: hw/display/virtio-gpu: problems with coloured cursors

2025-01-23 Thread Daniel P . Berrangé
Help needed ! This is not for merge, just demo. I started working on a simple bug in the GTK-VNC 'alpha cursor' encoding support and in testing that uncovered what appear to be several bugs in QEMU related to cursor handling across different components. The two core behaviours are seen: * In so

[RFC 4/6] ui/vnc: pre-multiply alpha with alpha cursor

2025-01-23 Thread Daniel P . Berrangé
The RFB specification for the alpha cursor encoding requires that the alpha channel is pre-multiplied into the RGB components. This worked by luck previously since the virtio-gpu device was not reversing the pre-multiplication on data received from the guest. Now virtio-gpu is fixed, the VNC server

[RFC 6/6] ui: add ability to dump the raw cursor bytes

2025-01-23 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- hw/display/virtio-gpu.c | 1 + include/ui/console.h| 1 + ui/cursor.c | 21 + 3 files changed, 23 insertions(+) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 9952658df2..84836f52c4 100644 --- a/hw/

[RFC 2/6] hw/display/virtio-gpu.c: reverse alpha pre-multiplication

2025-01-23 Thread Daniel P . Berrangé
The cursor data we receive from the guest has had the alpha channel pre-multiplied into the RGB components. Reverse this before passing the cursor onto the backends. Without doing this, areas of the cursor with alpha are much less saturated than they are intended to be. This effect is visible with

[RFC 3/6] hw/display/virtio-gpu: fix pixel ordering from BGRA8888 to RGBA8888

2025-01-23 Thread Daniel P . Berrangé
Currently both the VNC and GTK displays are rendering coloured cursors with RGB components reversed. This originates with the data received from the guest, so virtio-gpu must reverse this again to get it back to the natural RGBA order expected by backends. Signed-off-by: Daniel P. Berrangé --

[RFC 5/6] ui/sdl: load cursor in RGBA8888 format not BGRA8888

2025-01-23 Thread Daniel P . Berrangé
The SDL code was loading cursor data in BGRA format which masked the problem with virtio-gpu not supplying data in RGBA format. Now that virtio-gpu is fixed, the SDL code needs to be fixed to match. Signed-off-by: Daniel P. Berrangé --- ui/sdl2.c | 2 +- 1 file changed, 1 insertion(+), 1

[RFC 1/6] ui: add more cursor helper methods

2025-01-23 Thread Daniel P . Berrangé
This adds helper methods to the QEMUCursor APIs for multiplying / unmultiplying the alpha channel into the RGB components; for swapping the RGB component order; for copying cursor objects; auto-freeing cursor objects. Signed-off-by: Daniel P. Berrangé --- include/ui/console.h | 6 ++ ui/cur

Re: [RFC 06/13] rust: add bindings for memattrs

2025-01-23 Thread Zhao Liu
> Another solution would be to implement Zeroable for __BindgenBitfieldUnit in > bindings.rs, but this is much nicer! It works even with old Rust versions > and, even though it needs manual implementation of the trait each type, it > doesn't require enumerating the fields one by one. So it's bett

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

2025-01-23 Thread Igor Mammedov
On Thu, 23 Jan 2025 10:02:17 + Jonathan Cameron wrote: > On Wed, 22 Jan 2025 16:46:19 +0100 > Mauro Carvalho Chehab wrote: > > > Store HEST table address at GPA, placing its content at > > hest_addr_le variable. > > > > Signed-off-by: Mauro Carvalho Chehab > > Reviewed-by: Jonathan Camero

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

2025-01-23 Thread Peter Xu
On Thu, Jan 23, 2025 at 05:33:53PM +0800, Xu Yilun wrote: > On Wed, Jan 22, 2025 at 11:43:01AM -0500, Peter Xu wrote: > > On Wed, Jan 22, 2025 at 05:41:31PM +0800, Xu Yilun wrote: > > > On Wed, Jan 22, 2025 at 03:30:05PM +1100, Alexey Kardashevskiy wrote: > > > > > > > > > > > > On 22/1/25 02:18,

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

2025-01-23 Thread Igor Mammedov
On Wed, 22 Jan 2025 16:46:18 +0100 Mauro Carvalho Chehab wrote: > 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 w

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

2025-01-23 Thread Peter Xu
On Thu, Jan 23, 2025 at 09:53:16AM +, Shivam Kumar wrote: > > > > On 22 Jan 2025, at 10:10 PM, Peter Xu wrote: > > > > !---| > > CAUTION: External Email > > > > |---

Re: [PATCH v1 2/2] aspeed/wdt: Support software reset mode for AST2600

2025-01-23 Thread Cédric Le Goater
On 1/23/25 09:19, Jamin Lin wrote: On the AST2400 and AST2500 platforms, the system can only be reset by enabling the WDT (Watchdog Timer) and waiting for the WDT timeout. However, starting from the AST2600 platform, the reset event can be triggered directly and intentionally by software, without

Re: [PATCH v1 1/2] aspeed/wdt: Fix coding style

2025-01-23 Thread Cédric Le Goater
On 1/23/25 09:19, Jamin Lin wrote: Fix coding style issues from checkpatch.pl. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater Thanks, C. --- hw/watchdog/wdt_aspeed.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/

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

2025-01-23 Thread Shivam Kumar
> On 23 Jan 2025, at 9:57 PM, Peter Xu wrote: > > !---| > CAUTION: External Email > > |---! > > On Thu, Jan 23, 2025 at 09:53:16AM +, Shivam Kumar wrote: >> >>

Re: [PATCH 0/4] intel_iommu: Reset vIOMMU after all the rest of devices

2025-01-23 Thread Peter Xu
On Thu, Jan 23, 2025 at 10:16:23AM +0100, Eric Auger wrote: > I haven't seen any follow-up on this series. Is anyone still looking at > this issue? Peter gave some guidance about the way to rework the reset > chain. Is it still up to date? I didn't continue looking at this issue since that time (a

Re: [PATCH 0/4] intel_iommu: Reset vIOMMU after all the rest of devices

2025-01-23 Thread Eric Auger
Hi Peter, On 1/23/25 6:57 PM, Peter Xu wrote: > On Thu, Jan 23, 2025 at 10:16:23AM +0100, Eric Auger wrote: >> I haven't seen any follow-up on this series. Is anyone still looking at >> this issue? Peter gave some guidance about the way to rework the reset >> chain. Is it still up to date? > I di

Re: [PATCH v6 40/60] hw/i386: add eoi_intercept_unsupported member to X86MachineState

2025-01-23 Thread Xiaoyao Li
On 1/23/2025 8:41 PM, Igor Mammedov wrote: On Tue, 5 Nov 2024 01:23:48 -0500 Xiaoyao Li wrote: Add a new bool member, eoi_intercept_unsupported, to X86MachineState with default value false. Set true for TDX VM. I'd rename it to enable_eoi_intercept, by default set to true for evrything and

Re: [v7 00/26] vfio-user client

2025-01-23 Thread John Levon
On Thu, Jan 23, 2025 at 02:50:16PM +0100, Cédric Le Goater wrote: > > > Hi, this is the 7th revision of the vfio-user client implementation. > > Well, among the reasons why we tend to push this at end of > the list are : Thanks for the steers. Just a note in case you're not aware - most of these

Re: [v7 00/26] vfio-user client

2025-01-23 Thread Cédric Le Goater
Hello John, On 1/23/25 11:11, John Levon wrote: On Wed, Jan 08, 2025 at 11:50:06AM +, John Levon wrote: Hi, this is the 7th revision of the vfio-user client implementation. First of all, thank you for your time reviewing the previous versions. The vfio-user framework consists of 3 parts:

Re: [PATCH] tcg: drop qemu_cpu_is_self() in tlb_flush_by_mmuidx[_async_work]

2025-01-23 Thread Igor Mammedov
On Thu, 23 Jan 2025 12:09:59 + Alex Bennée wrote: > Igor Mammedov writes: > > > On Thu, 23 Jan 2025 10:52:15 + > > Alex Bennée wrote: > > > >> Igor Mammedov writes: > >> > >> > QEMU will crash with following debug enabled > >> > # define DEBUG_TLB_GATE 1 > >> > # define DEBUG

[PATCH] target/riscv: rvv: Fix vslide1[up|down].vx unexpected result when XLEN=32 and SEW=64

2025-01-23 Thread Max Chou
When XLEN is 32 and SEW is 64, the original implementation of vslide1up.vx and vslide1down.vx helper functions fills the 32-bit value of rs1 into the first element of the destination vector register (rd), which is a 64-bit element. This commit attempted to resolve the issue by extending the rs1 va

Re: [RFC v4 0/5] Add packed virtqueue to shadow virtqueue

2025-01-23 Thread Eugenio Perez Martin
On Fri, Jan 24, 2025 at 6:47 AM Sahil Siddiq wrote: > > Hi, > > On 1/21/25 10:07 PM, Eugenio Perez Martin wrote: > > On Sun, Jan 19, 2025 at 7:37 AM Sahil Siddiq wrote: > >> > >> Hi, > >> > >> On 1/7/25 1:35 PM, Eugenio Perez Martin wrote: > >>> On Fri, Jan 3, 2025 at 2:06 PM Sahil Siddiq wrote:

Re: [PATCH v4 1/7] linux-user: netlink: Add missing IFA_PROTO to host_to_target_data_addr_rtattr()

2025-01-23 Thread Laurent Vivier
Le 22/01/2025 à 22:20, Helge Deller a écrit : * Laurent Vivier : [...] It would be cleaner to replace all the IFA_XXX by their QEMU_IFA_XXX. Thanks for review, Laurent! Below I've merged patch #1 and #7, as suggested by you. Is this OK? Yes, thanks Can you review? Reviewed-by: Laurent Vi

[PATCH] tests/qtest/qom-test: Test retrieval of machine class properties

2025-01-23 Thread Thomas Huth
There were recently some crashes that occurred when trying to retrieve the properties of machines. Let's add a test to avoid regression here. Signed-off-by: Thomas Huth --- Based-on: <20250117192106.471029-1-th...@redhat.com> Based-on: <20250123204708.1560305-1-th...@redhat.com> tests/qtest/

[PATCH 07/15] target/ppc: Restrict powerpc_checkstop() to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
Expose powerpc_checkstop() prototype, and move it to tcg-excp_helper.c, only built when TCG is available. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/internal.h| 2 ++ target/ppc/excp_helper.c | 26 -- target/ppc/tcg-excp_helper.c | 28 ++

[PATCH 12/15] target/ppc: Fix style in excp_helper.c

2025-01-23 Thread Philippe Mathieu-Daudé
Fix style in do_rfi() before moving the code around. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/excp_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 48e08d65bd7..661d9650d9f 100644 --- a/target/ppc

  1   2   >