Re: [PATCH v2 2/9] pnv/xive2: Structure/define alignment changes

2024-07-16 Thread Cédric Le Goater
On 7/15/24 20:33, Michael Kowal wrote: Made changes to some structure and define elements to ease review in next patchset. Signed-off-by: Michael Kowal Reviewed-by: Cédric Le Goater Thanks, C. --- hw/intc/pnv_xive2.c | 30 +++--- 1 file changed, 15 insertions

Re: [PATCH v2 8/9] pnv/xive2: Fail VST entry address computation if table has no VSD

2024-07-16 Thread Cédric Le Goater
On 7/15/24 20:33, Michael Kowal wrote: From: Frederic Barrat Fail VST entry address computation if firmware doesn't define a descriptor for one of the Virtualization Structure Tables (VST), there's no point in trying to compute the address of its entry. Abort the operation and log an error. S

Re: [PATCH v2 6/9] pnv/xive2: Enable VST NVG and NVC index compression

2024-07-16 Thread Cédric Le Goater
On 7/15/24 20:33, Michael Kowal wrote: From: Frederic Barrat Enable NVG and NVC VST tables for index compression which indicates the number of bits the address is shifted to the right for the table accesses. The compression values are defined as: - No compression 0001 - 1 bit shift

Re: [PATCH v2 5/9] pnv/xive2: Configure Virtualization Structure Tables through the PC

2024-07-16 Thread Cédric Le Goater
On 7/15/24 20:33, Michael Kowal wrote: From: Frederic Barrat Both the virtualization layer (VC) and presentation layer (PC) need to be configured to access the VSTs. Since the information is redundant, the xive model combines both into one set of tables and only the definitions going through th

Re: [PATCH v2 7/9] pnv/xive2: Set Translation Table for the NVC port space

2024-07-16 Thread Cédric Le Goater
On 7/15/24 20:33, Michael Kowal wrote: From: Frederic Barrat Set Translation Table for the NVC port space is missing. The xive model doesn't take into account the remapping of IO operations via the Set Translation Table but firmware is allowed to define it for the Notify Virtual Crowd (NVC), l

Re: [PATCH v2 9/9] pnv/xive2: Move xive2_nvp_pic_print_info() to xive2.c

2024-07-16 Thread Cédric Le Goater
On 7/15/24 20:33, Michael Kowal wrote: From: Frederic Barrat Moving xive2_nvp_pic_print_info() align with the other "pic_print_info" functions and allows us to call functions internal to xive2.c. In XIVE Gen 2 there were some minor changes to the TIMA header that were updated when printed. Ad

Re: [PATCH v2 3/9] pnv/xive: Support cache flush and queue sync inject with notifications

2024-07-16 Thread Cédric Le Goater
On 7/15/24 20:33, Michael Kowal wrote: From: Nicholas Piggin Adds support for writing a completion notification byte in memory whenever a cache flush or queue sync inject operation is requested by software. QEMU does not cache any of the XIVE data that is in memory and therefore it simply writ

