[PATCH] tests/qtest: remove unused variables

2023-11-15 Thread zhujun2
These variables are never referenced in the code, just remove them Signed-off-by: zhujun2 --- tests/qtest/test-filter-mirror.c | 2 +- tests/qtest/test-filter-redirector.c | 4 ++-- tests/qtest/virtio-net-test.c| 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/te

Re: [PATCH] tests/qtest: remove unused variables

2023-11-15 Thread Thomas Huth
On 15/11/2023 09.00, zhujun2 wrote: These variables are never referenced in the code, just remove them Signed-off-by: zhujun2 --- tests/qtest/test-filter-mirror.c | 2 +- tests/qtest/test-filter-redirector.c | 4 ++-- tests/qtest/virtio-net-test.c| 2 +- 3 files changed, 4 inse

Re: [PATCH v6 01/21] backends/iommufd: Introduce the iommufd object

2023-11-15 Thread Cédric Le Goater
On 11/15/23 05:06, Duan, Zhenzhong wrote: -Original Message- From: Cédric Le Goater Sent: Tuesday, November 14, 2023 9:29 PM Subject: Re: [PATCH v6 01/21] backends/iommufd: Introduce the iommufd object On 11/14/23 11:09, Zhenzhong Duan wrote: From: Eric Auger Introduce an iommufd

Re: [PATCH] tests/avocado/intel_iommu: Add asset hashes to avoid warnings

2023-11-15 Thread Eric Auger
Hi Thomas, On 11/15/23 07:20, Thomas Huth wrote: > On 14/11/2023 21.42, Eric Auger wrote: >> Hi Thomas, >> >> On 11/14/23 15:35, Thomas Huth wrote: >>> The intel_iommu test is currently succeeding with annoying warnings. >> nit: you may have precised the nature of the warning or quotes > > The ann

[PATCH RFC 2/2] hw/arm: Add minimal support for the B-L475E-IOT01A board

2023-11-15 Thread ~inesvarhol
From: Inès Varhol This commit adds a new B-L475E-IOT01A board using the STM32L475VG SoC. The implementation is derived from the Netduino Plus 2 machine. There are no peripherals implemented, only memory regions. Signed-off-by: default avatarArnaud Minier Signed-off-by: Inès Varhol --- configs

[PATCH RFC 0/2] hw/arm: Add minimal support for the B-L475E-IOT01A board

2023-11-15 Thread ~inesvarhol
This patch allows to emulate the B-L475E-IOT01A ARM Cortex-M4 board. This is RFC since the implementation isn't complete yet, there are no implemented peripherals, and it's a first contribution to QEMU. Inès Varhol (2): hw/arm: Add minimal support for the STM32L475VG SoC hw/arm: Add minimal su

[PATCH RFC 1/2] hw/arm: Add minimal support for the STM32L475VG SoC

2023-11-15 Thread ~inesvarhol
From: Inès Varhol This patch adds a new STM32L475VG SoC, it is necessary to add support for the B-L475E-IOT01A board. The implementation is derived from the STM32F405 SoC. The implementation contains no peripherals, only memory regions are implemented. Signed-off-by: Arnaud Minier Signed-off-by

Re: [PATCH trivial 13/21] hw/net/cadence_gem.c: spelling fixes: Octects

2023-11-15 Thread Luc Michel
On 19:58 Tue 14 Nov , Michael Tokarev wrote: > Fixes: c755c943aa2e "hw/net/cadence_gem: use REG32 macro for register > definitions" > Cc: Luc Michel > Cc: Peter Maydell > Signed-off-by: Michael Tokarev Reviewed-by: Luc Michel > --- > hw/net/cadence_gem.c | 8 > 1 file changed,

Re: [PATCH] monitor: flush messages on abort

2023-11-15 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Fri, Nov 03, 2023 at 03:51:00PM -0400, Steven Sistare wrote: >> On 11/3/2023 1:33 PM, Daniel P. Berrangé wrote: >> > On Fri, Nov 03, 2023 at 09:01:29AM -0700, Steve Sistare wrote: >> >> Buffered monitor output is lost when abort() is called. The pattern >> >> erro

[PATCH 1/4] vfio/pci: Move VFIODevice initializations in vfio_instance_init

2023-11-15 Thread Zhenzhong Duan
Some of the VFIODevice initializations is in vfio_realize, move all of them in vfio_instance_init. No functional change intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/vfio/pci.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/vfi

[PATCH 2/4] vfio/platform: Move VFIODevice initializations in vfio_platform_instance_init