[PATCH v4 1/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. With a tree-wide search, it was found that there are several cases where such a functionality is implemented so let's have one as a common

[PATCH v4 7/7] spice-app: Use qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() provides QEMU-specific fallback of runtime directory. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-9-akihiko.od...@daynix.com> --- ui/spice-app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/spice-app.c b/ui/spice-app.c index

Re: [PATCH v2 1/9] pnv/xive2: XIVE2 Cache Watch, Cache Flush and Sync Injection support

2024-07-16 Thread Cédric Le Goater
On 7/15/24 20:33, Michael Kowal wrote: From: Frederic Barrat XIVE offers a 'cache watch facility', which allows software to read/update a potentially cached table entry with no software lock. There's one such facility in the Virtualization Controller (VC) to update the ESB and END entries and o

[PATCH v4 3/7] qga: Use qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default state directory. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-5-akihiko.od...@daynix.com> --- qga/main.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qga/main.c b/qga/main.c index f4d5f15bb3

[PATCH v4 4/7] scsi: Use qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default paths. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-6-akihiko.od...@daynix.com> --- scsi/qemu-pr-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helpe

[PATCH v4 6/7] util: Remove qemu_get_local_state_dir()

2024-07-16 Thread Akihiko Odaki
There are no users of the function anymore. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-8-akihiko.od...@daynix.com> --- include/qemu/osdep.h | 8 util/oslib-posix.c | 6 -- util/oslib-win32.c | 10 -- 3 files changed, 24 deletions(-) diff --git a/in

[PATCH v4 5/7] module: Use qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the path to module upgrades. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-7-akihiko.od...@daynix.com> --- util/module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/module.c b/util/module.c index 32e26316

[PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. With a tree-wide search, it was found that there are several cases where such a functionality is implemented so let's have one as a common

[PATCH v4 2/7] ivshmem-server: Use qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default PID file path. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-3-akihiko.od...@daynix.com> --- contrib/ivshmem-server/main.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/contrib/iv

Re: [PATCH v2 4/9] pnv/xive2: Add NVG and NVC to cache watch facility

2024-07-16 Thread Cédric Le Goater
On 7/15/24 20:33, Michael Kowal wrote: From: Frederic Barrat The cache watch facility uses the same register interface to handle entries in the NVP, NVG and NVC tables. A bit-field in the 'watchX specification' register tells the table type. So far, that bit-field was not read and the code assu

Re: [PATCH] hw/scsi/lsi53c895a: bump instruction limit in scripts processing to fix regression

2024-07-16 Thread Sven Schnelle
Fiona Ebner writes: > Commit 9876359990 ("hw/scsi/lsi53c895a: add timer to scripts > processing") reduced the maximum allowed instruction count by > a factor of 100 all the way down to 100. > > This causes the "Check Point R81.20 Gaia" appliance [0] to fail to > boot after fully finishing the ins

Re: [PATCH 6/7] backends/iommufd: Get rid of qemu_open_old()

2024-07-16 Thread Yi Liu
On 2024/7/15 16:21, Zhao Liu wrote: For qemu_open_old(), osdep.h said: Don't introduce new usage of this function, prefer the following qemu_open/qemu_create that take an "Error **errp". So replace qemu_open_old() with qemu_open(). Cc: Yi Liu Cc: Eric Auger Cc: Zhenzhong Duan Signed-off-b

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Michael Tokarev
16.07.2024 10:27, Akihiko Odaki wrote: qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. Since runtime dir is always used with a filename within, how about char *qemu_get_runtime_pat

RE: [PATCH v4 00/12] hw/iommufd: IOMMUFD Dirty Tracking

2024-07-16 Thread Duan, Zhenzhong
>-Original Message- >From: Joao Martins >Subject: [PATCH v4 00/12] hw/iommufd: IOMMUFD Dirty Tracking > >This small series adds support for IOMMU dirty tracking support via the >IOMMUFD backend. The hardware capability is available on most recent x86 >hardware. The series is divided orga

[PATCH v2 2/5] target/arm: Allow setting 'pmu' only for host and max

2024-07-16 Thread Akihiko Odaki
Setting 'pmu' does not make sense for CPU types emulating physical CPUs. Signed-off-by: Akihiko Odaki --- target/arm/cpu.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 14d4eca12740..8c180c679ce2 100644 --- a/target/arm/cpu.c +++ b/target/ar

[PATCH v2 4/5] target/arm: Always add pmu property

2024-07-16 Thread Akihiko Odaki
kvm-steal-time and sve properties are added for KVM even if the corresponding features are not available. Always add pmu property too. Signed-off-by: Akihiko Odaki --- target/arm/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index

[PATCH v2 0/5] target/arm/kvm: Report PMU unavailability

2024-07-16 Thread Akihiko Odaki
target/arm/kvm.c checked PMU availability but claimed PMU is available even if it is not. In fact, Asahi Linux supports KVM but lacks PMU support. Only advertise PMU availability only when it is really available. Fixes: dc40d45ebd8e ("target/arm/kvm: Move kvm_arm_get_host_cpu_features and unexpor

[PATCH v2 5/5] target/arm/kvm: Report PMU unavailability

2024-07-16 Thread Akihiko Odaki
target/arm/kvm.c checked PMU availability but claimed PMU is available even if it is not. In fact, Asahi Linux supports KVM but lacks PMU support. Only advertise PMU availability only when it is really available. Fixes: dc40d45ebd8e ("target/arm/kvm: Move kvm_arm_get_host_cpu_features and unexpor

[PATCH v2 3/5] target/arm: Do not allow setting 'pmu' for hvf

2024-07-16 Thread Akihiko Odaki
hvf currently does not support PMU. Signed-off-by: Akihiko Odaki --- target/arm/cpu.c | 4 1 file changed, 4 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 8c180c679ce2..9e1d15701468 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1603,6 +1603,10 @@ static vo

[PATCH v2 1/5] tests/arm-cpu-features: Do not assume PMU availability

2024-07-16 Thread Akihiko Odaki
Asahi Linux supports KVM but lacks PMU support. Signed-off-by: Akihiko Odaki --- tests/qtest/arm-cpu-features.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c index 966c65d5c3e4..cfd6f7735354 10064

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH] cpu: Free queued CPU work

2024-07-16 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH] meson: Use -fno-sanitize=function when available

2024-07-16 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH] disas: Fix build against Capstone v6

2024-07-16 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH] hw/scsi/lsi53c895a: bump instruction limit in scripts processing to fix regression

2024-07-16 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH] scsi: fix regression and honor bootindex again for legacy drives

2024-07-16 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH] qemu/timer: Add host ticks function for LoongArch

2024-07-16 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH] RAMBlock: use return value of ram_block_discard_require() as errno

2024-07-16 Thread Philippe Mathieu-Daudé
On 16/7/24 08:42, Zhenzhong Duan wrote: When ram_block_discard_require() fails, errno is passed to error_setg_errno(). It's a stale value or 0 which is unrelated to ram_block_discard_require(). As ram_block_discard_require() already returns -EBUSY in failure case, use it as errno for error_setg_

Re: [PATCH] esp.c: remove transfer size check from DMA DATA IN and DATA OUT transfers

2024-07-16 Thread Philippe Mathieu-Daudé
On 16/7/24 08:46, Philippe Mathieu-Daudé wrote: On 16/7/24 00:01, Mark Cave-Ayland wrote: On 15/07/2024 07:48, Philippe Mathieu-Daudé wrote: On 14/7/24 00:42, Mark Cave-Ayland wrote: The transfer size check was originally added to prevent consecutive DMA TI commands from causing an assert() d

Re: [PATCH] Manpage: Update description of 'user=username' for '-run-with'

2024-07-16 Thread Paolo Bonzini
> Manpage: the description of '-runs' didn't show this parameter will use > setuid, so the customer might get confused when 'elevateprivileges=deny' is > used. Since '-runas' is going to be deprecated and replaced by this > parameter in the coming qemu9.1, add the message here. Queued, thanks. I

Re: [PATCH v2] plugins/stoptrigger: TCG plugin to stop execution under conditions

2024-07-16 Thread Simon Hamelin
On 7/16/24 01:08, Pierrick Bouvier wrote: On 7/15/24 01:09, Simon Hamelin wrote: Hello Pierrick, Could you share a bit more information on the final goal, if possible? Is that used for fuzzing binaries, security analysis, or other things? I'm currently using this plugin for security analy

Re: [PATCH v2 1/5] tests/arm-cpu-features: Do not assume PMU availability

2024-07-16 Thread Philippe Mathieu-Daudé
On 16/7/24 10:28, Akihiko Odaki wrote: Asahi Linux supports KVM but lacks PMU support. Signed-off-by: Akihiko Odaki --- tests/qtest/arm-cpu-features.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 4/5] target/arm: Always add pmu property

2024-07-16 Thread Philippe Mathieu-Daudé
On 16/7/24 10:28, Akihiko Odaki wrote: kvm-steal-time and sve properties are added for KVM even if the corresponding features are not available. Always add pmu property too. Signed-off-by: Akihiko Odaki --- target/arm/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-b

Re: [PATCH V2 01/11] machine: alloc-anon option

2024-07-16 Thread Igor Mammedov
On Sun, 30 Jun 2024 12:40:24 -0700 Steve Sistare wrote: > Allocate anonymous memory using mmap MAP_ANON or memfd_create depending > on the value of the anon-alloc machine property. This affects > memory-backend-ram objects, guest RAM created with the global -m option > but without an associated

Re: [PATCH v4 01/12] vfio/pci: Extract mdev check into an helper

2024-07-16 Thread Cédric Le Goater
Hello Joao On 7/12/24 13:46, Joao Martins wrote: In preparation to skip initialization of the HostIOMMUDevice for mdev, extract the checks that validate if a device is an mdev into helpers. A vfio_set_mdev() is created, and subsystems consult VFIODevice::mdev to check if it's mdev or not. Sign

Re: [PATCH v4 02/12] vfio/iommufd: Don't initialize nor set a HOST_IOMMU_DEVICE with mdev

2024-07-16 Thread Cédric Le Goater
On 7/12/24 13:46, Joao Martins wrote: mdevs aren't "physical" devices and when asking for backing IOMMU info, it fails the entire provisioning of the guest. Fix that by skipping HostIOMMUDevice initialization in the presence of mdevs, and skip setting an iommu device when it is known to be an mde

Re: [PATCH v2 5/5] target/arm/kvm: Report PMU unavailability