2023-11-15 Thread Zhenzhong Duan
Some of the VFIODevice initializations is in vfio_platform_realize, move all of them in vfio_platform_instance_init. No functional change intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/vfio/platform.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(

[PATCH 4/4] vfio/ccw: Move VFIODevice initializations in vfio_ccw_instance_init

2023-11-15 Thread Zhenzhong Duan
Some of the VFIODevice initializations is in vfio_ccw_realize, move all of them in vfio_ccw_instance_init. No functional change intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/vfio/ccw.c | 30 +++--- 1 file changed, 15 insertions(+), 15 del

[PATCH 0/4] VFIO device init cleanup

2023-11-15 Thread Zhenzhong Duan
Hi, This is a clean up based on Cedric's suggestion at https://lists.gnu.org/archive/html/qemu-devel/2023-11/msg02722.html VFIO device initializations are all moved from realize to instance_init. Based on https://github.com/legoater/qemu/commits/vfio-8.2 Thanks Zhenzhong Zhenzhong Duan (4):

[PATCH 3/4] vfio/ap: Move VFIODevice initializations in vfio_ap_instance_init

2023-11-15 Thread Zhenzhong Duan
Some of the VFIODevice initializations is in vfio_ap_realize, move all of them in vfio_ap_instance_init. No functional change intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/vfio/ap.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(

Re: [PATCH trivial 06/21] docs/devel/migration.rst: spelling fix: doen't

2023-11-15 Thread Michael Tokarev
15.11.2023 09:46, Thomas Huth: .. The "really-really-fixed" one (without resending): -  This combination is not possible as the qemu-5.1 doen't understand +  This combination is not possible as the qemu-5.1 doesn't understand     pc-5.2 machine type.  So nothing to worry here. ;) Actually the

Re: [PATCH for-8.2] linux-user: Fix loaddr computation for some elf files

2023-11-15 Thread Michael Tokarev
14.11.2023 23:17, Richard Henderson: The file offset of the load segment is not relevant to the low address, only the beginning of the virtual address page. Cc: qemu-sta...@nongnu.org Fixes: a93934fecd4 ("elf: take phdr offset into account when calculating the program load address") Resolves: h

Re: [PATCH v2 3/3] hw/nvme: Add SPDM over DOE support

2023-11-15 Thread Klaus Jensen
On Oct 17 15:21, Alistair Francis wrote: > From: Wilfred Mallawa > > Setup Data Object Exchance (DOE) as an extended capability for the NVME > controller and connect SPDM to it (CMA) to it. > > Signed-off-by: Wilfred Mallawa > Signed-off-by: Alistair Francis Acked-by: Klaus Jensen I have no

Re: [RFC PATCH v3 65/78] hw/nvme: add fallthrough pseudo-keyword

2023-11-15 Thread Klaus Jensen
On Oct 13 11:46, Emmanouil Pitsidianakis wrote: > In preparation of raising -Wimplicit-fallthrough to 5, replace all > fall-through comments with the fallthrough attribute pseudo-keyword. > > Signed-off-by: Emmanouil Pitsidianakis > --- > hw/nvme/ctrl.c | 24 > hw/nvme/d

Re: [PATCH] migration: free 'saddr' since be no longer used

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 11:27:39AM +0800, Zongmin Zhou wrote: > Since socket_parse() will allocate memory for 'saddr', > and its value will pass to 'addr' that allocated > by migrate_uri_parse(),so free 'saddr' to avoid memory leak. > > Fixes: 72a8192e225c ("migration: convert migration 'uri' into

Re: [PATCH v3 0/8] Add powernv10 I2C devices and tests

2023-11-15 Thread Cédric Le Goater
Nick, On 11/14/23 20:56, Glenn Miles wrote: This series of patches includes support, tests and fixes for adding PCA9552 and PCA9554 I2C devices to the powernv10 chip. The PCA9552 device is used for PCIe slot hotplug power control and monitoring, while the PCA9554 device is used for presence det

Re: [PATCH] linux-headers: Synchronize linux headers from linux v6.7.0-rc1

2023-11-15 Thread gaosong
Hi, Can this patch be merged in during the 8.2 cycle? Thanks. Song Gao 在 2023/11/14 上午9:54, Tianrui Zhao 写道: Use the scripts/update-linux-headers.sh to synchronize linux headers from linux v6.7.0-rc1. We mainly want to add the loongarch linux headers and then add the loongarch kvm support base

Re: [PATCH v3 02/70] RAMBlock: Add support of KVM private guest memfd

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:14:11AM -0500, Xiaoyao Li wrote: > Add KVM guest_memfd support to RAMBlock so both normal hva based memory > and kvm guest memfd based private memory can be associated in one RAMBlock. > > Introduce new flag RAM_GUEST_MEMFD. When it's set, it calls KVM ioctl to > create

[PATCH RESEND v2 1/2] i386: Fix conditional CONFIG_SYNDBG enablement

2023-11-15 Thread Vitaly Kuznetsov
Putting HYPERV_FEAT_SYNDBG entry under "#ifdef CONFIG_SYNDBG" in 'kvm_hyperv_properties' array is wrong: as HYPERV_FEAT_SYNDBG is not the highest feature number, the result is an empty (zeroed) entry in the array (and not a skipped entry!). hyperv_feature_supported() is designed to check that all C

[PATCH RESEND v2 0/2] i386: Fix Hyper-V Gen1 guests stuck on boot with 'hv-passthrough'

2023-11-15 Thread Vitaly Kuznetsov
Changes since v1/v1 RESEND: - No changes. Hyper-V Gen1 guests are getting stuck on boot when 'hv-passthrough' is used. While 'hv-passthrough' is a debug only feature, this significantly limit its usefullness. While debugging the problem, I found that there are two loosely connected issues: - 'hv-p

[PATCH RESEND v2 2/2] i386: Exclude 'hv-syndbg' from 'hv-passthrough'

2023-11-15 Thread Vitaly Kuznetsov
Windows with Hyper-V role enabled doesn't boot with 'hv-passthrough' when no debugger is configured, this significantly limits the usefulness of the feature as there's no support for subtracting Hyper-V features from CPU flags at this moment (e.g. "-cpu host,hv-passthrough,-hv-syndbg" does not work

Re: [PATCH] softmmu/memory: use memcpy for multi-byte accesses

2023-11-15 Thread Peter Maydell
On Tue, 14 Nov 2023 at 21:18, Richard Henderson wrote: > > On 11/14/23 12:55, Patrick Venture wrote: > > Avoids unaligned pointer issues. > > > > Reviewed-by: Chris Rauer > > Reviewed-by: Peter Foley > > Signed-off-by: Patrick Venture > > --- > > system/memory.c | 16 > > 1

Re: [PATCH] softmmu/memory: use memcpy for multi-byte accesses

2023-11-15 Thread Peter Maydell
On Tue, 14 Nov 2023 at 20:55, Patrick Venture wrote: > Avoids unaligned pointer issues. > It would be nice to be more specific in the commit message here, by describing what kind of guest behaviour or machine config runs into this problem, and whether this happens in a situation users are likely

Re: [PATCH v3 06/70] kvm: Introduce support for memory_attributes

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:14:15AM -0500, Xiaoyao Li wrote: > Introduce the helper functions to set the attributes of a range of > memory to private or shared. > > This is necessary to notify KVM the private/shared attribute of each gpa > range. KVM needs the information to decide the GPA needs to

Re: [PATCH v3 10/70] kvm: handle KVM_EXIT_MEMORY_FAULT

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:14:19AM -0500, Xiaoyao Li wrote: > From: Chao Peng > > Currently only KVM_MEMORY_EXIT_FLAG_PRIVATE in flags is valid when > KVM_EXIT_MEMORY_FAULT happens. It indicates userspace needs to do > the memory conversion on the RAMBlock to turn the memory into desired > attrib

Re: [PATCH v3 14/70] target/i386: Implement mc->kvm_type() to get VM type

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:14:23AM -0500, Xiaoyao Li wrote: > Implement mc->kvm_type() for i386 machines. It provides a way for user > to create SW_PROTECTE_VM. Small typo there missing final 'D' in 'PROTECTED' > > Also store the vm_type in machinestate to other code to query what the > VM type

Re: [PATCH v1] target/i386/host-cpu: Use IOMMU addr width for passthrough devices on Intel platforms

2023-11-15 Thread Gerd Hoffmann
Hi, > > +if (iommu_phys_bits && phys_bits > iommu_phys_bits) { > > +phys_bits = iommu_phys_bits; > > +if (!warned2) { > > +warn_report("Using physical bits (%u)" > > +" to prevent VFIO mapping failures", > > +iommu_p

Re: [PATCH v3 18/70] i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIES

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:14:27AM -0500, Xiaoyao Li wrote: > KVM provides TDX capabilities via sub command KVM_TDX_CAPABILITIES of > IOCTL(KVM_MEMORY_ENCRYPT_OP). Get the capabilities when initializing > TDX context. It will be used to validate user's setting later. > > Since there is no interfac

Re: [PATCH v3 26/70] i386/tdx: Initialize TDX before creating TD vcpus

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:14:35AM -0500, Xiaoyao Li wrote: > Invoke KVM_TDX_INIT in kvm_arch_pre_create_vcpu() that KVM_TDX_INIT > configures global TD configurations, e.g. the canonical CPUID config, > and must be executed prior to creating vCPUs. > > Use kvm_x86_arch_cpuid() to setup the CPUID

Re: [PATCH v5 02/31] target/hppa: Remove object_class_is_abstract()

2023-11-15 Thread BALATON Zoltan
On Wed, 15 Nov 2023, Gavin Shan wrote: No need to check if @oc is abstract because it has been covered by cpu_class_by_name(). Signed-off-by: Gavin Shan --- target/hppa/cpu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 04de1689d7..fc4d2abad7 100

Re: [PATCH] tests/avocado/virtio-gpu: Fix test_vhost_user_vga_virgl for edid support

2023-11-15 Thread Antonio Caggiano
Hi, On 14/11/2023 21:34, Thomas Huth wrote: The "edid" feature has been added to vhost-user-gpu in commit c06444261e20 ("contrib/vhost-user-gpu: implement get_edid feature"), so waiting for "features: +virgl -edid" in the test does not work anymore, it's "+edid" instead of "-edid" now! While we

Re: [PATCH v5 02/31] target/hppa: Remove object_class_is_abstract()

2023-11-15 Thread Gavin Shan
On 11/15/23 21:18, BALATON Zoltan wrote: On Wed, 15 Nov 2023, Gavin Shan wrote: No need to check if @oc is abstract because it has been covered by cpu_class_by_name(). Signed-off-by: Gavin Shan --- target/hppa/cpu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/hppa/cpu.c b/target/h

Re: [PATCH v5 02/31] target/hppa: Remove object_class_is_abstract()

2023-11-15 Thread BALATON Zoltan
On Wed, 15 Nov 2023, Gavin Shan wrote: On 11/15/23 21:18, BALATON Zoltan wrote: On Wed, 15 Nov 2023, Gavin Shan wrote: No need to check if @oc is abstract because it has been covered by cpu_class_by_name(). Signed-off-by: Gavin Shan --- target/hppa/cpu.c | 1 - 1 file changed, 1 deletion(-) d

Re: [PATCH 2/2] vhost-scsi: Add support for a worker thread per virtqueue

2023-11-15 Thread Stefano Garzarella
On Mon, Nov 13, 2023 at 06:36:44PM -0600, Mike Christie wrote: This adds support for vhost-scsi to be able to create a worker thread per virtqueue. Right now for vhost-net we get a worker thread per tx/rx virtqueue pair which scales nicely as we add more virtqueues and CPUs, but for scsi we get t

Re: [PATCH 0/4] VFIO device init cleanup

2023-11-15 Thread Philippe Mathieu-Daudé
On 15/11/23 09:32, Zhenzhong Duan wrote: Zhenzhong Duan (4): vfio/pci: Move VFIODevice initializations in vfio_instance_init vfio/platform: Move VFIODevice initializations in vfio_platform_instance_init vfio/ap: Move VFIODevice initializations in vfio_ap_instance_init vfio/ccw:

Re: [PATCH v6 11/21] vfio/pci: Make vfio cdev pre-openable by passing a file handle

2023-11-15 Thread Philippe Mathieu-Daudé
Hi Zhenzhong, On 14/11/23 11:09, Zhenzhong Duan wrote: This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Together with the earlier support of pre-opening /dev

Re: [PATCH v1] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2023-11-15 Thread Sebastian Ott
Hi, On Mon, 13 Nov 2023, Shaoqin Huang wrote: +``pmu-filter={A,D}:start-end[;...]`` +KVM implements pmu event filtering to prevent a guest from being able to + sample certain events. It has the following format: + + pmu-filter="{A,D}:start-end[;{A,D}:start-end...]" + +

Re: [PATCH v6 01/21] backends/iommufd: Introduce the iommufd object

2023-11-15 Thread Eric Auger
Hi Zhenzhong, On 11/14/23 11:09, Zhenzhong Duan wrote: > From: Eric Auger > > Introduce an iommufd object which allows the interaction > with the host /dev/iommu device. > > The /dev/iommu can have been already pre-opened outside of qemu, > in which case the fd can be passed directly along with t

Re: [PATCH 2/2] vhost-scsi: Add support for a worker thread per virtqueue

2023-11-15 Thread Stefan Hajnoczi
On Wed, Nov 15, 2023 at 12:43:02PM +0100, Stefano Garzarella wrote: > On Mon, Nov 13, 2023 at 06:36:44PM -0600, Mike Christie wrote: > > This adds support for vhost-scsi to be able to create a worker thread > > per virtqueue. Right now for vhost-net we get a worker thread per > > tx/rx virtqueue pa

Re: [PATCH v6 11/21] vfio/pci: Make vfio cdev pre-openable by passing a file handle

2023-11-15 Thread Cédric Le Goater
On 11/15/23 13:09, Philippe Mathieu-Daudé wrote: Hi Zhenzhong, On 14/11/23 11:09, Zhenzhong Duan wrote: This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Tog

Re: [PATCH 1/4] vfio/pci: Move VFIODevice initializations in vfio_instance_init

2023-11-15 Thread Cédric Le Goater
On 11/15/23 09:32, Zhenzhong Duan wrote: Some of the VFIODevice initializations is in vfio_realize, move all of them in vfio_instance_init. No functional change intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/vfio/pci.c | 10 ++ 1 file changed, 6 inser

Re: [PATCH] tests/avocado/reverse_debugging: Disable the ppc64 tests by default

2023-11-15 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 07:23:01AM +0100, Thomas Huth wrote: > On 15/11/2023 02.15, Nicholas Piggin wrote: > > On Wed Nov 15, 2023 at 4:29 AM AEST, Thomas Huth wrote: > > > On 14/11/2023 17.37, Philippe Mathieu-Daudé wrote: > > > > On 14/11/23 17:31, Thomas Huth wrote: > > > > > The tests seem curr

Re: [PATCH v6 02/21] util/char_dev: Add open_cdev()

2023-11-15 Thread Eric Auger
On 11/14/23 11:09, Zhenzhong Duan wrote: > From: Yi Liu > > /dev/vfio/devices/vfioX may not exist. In that case it is still possible > to open /dev/char/$major:$minor instead. Add helper function to abstract > the cdev open. > > Suggested-by: Jason Gunthorpe > Signed-off-by: Yi Liu > Signed-o

Re: [PATCH v6 03/21] vfio/common: return early if space isn't empty

2023-11-15 Thread Eric Auger
On 11/14/23 11:09, Zhenzhong Duan wrote: > This is a trivial optimization. If there is active container in space, > vfio_reset_handler will never be unregistered. So revert the check of > space->containers and return early. > > Signed-off-by: Zhenzhong Duan Reviewed-by: Eric Auger Thanks Eri

Re: [PATCH] block-backend: per-device throttling of BLOCK_IO_ERROR reports

2023-11-15 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > From: Leonid Kaplan > > BLOCK_IO_ERROR events comes from guest, so we must throttle them. Really? Can you describe how a guest can trigger these errors? > We still want per-device throttling, so let's use device id as a key. > > Signed-off-by: Leonid Kap

[PATCH] docs/system: Add recommendations to Hyper-V enlightenments doc

2023-11-15 Thread Vitaly Kuznetsov
While hyperv.rst already has all currently implemented Hyper-V enlightenments documented, it may be unclear what is the recommended set to achieve the best result. Add the corresponding section to the doc. Signed-off-by: Vitaly Kuznetsov --- docs/system/i386/hyperv.rst | 30 +

Re: [PATCH v6 05/21] vfio/iommufd: Relax assert check for iommufd backend

2023-11-15 Thread Eric Auger
On 11/14/23 11:09, Zhenzhong Duan wrote: > Currently iommufd doesn't support dirty page sync yet, > but it will not block us doing live migration if VFIO > migration is force enabled. > > So in this case we allow set_dirty_page_tracking to be NULL. > Note we don't need same change for query_dirt

Re: [PATCH v3 1/2] qom: new object to associate device to numa node

2023-11-15 Thread Markus Armbruster
writes: > From: Ankit Agrawal > > NVIDIA GPU's support MIG (Mult-Instance GPUs) feature [1], which allows > partitioning of the GPU device resources (including device memory) into > several (upto 8) isolated instances. Each of the partitioned memory needs > a dedicated NUMA node to operate. The

[PATCH 0/2] hw/pci-host: Fix Designware no address match behavior

2023-11-15 Thread Max Hsu
IMX6DQRM Rev4, in chapter 48.3.9.1, specifies that iATU is instantiated inside the PCIe core, translating TLPs in and out of the PCIe core. Currently, the model faces issues with TLPs using memory addresses not registered on the iATU. The Designware spec (48.3.9.2 for outbound, 48.3.9.3 for inboun

[PATCH 1/2] hw/pci-host: Designware: Fix inbound iATU no address match behavior

2023-11-15 Thread Max Hsu
IMX6DQRM Rev4, in chapter 48.3.9.3, specifies that for inbound iATU with no address match: 'If there is no match, then the address is untranslated.' The current model implementation registers inbound region 0 as untranslated dummy, intending to serve as a passing medium for the no-match address beh

[PATCH 2/2] hw/pci-host: Designware: Add outbound iATU no address match behavior

2023-11-15 Thread Max Hsu
IMX6DQRM Rev4, in chapter 48.3.9.2, specifies for outbound iATU with no address match: 'If there is no address match, then the address is untranslated.' The current model implementation only considers inbound occurrences, neglecting outbound scenarios. To address this, we introduce a new MemoryReg

Re: [PATCH-for-9.0 0/8] hw/pci-host/designware: QOM shuffling (Host bridge <-> Root function)

2023-11-15 Thread Philippe Mathieu-Daudé
Cc'ing Sifive developers :) On 12/10/23 14:18, Philippe Mathieu-Daudé wrote: Hi, While trying this PCI host bridge in a hegerogeneous setup I noticed few discrepancies due to the fact that host bridge pieces were managed by the root function. This series move these pieces (ViewPort and MSI reg

[PATCH] tests/avocado/multiprocess: Add asset hashes to silence warnings

2023-11-15 Thread Thomas Huth
The multiprocess test is currently succeeding with an annoying warning: (1/2) tests/avocado/multiprocess.py:Multiprocess.test_multiprocess_x86_64: WARN: Test passed but there were warnings during execution. Check the log for details In the log, you can find an entry like: WARNI|

[PATCH 07/16] hw/uefi: add var-service-auth.c

2023-11-15 Thread Gerd Hoffmann
This implements authenticated variable handling (AuthVariableLib in edk2). For now this implements the bare minimum to make secure boot work, by initializing the 'SecureBoot' variable. Support for authenticated variable updates is not implemented yet, for now they are read-only so the guest can n

[PATCH 02/16] hw/uefi: add include/hw/uefi/var-service-edk2.h

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

[PATCH 15/16] hw/arm: add uefi variable support to virt machine type

2023-11-15 Thread Gerd Hoffmann
Add -machine virt,x-uefi-vars={on,off} property. Default is off. When enabled wire up the uefi-vars-sysbus device. TODO: wire up jsonfile property. Signed-off-by: Gerd Hoffmann --- include/hw/arm/virt.h | 2 ++ hw/arm/virt.c | 41 + 2 files chan

[PATCH 00/16] hw/uefi: add uefi variable service

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

[PATCH 08/16] hw/uefi: add var-service-policy.c

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

[PATCH 12/16] hw/uefi: add to meson

2023-11-15 Thread Gerd Hoffmann
Wire up uefi-vars in the build system. Signed-off-by: Gerd Hoffmann --- hw/meson.build | 1 + hw/uefi/meson.build | 12 meson.build | 1 + 3 files changed, 14 insertions(+) create mode 100644 hw/uefi/meson.build diff --git a/hw/meson.build b/hw/meson.build index f01

[PATCH 10/16] hw/uefi: add trace-events

2023-11-15 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/uefi/trace-events | 16 1 file changed, 16 insertions(+) create mode 100644 hw/uefi/trace-events diff --git a/hw/uefi/trace-events b/hw/uefi/trace-events new file mode 100644 index ..baeda81bbe12 --- /dev/null +++ b/hw/uefi/trace-

[PATCH 13/16] hw/uefi: add uefi-vars-sysbus device

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

[PATCH 05/16] hw/uefi: add var-service-core.c

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

[PATCH 03/16] hw/uefi: add include/hw/uefi/var-service.h

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

[PATCH 04/16] hw/uefi: add var-service-guid.c

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

[PATCH 09/16] hw/uefi: add support for storing persistent variables on disk

2023-11-15 Thread Gerd Hoffmann
Define qapi schema for the uefi variable store state. Use it and the generated visitor helper functions to store persistent variables in JSON format on disk. Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-json.c | 194 + qapi/meson.build | 1

[PATCH 01/16] hw/uefi: add include/hw/uefi/var-service-api.h

2023-11-15 Thread Gerd Hoffmann
This file defines the register interface of the uefi-vars device. It's only a handful of registers: magic value, command and status registers, location and size of the communication buffer. Signed-off-by: Gerd Hoffmann --- include/hw/uefi/var-service-api.h | 40 +++ 1

[PATCH 14/16] hw/uefi: add uefi-vars-isa device

2023-11-15 Thread Gerd Hoffmann
This adds isa bindings for the variable service. Usage: qemu-system-x86_64 -device uefi-vars-isa,jsonfile=/path/to/uefivars.json Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-isa.c | 88 +++ hw/uefi/Kconfig | 6 +++ hw/uefi/meson.build

[PATCH 11/16] hw/uefi: add to Kconfig

2023-11-15 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/Kconfig | 1 + hw/uefi/Kconfig | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 hw/uefi/Kconfig diff --git a/hw/Kconfig b/hw/Kconfig index 9ca7b38c31f1..af41bd4e0b40 100644 --- a/hw/Kconfig +++ b/hw/Kconfig @@ -38,6 +38,7 @@ source smbios/Kco

[PATCH 06/16] hw/uefi: add var-service-vars.c

2023-11-15 Thread Gerd Hoffmann
This is the uefi variable service (EfiSmmVariableProtocol), providing functions for reading and writing variables. Signed-off-by: Gerd Hoffmann --- hw/uefi/var-service-vars.c | 602 + 1 file changed, 602 insertions(+) create mode 100644 hw/uefi/var-service-va

[PATCH 16/16] docs: add uefi variable service documentation and TODO list.

2023-11-15 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- docs/devel/index-internals.rst | 1 + docs/devel/uefi-vars.rst | 66 ++ hw/uefi/TODO.md| 17 + 3 files changed, 84 insertions(+) create mode 100644 docs/devel/uefi-vars.rst create mode 100644 hw/uefi

[PATCH-for-8.2] hw/net/can/xlnx-zynqmp: Avoid underflow while popping TX FIFO

2023-11-15 Thread Philippe Mathieu-Daudé
Per https://docs.xilinx.com/r/en-US/ug1085-zynq-ultrascale-trm/Message-Format Message Format The same message format is used for RXFIFO, TXFIFO, and TXHPB. Each message includes four words (16 bytes). Software must read and write all four words regardless of the actual number of data by

QEMU snapshotting

2023-11-15 Thread Brian Cain
Alexander, Bandan, Paolo, Stefan, Manuel, Hi, I'm Brian and I maintain the Hexagon arch for QEMU. Elia, a security researcher at Qualcomm is exploring ways to fuzz some hexagon OS kernel with QEMU and in particular leveraging snapshotting, inspired by your research and more. I'm not an expert

Re: [PATCH] monitor: flush messages on abort

2023-11-15 Thread Steven Sistare
On 11/6/2023 5:10 AM, Daniel P. Berrangé wrote: > On Fri, Nov 03, 2023 at 03:51:00PM -0400, Steven Sistare wrote: >> On 11/3/2023 1:33 PM, Daniel P. Berrangé wrote: >>> On Fri, Nov 03, 2023 at 09:01:29AM -0700, Steve Sistare wrote: Buffered monitor output is lost when abort() is called. Th

[PATCH-for-8.2?] tests/avocado: Make fetch_asset() inconditionally require a crypto hash

2023-11-15 Thread Philippe Mathieu-Daudé
In a perfect world we'd have reproducible tests, but then we'd be sure we run the same binaries. If a binary artifact isn't hashed, we have no idea what we are running. Therefore enforce hashing for all our artifacts. With this change, unhashed artifacts produce: $ avocado run tests/avocado/mul

Re: [PATCH-for-8.2?] tests/avocado: Make fetch_asset() inconditionally require a crypto hash

2023-11-15 Thread Philippe Mathieu-Daudé
On 15/11/23 16:32, Philippe Mathieu-Daudé wrote: In a perfect world we'd have reproducible tests, but then we'd be sure we run the same binaries. If a binary artifact isn't hashed, we have no idea what we are running. Therefore enforce hashing for all our artifacts. With this change, unhashed ar

Re: [PATCH-for-8.2?] tests/avocado: Make fetch_asset() inconditionally require a crypto hash

2023-11-15 Thread Thomas Huth
On 15/11/2023 16.32, Philippe Mathieu-Daudé wrote: In a perfect world we'd have reproducible tests, but then we'd be sure we run the same binaries. If a binary artifact isn't hashed, we have no idea what we are running. Therefore enforce hashing for all our artifacts. With this change, unhashed

Re: [PATCH] monitor: flush messages on abort

2023-11-15 Thread Steven Sistare
On 11/15/2023 3:41 AM, Markus Armbruster wrote: > Daniel P. Berrangé writes: > >> On Fri, Nov 03, 2023 at 03:51:00PM -0400, Steven Sistare wrote: >>> On 11/3/2023 1:33 PM, Daniel P. Berrangé wrote: On Fri, Nov 03, 2023 at 09:01:29AM -0700, Steve Sistare wrote: > Buffered monitor output i

Re: [PATCH 16/16] docs: add uefi variable service documentation and TODO list.

2023-11-15 Thread Eric Blake
On Wed, Nov 15, 2023 at 04:12:38PM +0100, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann > --- > docs/devel/index-internals.rst | 1 + > docs/devel/uefi-vars.rst | 66 ++ > hw/uefi/TODO.md| 17 + > 3 files changed, 84 insertions(

Re: [PATCH v6 06/21] vfio/iommufd: Add support for iova_ranges and pgsizes

2023-11-15 Thread Eric Auger
On 11/14/23 14:46, Cédric Le Goater wrote: > On 11/14/23 11:09, Zhenzhong Duan wrote: >> Some vIOMMU such as virtio-iommu use IOVA ranges from host side to >> setup reserved ranges for passthrough device, so that guest will not >> use an IOVA range beyond host support. >> >> Use an uAPI of IOMMU

[PATCH 1/2] linux-user/elfload: test return value of getrlimit

2023-11-15 Thread Thomas Weißschuh
Should getrlimit() fail the value of dumpsize.rlimit_cur may not be initialized. Avoid reading garbage data by checking the return value of getrlimit. Signed-off-by: Thomas Weißschuh --- linux-user/elfload.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/linux-user/elfload

Re: [PATCH v3 1/8] ppc/pnv: Add pca9552 to powernv10 for PCIe hotplug power control

2023-11-15 Thread Miles Glenn
On Wed, 2023-11-15 at 08:28 +0100, Cédric Le Goater wrote: > On 11/14/23 20:56, Glenn Miles wrote: > > The Power Hypervisor code expects to see a pca9552 device connected > > to the 3rd PNV I2C engine on port 1 at I2C address 0x63 (or left- > > justified address of 0xC6). This is used by hyperviso

[PATCH 0/2] linux-user: two fixes to coredump generation

2023-11-15 Thread Thomas Weißschuh
: 9c673a41eefc50f1cb2fe3c083e7de842c7d276a change-id: 20231115-qemu-user-dumpable-d499c0396103 Best regards, -- Thomas Weißschuh

[PATCH 2/2] linux-user/elfload: check PR_GET_DUMPABLE before creating coredump

2023-11-15 Thread Thomas Weißschuh
A process can opt-out of coredump creation by calling prctl(PR_SET_DUMPABLE, 0). linux-user passes this call from the guest through to the operating system. >From there it can be read back again to avoid creating coredumps from qemu-user itself if the guest chose so. Signed-off-by: Thomas Weißschu

Re: [PATCH] migration: free 'saddr' since be no longer used

2023-11-15 Thread Peter Xu
On Wed, Nov 15, 2023 at 09:49:09AM +, Daniel P. Berrangé wrote: > On Wed, Nov 15, 2023 at 11:27:39AM +0800, Zongmin Zhou wrote: > > Since socket_parse() will allocate memory for 'saddr', > > and its value will pass to 'addr' that allocated > > by migrate_uri_parse(),so free 'saddr' to avoid mem

Re: [PATCH 2/2] vhost-scsi: Add support for a worker thread per virtqueue

2023-11-15 Thread Mike Christie
On 11/15/23 5:43 AM, Stefano Garzarella wrote: > On Mon, Nov 13, 2023 at 06:36:44PM -0600, Mike Christie wrote: >> This adds support for vhost-scsi to be able to create a worker thread >> per virtqueue. Right now for vhost-net we get a worker thread per >> tx/rx virtqueue pair which scales nicely a

Re: [PATCH] monitor: flush messages on abort

2023-11-15 Thread Markus Armbruster
Steven Sistare writes: > On 11/6/2023 5:10 AM, Daniel P. Berrangé wrote: >> On Fri, Nov 03, 2023 at 03:51:00PM -0400, Steven Sistare wrote: >>> On 11/3/2023 1:33 PM, Daniel P. Berrangé wrote: On Fri, Nov 03, 2023 at 09:01:29AM -0700, Steve Sistare wrote: > Buffered monitor output is lost

Re: [PATCH-for-8.2?] tests/avocado: Make fetch_asset() inconditionally require a crypto hash

2023-11-15 Thread Alex Bennée
Philippe Mathieu-Daudé writes: s/inconditionally/unconditionally/ Otherwise: Reviewed-by: Alex Bennée -- Alex Bennée Virtualisation Tech Lead @ Linaro

Re: [PATCH 2/2] vhost-scsi: Add support for a worker thread per virtqueue

2023-11-15 Thread Mike Christie
On 11/15/23 6:57 AM, Stefan Hajnoczi wrote: > On Wed, Nov 15, 2023 at 12:43:02PM +0100, Stefano Garzarella wrote: >> On Mon, Nov 13, 2023 at 06:36:44PM -0600, Mike Christie wrote: >>> This adds support for vhost-scsi to be able to create a worker thread >>> per virtqueue. Right now for vhost-net we

Re: [PATCH] softmmu/memory: use memcpy for multi-byte accesses

2023-11-15 Thread Patrick Venture
On Wed, Nov 15, 2023 at 2:30 AM Peter Maydell wrote: > On Tue, 14 Nov 2023 at 21:18, Richard Henderson > wrote: > > > > On 11/14/23 12:55, Patrick Venture wrote: > > > Avoids unaligned pointer issues. > > > > > > Reviewed-by: Chris Rauer > > > Reviewed-by: Peter Foley > > > Signed-off-by: Patr

Re: [PATCH] softmmu/memory: use memcpy for multi-byte accesses

2023-11-15 Thread Patrick Venture
On Wed, Nov 15, 2023 at 2:35 AM Peter Maydell wrote: > On Tue, 14 Nov 2023 at 20:55, Patrick Venture wrote: > > Avoids unaligned pointer issues. > > > > It would be nice to be more specific in the commit message here, by > describing what kind of guest behaviour or machine config runs into this

Re: [PATCH v6 07/21] vfio/pci: Extract out a helper vfio_pci_get_pci_hot_reset_info

2023-11-15 Thread Eric Auger
On 11/14/23 11:09, Zhenzhong Duan wrote: > This helper will be used by both legacy and iommufd backends. > > No functional changes intended. > > Signed-off-by: Zhenzhong Duan > Reviewed-by: Cédric Le Goater > Signed-off-by: Cédric Le Goater Reviewed-by: Eric Auger Eric > --- > hw/vfio/pci.

Re: [PATCH] softmmu/memory: use memcpy for multi-byte accesses

2023-11-15 Thread Richard Henderson
On 11/15/23 08:58, Patrick Venture wrote: On Wed, Nov 15, 2023 at 2:35 AM Peter Maydell > wrote: On Tue, 14 Nov 2023 at 20:55, Patrick Venture mailto:vent...@google.com>> wrote: > Avoids unaligned pointer issues. > It would be nice to be mor

[PATCH for-8.2 2/4] block: Fix deadlocks in bdrv_graph_wrunlock()

2023-11-15 Thread Kevin Wolf
bdrv_graph_wrunlock() calls aio_poll(), which may run callbacks that have a nested event loop. Nested event loops can depend on other iothreads making progress, so in order to allow them to make progress it must not hold the AioContext lock of another thread while calling aio_poll(). This introduc

[PATCH for-8.2 4/4] iotests: Test two stream jobs in a single iothread

2023-11-15 Thread Kevin Wolf
This tests two parallel stream jobs that will complete around the same time and run on two different disks in the same iothreads. It is loosely based on the bug report at https://issues.redhat.com/browse/RHEL-1761. For me, this test hangs reliably with the originally reported bug in blk_remove_bs(

[PATCH for-8.2 3/4] stream: Fix AioContext locking during bdrv_graph_wrlock()

2023-11-15 Thread Kevin Wolf
In stream_prepare(), we need to temporarily drop the AioContext lock that job_prepare_locked() took for us while calling the graph write lock functions which can poll. All block nodes related to this block job are in the same AioContext, so we can pass any of them to bdrv_graph_wrlock()/ bdrv_grap

[PATCH for-8.2 0/4] block: Fix deadlocks with the stream job

2023-11-15 Thread Kevin Wolf
This series contains three fixes for deadlocks that follow the same pattern: A nested event loop in the main thread waits for an iothread to make progress, but the AioContext lock of that iothread is still held by the main loop, so it can never make progress. We're planning to fully remove the Aio

  1   2   3   >