2024-07-16 Thread Philippe Mathieu-Daudé
On 16/7/24 10:28, Akihiko Odaki wrote: target/arm/kvm.c checked PMU availability but claimed PMU is available even if it is not. In fact, Asahi Linux supports KVM but lacks PMU support. Only advertise PMU availability only when it is really available. Fixes: dc40d45ebd8e ("target/arm/kvm: Move k

Re: [PATCH v4 03/12] backends/iommufd: Extend iommufd_backend_get_device_info() to fetch HW capabilities

2024-07-16 Thread Cédric Le Goater
On 7/12/24 13:46, Joao Martins wrote: The helper will be able to fetch vendor agnostic IOMMU capabilities supported both by hardware and software. Right now it is only iommu dirty tracking. Signed-off-by: Joao Martins Reviewed-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH v4 00/12] hw/iommufd: IOMMUFD Dirty Tracking

2024-07-16 Thread Joao Martins
On 16/07/2024 09:20, Duan, Zhenzhong wrote: > > >> -Original Message- >> From: Joao Martins >> Subject: [PATCH v4 00/12] hw/iommufd: IOMMUFD Dirty Tracking >> >> This small series adds support for IOMMU dirty tracking support via the >> IOMMUFD backend. The hardware capability is availab

Re: [PATCH v4 04/12] vfio/iommufd: Return errno in iommufd_cdev_attach_ioas_hwpt()

2024-07-16 Thread Cédric Le Goater
On 7/12/24 13:46, Joao Martins wrote: In preparation to implement auto domains have the attach function return the errno it got during domain attach instead of a bool. -EINVAL is tracked to track domain incompatibilities, and decide whether to create a new IOMMU domain. Signed-off-by: Joao Mart

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
On 2024/07/16 17:06, Michael Tokarev wrote: 16.07.2024 10:27, Akihiko Odaki wrote: qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. Since runtime dir is always used with a filename wi

Re: [PATCH v4 01/12] vfio/pci: Extract mdev check into an helper

2024-07-16 Thread Joao Martins
On 16/07/2024 10:21, Cédric Le Goater wrote: > Hello Joao > > On 7/12/24 13:46, Joao Martins wrote: >> In preparation to skip initialization of the HostIOMMUDevice for mdev, >> extract the checks that validate if a device is an mdev into helpers. >> >> A vfio_set_mdev() is created, and subsystems

[PATCH 0/2] first batch of hpet fixes

2024-07-16 Thread Paolo Bonzini
Extracted from the patch that TaiseiIto tested. While not sufficient to fix their problems, this is a step in the right direction. Paolo Bonzini (2): hpet: fix clamping of period hpet: fix HPET_TN_SETVAL for high 32-bits of the comparator hw/timer/hpet.c | 25 - 1 fi

[PATCH 1/2] hpet: fix clamping of period

2024-07-16 Thread Paolo Bonzini
When writing a new period, the clamping should use a maximum value rather than a bit mask. Also, when writing the high bits new_val is shifted right by 32, so the maximum allowed period should also be shifted right. Signed-off-by: Paolo Bonzini --- hw/timer/hpet.c | 6 -- 1 file changed, 4

[PATCH 2/2] hpet: fix HPET_TN_SETVAL for high 32-bits of the comparator

2024-07-16 Thread Paolo Bonzini
Commit 3787324101b ("hpet: Fix emulation of HPET_TN_SETVAL (Jan Kiszka)", 2009-04-17) applied the fix only to the low 32-bits of the comparator, but it should be done for the high bits as well. Otherwise, the high 32-bits of the comparator cannot be written and they remain fixed to 0x. Co

Re: [PATCH v2 2/5] target/arm: Allow setting 'pmu' only for host and max

2024-07-16 Thread Peter Maydell
On Tue, 16 Jul 2024 at 09:28, Akihiko Odaki wrote: > > Setting 'pmu' does not make sense for CPU types emulating physical > CPUs. > > Signed-off-by: Akihiko Odaki > --- > target/arm/cpu.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/target/arm/cpu.c b/target/arm/cpu.c > index

Re: [PATCH] disas: Fix build against Capstone v6

2024-07-16 Thread Peter Maydell
On Tue, 16 Jul 2024 at 09:48, Paolo Bonzini wrote: > > Queued, thanks. Could you add Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2438 to the commit message? thanks -- PMM

Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation

2024-07-16 Thread Cédric Le Goater
On 7/12/24 13:46, Joao Martins wrote: There's generally two modes of operation for IOMMUFD: * The simple user API which intends to perform relatively simple things with IOMMUs e.g. DPDK. It generally creates an IOAS and attach to VFIO and mainly performs IOAS_MAP and UNMAP. * The native IOMMUFD

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Michael Tokarev
16.07.2024 12:32, Akihiko Odaki wrote: On 2024/07/16 17:06, Michael Tokarev wrote: Since runtime dir is always used with a filename within, how about    char *qemu_get_runtime_path(const char *filename) which return RUNTIME_DIR/filename instead of just RUNTIME_DIR ? I'm not sure. Such a fu

[PATCH 0/6] VIRTIO-IOMMU/VFIO: Revert IOMMUDevice clear and fix hotunplug

2024-07-16 Thread Eric Auger
1b889d6e39c3 ("virtio-iommu: Clear IOMMUDevice when VFIO device is unplugged" fixes the VFIO hotplug/hotunplug/hotplug sequence by clearing the IOMMUDevice which backs the VFIO device. However this brings other troubles such as a memory corruption. Even when fixing some cleanups that were missed o

[PATCH 3/6] virtio-iommu: Free [host_]resv_ranges on unset_iommu_devices

2024-07-16 Thread Eric Auger
We are currently missing the deallocation of the [host_]resv_regions in case of hot unplug. Also to make things more simple let's rule out the case where multiple HostIOMMUDevices would be aliased and attached to the same IOMMUDevice. This allows to remove the handling of conflicting Host reserved

[PATCH 4/6] virtio-iommu: Remove the end point on detach

2024-07-16 Thread Eric Auger
We currently miss the removal of the endpoint in case of detach. Signed-off-by: Eric Auger --- hw/virtio/virtio-iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index 2de41ab412..440dfa6e92 100644 --- a/hw/virtio/virtio-iommu.c +++ b

[PATCH 6/6] virtio-iommu: Add trace point on virtio_iommu_detach_endpoint_from_domain

2024-07-16 Thread Eric Auger
Add a trace point on virtio_iommu_detach_endpoint_from_domain(). Signed-off-by: Eric Auger --- hw/virtio/virtio-iommu.c | 1 + hw/virtio/trace-events | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index 440dfa6e92..59ef4fb217 100644 --

[PATCH 1/6] Revert "virtio-iommu: Clear IOMMUDevice when VFIO device is unplugged"

2024-07-16 Thread Eric Auger
This reverts commit 1b889d6e39c32d709f1114699a014b381bcf1cb1. There are different problems with that tentative fix: - Some resources are left dangling (resv_regions, host_resv_ranges) and memory subregions are left attached to the root MR although freed as embedded in the sdev IOMMUDevice. Fi

[PATCH 5/6] hw/vfio/common: Add vfio_listener_region_del_iommu trace event

2024-07-16 Thread Eric Auger
Trace when VFIO gets notified about the deletion of an IOMMU MR. Also trace the name of the region in the add_iommu trace message. Signed-off-by: Eric Auger --- hw/vfio/common.c | 3 ++- hw/vfio/trace-events | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/vfio/comm

[PATCH 2/6] virtio-iommu: Remove probe_done

2024-07-16 Thread Eric Auger
Now we have switched to PCIIOMMUOps to convey host IOMMU information, the host reserved regions are transmitted when the PCIe topology is built. This happens way before the virtio-iommu driver calls the probe request. So let's remove the probe_done flag that allowed to check the probe was not done

Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation

2024-07-16 Thread Joao Martins
On 16/07/2024 10:39, Cédric Le Goater wrote: > On 7/12/24 13:46, Joao Martins wrote: >> There's generally two modes of operation for IOMMUFD: >> >> * The simple user API which intends to perform relatively simple things >> with IOMMUs e.g. DPDK. It generally creates an IOAS and attach to VFIO >> an

Re: [PATCH] RAMBlock: use return value of ram_block_discard_require() as errno

2024-07-16 Thread David Hildenbrand
On 16.07.24 08:42, Zhenzhong Duan wrote: When ram_block_discard_require() fails, errno is passed to error_setg_errno(). It's a stale value or 0 which is unrelated to ram_block_discard_require(). As ram_block_discard_require() already returns -EBUSY in failure case, use it as errno for error_setg

Re: [PATCH V15 0/7] Add architecture agnostic code to support vCPU Hotplug

2024-07-16 Thread Igor Mammedov
On Tue, 16 Jul 2024 03:38:29 + Salil Mehta wrote: > Hi Igor, > > On 15/07/2024 15:11, Igor Mammedov wrote: > > On Mon, 15 Jul 2024 14:19:12 + > > Salil Mehta wrote: > > > >>> From: qemu-arm-bounces+salil.mehta=huawei@nongnu.org >>> arm-bounces+salil.mehta=huawei@nongnu.o

Re: [PATCH v4 1/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Daniel P . Berrangé
On Tue, Jul 16, 2024 at 04:27:31PM +0900, Akihiko Odaki wrote: > qemu_get_runtime_dir() returns a dynamically allocated directory path > that is appropriate for storing runtime files. It corresponds to "run" > directory in Unix. > > With a tree-wide search, it was found that there are several case

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Daniel P . Berrangé
On Tue, Jul 16, 2024 at 11:06:57AM +0300, Michael Tokarev wrote: > 16.07.2024 10:27, Akihiko Odaki wrote: > > qemu_get_runtime_dir() returns a dynamically allocated directory path > > that is appropriate for storing runtime files. It corresponds to "run" > > directory in Unix. > > Since runtime di

Re: [PATCH 0/2] Postcopy migration and vhost-user errors

2024-07-16 Thread Prasad Pandit
Hello Peter, On Mon, 15 Jul 2024 at 19:10, Peter Xu wrote: > IMHO it's better we debug and fix all the issues before merging this one, > otherwise we may overlook something. * Well we don't know where the issue is, not sure where the fix may go in, ex. if the issue turns out to be how virsh(1) i

Re: [PATCH v4 06/12] vfio/{iommufd,container}: Remove caps::aw_bits

2024-07-16 Thread Cédric Le Goater
On 7/12/24 13:46, Joao Martins wrote: In preparation to moving HostIOMMUDevice realize() being able to called early during attach_device(), remove properties that rely on container being initialized. This means removing caps::aw_bits which requires the bcontainer::iova_ranges to be inititalized

Re: [PATCH 1/2] vhost-user: add a write-read lock

2024-07-16 Thread Prasad Pandit
On Mon, 15 Jul 2024 at 18:57, Peter Xu wrote: > I think it shouldn't be a major deal in most cases, if the extended cycles > only cover a bunch of instructions. In special case we can still use > WITH_QEMU_LOCK_GUARD, but I'd start with the simple first and only switch > if necessary. * Okay, wil

Re: [PATCH v4 07/12] vfio/{iommufd,container}: Initialize HostIOMMUDeviceCaps during attach_device()

2024-07-16 Thread Cédric Le Goater
On 7/12/24 13:46, Joao Martins wrote: Fetch IOMMU hw raw caps behind the device and thus move the HostIOMMUDevice::realize() to be done during the attach of the device. It allows it to cache the information obtained from IOMMU_GET_HW_INFO from iommufd early on. However, while legacy HostIOMMUDevi

Re: [PATCH v3 1/9] hw/riscv/virt-acpi-build.c: Add namespace devices for PLIC and APLIC

2024-07-16 Thread Igor Mammedov
On Mon, 15 Jul 2024 22:41:21 +0530 Sunil V L wrote: > As per the requirement ACPI_080 in the RISC-V Boot and Runtime Services > (BRS) specification [1], PLIC and APLIC should be in namespace as well. > So, add them using the defined HID. > > [1] - https://github.com/riscv-non-isa/riscv-brs/blob

Re: [PATCH v3 2/9] hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART

2024-07-16 Thread Igor Mammedov
On Mon, 15 Jul 2024 22:41:22 +0530 Sunil V L wrote: > The requirement ACPI_060 in the RISC-V BRS specification [1], requires > NS16550 compatible UART to have the HID RSCV0003. So, update the HID for > the UART. > > [1] - https://github.com/riscv-non-isa/riscv-brs/commits/main/acpi.adoc this sho

Re: [PATCH v3 4/9] acpi/gpex: Create PCI link devices outside PCI root bridge

2024-07-16 Thread Igor Mammedov
On Mon, 15 Jul 2024 22:41:24 +0530 Sunil V L wrote: > Currently, PCI link devices (PNP0C0F) are always created within the > scope of the PCI root bridge. However, RISC-V needs these link devices > to be created outside to ensure the probing order in the OS. This > matches the example given in the

Re: [PATCH] hw/display/bcm2835_fb: fix fb_use_offsets condition

2024-07-16 Thread Peter Maydell
On Sat, 13 Jul 2024 at 17:04, SamJakob wrote: > > It is common practice when implementing double-buffering > on VideoCore to do so by multiplying the height of the > virtual buffer by the number of virtual screens desired > (i.e., two - in the case of double-bufferr

Re: [PATCH v4 07/12] vfio/{iommufd,container}: Initialize HostIOMMUDeviceCaps during attach_device()

2024-07-16 Thread Joao Martins
On 16/07/2024 11:20, Cédric Le Goater wrote: > On 7/12/24 13:46, Joao Martins wrote: >> Fetch IOMMU hw raw caps behind the device and thus move the >> HostIOMMUDevice::realize() to be done during the attach of the device. It >> allows it to cache the information obtained from IOMMU_GET_HW_INFO from

Re: [PATCH] target/arm: Free GDB command data

2024-07-16 Thread Peter Maydell
On Sun, 14 Jul 2024 at 11:43, Akihiko Odaki wrote: > > Signed-off-by: Akihiko Odaki > --- > target/arm/gdbstub.c | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c > index c3a9b5eb1ed2..03f77362efc1 100644 > --- a/target/

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Paolo Bonzini
On Tue, Jul 16, 2024 at 11:56 AM Daniel P. Berrangé wrote: > > On Tue, Jul 16, 2024 at 11:06:57AM +0300, Michael Tokarev wrote: > > 16.07.2024 10:27, Akihiko Odaki wrote: > > > qemu_get_runtime_dir() returns a dynamically allocated directory path > > > that is appropriate for storing runtime files

Re: [PATCH v2] hw/timer/hpet: Fix wrong HPET interrupts

2024-07-16 Thread Paolo Bonzini
On 7/13/24 13:54, TaiseiIto wrote: Before this commit, there are 3 problems about HPET timer interrupts. First, HPET periodic timers cause a too early interrupt before HPET main counter value reaches a value written its comparator value register. Second, disabled HPET timers whose comparator valu

Re: [PATCH v4 1/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
On 2024/07/16 18:53, Daniel P. Berrangé wrote: On Tue, Jul 16, 2024 at 04:27:31PM +0900, Akihiko Odaki wrote: qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. With a tree-wide search,

Re: [PATCH v4 1/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Daniel P . Berrangé
On Tue, Jul 16, 2024 at 07:52:00PM +0900, Akihiko Odaki wrote: > On 2024/07/16 18:53, Daniel P. Berrangé wrote: > > On Tue, Jul 16, 2024 at 04:27:31PM +0900, Akihiko Odaki wrote: > > > qemu_get_runtime_dir() returns a dynamically allocated directory path > > > that is appropriate for storing runtim

Re: [PATCH] target/arm: Free GDB command data

2024-07-16 Thread Alex Bennée
Peter Maydell writes: > On Sun, 14 Jul 2024 at 11:43, Akihiko Odaki wrote: >> >> Signed-off-by: Akihiko Odaki >> --- >> target/arm/gdbstub.c | 9 ++--- >> 1 file changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c >> index c3a9b5eb1ed2..0

[PATCH V16 0/7] Add architecture agnostic code to support vCPU Hotplug

2024-07-16 Thread Salil Mehta via
[Note: References are present at the last after the revision history] Virtual CPU hotplug support is being added across various architectures [1][3]. This series adds various code bits common across all architectures: 1. vCPU creation and Parking code refactor [Patch 1] 2. Update ACPI GED framewo

[PATCH V16 2/7] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file

2024-07-16 Thread Salil Mehta via
CPU ctrl-dev MMIO region length could be used in ACPI GED and various other architecture specific places. Move ACPI_CPU_HOTPLUG_REG_LEN macro to more appropriate common header file. Signed-off-by: Salil Mehta Reviewed-by: Alex Bennée Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Review

[PATCH V16 5/7] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change

2024-07-16 Thread Salil Mehta via
CPUs Control device(\\_SB.PCI0) register interface for the x86 arch is IO port based and existing CPUs AML code assumes _CRS objects would evaluate to a system resource which describes IO Port address. But on ARM arch CPUs control device(\\_SB.PRES) register interface is memory-mapped hence _CRS ob

[PATCH V16 4/7] hw/acpi: Update GED _EVT method AML with CPU scan

2024-07-16 Thread Salil Mehta via
OSPM evaluates _EVT method to map the event. The CPU hotplug event eventually results in start of the CPU scan. Scan figures out the CPU and the kind of event(plug/unplug) and notifies it back to the guest. Update the GED AML _EVT method with the call to method \\_SB.CPUS.CSCN (via \\_SB.GED.CSCN)

[PATCH V16 1/7] accel/kvm: Extract common KVM vCPU {creation, parking} code

2024-07-16 Thread Salil Mehta via
KVM vCPU creation is done once during the vCPU realization when Qemu vCPU thread is spawned. This is common to all the architectures as of now. Hot-unplug of vCPU results in destruction of the vCPU object in QOM but the corresponding KVM vCPU object in the Host KVM is not destroyed as KVM doesn't

[PATCH V16 6/7] physmem: Add helper function to destroy CPU AddressSpace

2024-07-16 Thread Salil Mehta via
Virtual CPU Hot-unplug leads to unrealization of a CPU object. This also involves destruction of the CPU AddressSpace. Add common function to help destroy the CPU AddressSpace. Signed-off-by: Salil Mehta Tested-by: Vishnu Pajjuri Reviewed-by: Gavin Shan Tested-by: Xianglai Li Tested-by: Miguel

[PATCH V16 3/7] hw/acpi: Update ACPI GED framework to support vCPU Hotplug

2024-07-16 Thread Salil Mehta via
ACPI GED (as described in the ACPI 6.4 spec) uses an interrupt listed in the _CRS object of GED to intimate OSPM about an event. Later then demultiplexes the notified event by evaluating ACPI _EVT method to know the type of event. Use ACPI GED to also notify the guest kernel about any CPU hot(un)pl

[PATCH V16 7/7] gdbstub: Add helper function to unregister GDB register space

2024-07-16 Thread Salil Mehta via
Add common function to help unregister the GDB register space. This shall be done in context to the CPU unrealization. Note: These are common functions exported to arch specific code. For example, for ARM this code is being referred in associated arch specific patch-set: Link: https://lore.kerne

[PATCH v1 00/11] Convert avocado tests to normal Python unittests

2024-07-16 Thread Thomas Huth
The Avocado v88 that we use in QEMU is already on a life support system: It is not supported by upstream anymore, and with the latest versions of Python, it won't work anymore since it depends on the "imp" module that has been removed in Python 3.12. There have been several attempts to update the

[PATCH 06/11] tests/functional: Convert some tests that download files via fetch_asset()

2024-07-16 Thread Thomas Huth
Now that we've got a working fetch_asset() function, we can convert some Avocado tests that use this function for downloading their required files. Signed-off-by: Thomas Huth --- MAINTAINERS | 12 +++ tests/functional/meson.build | 25 ++

[PATCH 02/11] tests/functional: Convert simple avocado tests into standalone python tests

2024-07-16 Thread Thomas Huth
These test are rather simple and don't need any modifications apart from adjusting the "from avocado_qemu" line. To ease debugging, make the files executable and add a shebang line and Python '__main__' handling, too, so that these tests can now be run by executing them directly. Signed-off-by: Th

Re: [PATCH v4 1/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
On 2024/07/16 19:54, Daniel P. Berrangé wrote: On Tue, Jul 16, 2024 at 07:52:00PM +0900, Akihiko Odaki wrote: On 2024/07/16 18:53, Daniel P. Berrangé wrote: On Tue, Jul 16, 2024 at 04:27:31PM +0900, Akihiko Odaki wrote: qemu_get_runtime_dir() returns a dynamically allocated directory path that

[PATCH 09/11] tests/functional: Set up logging

2024-07-16 Thread Thomas Huth
Create log files for each test separately, one file that contains the basic logging and one that contains the console output. Signed-off-by: Thomas Huth --- tests/functional/qemu_test/__init__.py | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/f

[PATCH 10/11] tests/functional: Convert the s390x avocado tests into standalone tests

2024-07-16 Thread Thomas Huth
These tests use archive.lzma_uncompress() from the Avocado utils, so provide a small helper function for this, based on the standard lzma module from Python instead. And while we're at it, replace the MD5 hashes in the topology test with proper SHA256 hashes, since MD5 should not be used anymore n

[PATCH 04/11] tests/functional: Add python-based tests to the meson build system

2024-07-16 Thread Thomas Huth
Integrate the new python-based test framework with the meson build system. Since these tests now require the pycotap module, make sure that it gets installed in the venv. The changes to the meson.build files are partly based on an earlier patch by Ani Sinha (but heavily modified by Thomas Huth e.g

[PATCH 11/11] gitlab-ci: Add "check-functional" to the build tests

2024-07-16 Thread Thomas Huth
Now that we converted many tests from the "check-avocado" test suite to the "check-functional" test suite, we should make sure that these also get tested in the CI. Signed-off-by: Thomas Huth --- .gitlab-ci.d/buildtest-template.yml | 3 +- .gitlab-ci.d/buildtest.yml | 60 ++

[PATCH 03/11] tests/functional: Convert avocado tests that just need a small adjustment

2024-07-16 Thread Thomas Huth
These simple tests can be converted to stand-alone tests quite easily, e.g. by just setting the machine to 'none' now manually or by adding "-cpu" command line parameters, since we don't support the corresponding avocado tags in the new python test framework. Signed-off-by: Thomas Huth --- .../t

  1   2   3   4   5   >