Re: [PATCH v4 2/3] virtio-iommu: Add a granule property

2024-02-22 Thread Philippe Mathieu-Daudé
On 23/2/24 08:27, Eric Auger wrote: This allows to choose which granule will be used by default by the virtio-iommu. Current page size mask default is qemu_target_page_mask so this translates into a 4K granule. Signed-off-by: Eric Auger --- v3 -> v4: - granule_mode introduction moved to that

Re: [PATCH 1/2] hw/arm/smmuv3: Check StreamIDs against SMMU_IDR1.SIDSIZE value

2024-02-22 Thread Eric Auger
Hi, On 2/21/24 18:17, Nabih Estefan wrote: > From: Roque Arcudia Hernandez > > Current implementation checks the StreamIDs against STRTAB_BASE_CFG.LOG2SIZE > register field value and a constant SMMU_IDR1_SIDSIZE which is also used as > initial value for field SMMU_IDR1.SIDSIZE. > > This limits

Re: [PATCH v4 1/3] qdev: Add a granule_mode property

2024-02-22 Thread Philippe Mathieu-Daudé
Hi Eric, On 23/2/24 08:27, Eric Auger wrote: Introduce a new enum type property allowing to set an IOMMU granule. Values are 4K, 8K, 16K, 64K and host. This latter indicates the vIOMMU granule will match the host page size. A subsequent patch will add such a property to the virtio-iommu

[PATCH v4 2/3] virtio-iommu: Add a granule property

2024-02-22 Thread Eric Auger
This allows to choose which granule will be used by default by the virtio-iommu. Current page size mask default is qemu_target_page_mask so this translates into a 4K granule. Signed-off-by: Eric Auger --- v3 -> v4: - granule_mode introduction moved to that patch ---

[PATCH v4 1/3] qdev: Add a granule_mode property

2024-02-22 Thread Eric Auger
Introduce a new enum type property allowing to set an IOMMU granule. Values are 4K, 8K, 16K, 64K and host. This latter indicates the vIOMMU granule will match the host page size. A subsequent patch will add such a property to the virtio-iommu device. Signed-off-by: Eric Auger --- v3 -> v4: -

[PATCH v4 0/3] VIRTIO-IOMMU: Set default granule to host page size

2024-02-22 Thread Eric Auger
We used to set the default granule to 4KB but with VFIO assignment it makes more sense to use the actual host page size. Indeed when hotplugging a VFIO device protected by a virtio-iommu on a 64kB/64kB host/guest config, we currently get a qemu crash: "vfio: DMA mapping failed, unable to

[PATCH v4 3/3] virtio-iommu: Change the default granule to the host page size

2024-02-22 Thread Eric Auger
We used to set the default granule to 4KB but with VFIO assignment it makes more sense to use the actual host page size. Indeed when hotplugging a VFIO device protected by a virtio-iommu on a 64kB/64kB host/guest config, we current get a qemu crash: "vfio: DMA mapping failed, unable to continue"

Re: [PATCH v6 07/11] virtio-gpu: Handle resource blob commands

2024-02-22 Thread Huang Rui via
On Wed, Jan 10, 2024 at 04:51:31PM +0800, Pierre-Eric Pelloux-Prayer wrote: > > > Le 09/01/2024 à 17:50, Pierre-Eric Pelloux-Prayer a écrit : > > > > > > Le 19/12/2023 à 08:53, Huang Rui a écrit : > >> From: Antonio Caggiano > >> > >> Support BLOB resources creation, mapping and unmapping by

Re: [PATCH v2 1/2] hw/arm: Use TYPE_OR_IRQ when connecting STM32L4x5 EXTI fan-in IRQs

2024-02-22 Thread Philippe Mathieu-Daudé
On 20/2/24 19:34, Inès Varhol wrote: Fixes: 52671f69f7a4 ("[PATCH v8 0/3] Add device STM32L4x5 EXTI") Signed-off-by: Inès Varhol --- include/hw/arm/stm32l4x5_soc.h | 4 ++ hw/arm/stm32l4x5_soc.c | 80 +- 2 files changed, 74 insertions(+), 10

Re: [PATCH v3 0/3] Add support for I2C in BCM2835 boards

2024-02-22 Thread Philippe Mathieu-Daudé
Hi Peter, On 22/2/24 18:54, Peter Maydell wrote: On Tue, 20 Feb 2024 at 13:42, Rayhan Faizel wrote: This patch series implements support for the Broadcom Serial Controller used by BCM2835 based boards for I2C. Rayhan Faizel (3): hw/i2c: Implement Broadcom Serial Controller (BSC)

Re: [PATCH v3 2/3] hw/arm: Connect BSC to BCM2835 board as I2C0, I2C1 and I2C2

2024-02-22 Thread Philippe Mathieu-Daudé
On 20/2/24 14:41, Rayhan Faizel wrote: BCM2835 has three I2C controllers. All of them share the same interrupt line. Signed-off-by: Rayhan Faizel --- hw/arm/Kconfig | 1 + hw/arm/bcm2835_peripherals.c | 32 +---

Re: [PATCH v3 1/3] hw/i2c: Implement Broadcom Serial Controller (BSC)

2024-02-22 Thread Philippe Mathieu-Daudé
On 20/2/24 14:41, Rayhan Faizel wrote: A few deficiencies in the current device model need to be noted. 1. FIFOs are not used. All sends and receives are done directly. 2. Repeated starts are not emulated. Repeated starts can be triggered in real hardware by sending a new read transfer request

Re: [PATCH v3 1/3] hw/i2c: Implement Broadcom Serial Controller (BSC)

2024-02-22 Thread Philippe Mathieu-Daudé
Hi Rayhan, On 20/2/24 14:41, Rayhan Faizel wrote: A few deficiencies in the current device model need to be noted. 1. FIFOs are not used. All sends and receives are done directly. 2. Repeated starts are not emulated. Repeated starts can be triggered in real hardware by sending a new read

Re: [PATCH v3] virtio-pci: correctly set virtio pci queue mem multiplier

2024-02-22 Thread Michael S. Tsirkin
On Fri, Feb 23, 2024 at 10:56:17AM +0530, Srujana Challa wrote: > Currently, virtio_pci_queue_mem_mult function always returns 4K > when VIRTIO_PCI_FLAG_PAGE_PER_VQ is set. But this won't > work for vhost vdpa when host has page size other than 4K. > This patch introduces a new

Re: [PATCH 2/3] linux-user: Add strace for shmat

2024-02-22 Thread Richard Henderson
On 2/22/24 17:03, Richard Henderson wrote: Signed-off-by: Richard Henderson --- linux-user/strace.c| 23 +++ linux-user/strace.list | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index

Re: [External] Re: [PATCH v2 4/7] migration/multifd: Enable zero page checking from multifd threads.

2024-02-22 Thread Hao Xiang
On Thu, Feb 22, 2024 at 6:33 PM Peter Xu wrote: > > On Wed, Feb 21, 2024 at 06:06:19PM -0300, Fabiano Rosas wrote: > > Hao Xiang writes: > > > > > This change adds a dedicated handler for > > > MigrationOps::ram_save_target_page in > > > > nit: Add a dedicated handler... > > > > Usually "this

Re: [PATCH V5 1/5] util: str_split

2024-02-22 Thread Philippe Mathieu-Daudé
On 22/2/24 22:47, Steve Sistare wrote: Generalize hmp_split_at_comma() to take any delimiter string, rename as str_split(), and move it to util/strList.c. No functional change. Signed-off-by: Steve Sistare --- include/monitor/hmp.h | 1 - include/qemu/strList.h | 24

Re: [PATCH V5 1/5] util: str_split

2024-02-22 Thread Philippe Mathieu-Daudé
On 22/2/24 22:47, Steve Sistare wrote: Generalize hmp_split_at_comma() to take any delimiter string, rename as str_split(), and move it to util/strList.c. No functional change. Signed-off-by: Steve Sistare --- include/monitor/hmp.h | 1 - include/qemu/strList.h | 24

Re: [External] Re: [PATCH v2 4/7] migration/multifd: Enable zero page checking from multifd threads.

2024-02-22 Thread Hao Xiang
On Wed, Feb 21, 2024 at 1:06 PM Fabiano Rosas wrote: > > Hao Xiang writes: > > > This change adds a dedicated handler for MigrationOps::ram_save_target_page > > in > > nit: Add a dedicated handler... > > Usually "this patch/change" is used only when necessary to avoid > ambiguity. Will do. >

Re: [PATCH v3] virtio-pci: correctly set virtio pci queue mem multiplier

2024-02-22 Thread Philippe Mathieu-Daudé
Hi Srujana, On 23/2/24 06:26, Srujana Challa wrote: Currently, virtio_pci_queue_mem_mult function always returns 4K when VIRTIO_PCI_FLAG_PAGE_PER_VQ is set. But this won't work for vhost vdpa when host has page size other than 4K. This patch introduces a new property(host-page-per-vq) for vdpa

Re: [PATCH v2 0/6] libqos, riscv: libqos fixes, add riscv machine

2024-02-22 Thread Alistair Francis
On Sun, Feb 18, 2024 at 5:27 AM Daniel Henrique Barboza wrote: > > Hi, > > This second version was rebased with current > alistair/riscv.to.apply-next and has typo fixes in patch 1. No other > changes were made. > > All patches reviewed/acked. > > Changes from v1: > - patch 1: typos in the commit

[PATCH v3] virtio-pci: correctly set virtio pci queue mem multiplier

2024-02-22 Thread Srujana Challa
Currently, virtio_pci_queue_mem_mult function always returns 4K when VIRTIO_PCI_FLAG_PAGE_PER_VQ is set. But this won't work for vhost vdpa when host has page size other than 4K. This patch introduces a new property(host-page-per-vq) for vdpa use case to fix the same. Signed-off-by: Srujana

Re: [External] Re: [PATCH v2 4/7] migration/multifd: Enable zero page checking from multifd threads.

2024-02-22 Thread Hao Xiang
On Wed, Feb 21, 2024 at 8:11 AM Elena Ufimtseva wrote: > > > > On Fri, Feb 16, 2024 at 2:42 PM Hao Xiang wrote: >> >> This change adds a dedicated handler for MigrationOps::ram_save_target_page >> in >> multifd live migration. Now zero page checking can be done in the multifd >> threads >> and

Re: [External] Re: [PATCH v2 3/7] migration/multifd: Zero page transmission on the multifd thread.

2024-02-22 Thread Hao Xiang
On Wed, Feb 21, 2024 at 1:04 PM Fabiano Rosas wrote: > > Hao Xiang writes: > > > 1. Implements the zero page detection and handling on the multifd > > threads for non-compression, zlib and zstd compression backends. > > 2. Added a new value 'multifd' in ZeroPageDetection enumeration. > > 3. Add

Re: [External] Re: [PATCH v2 3/7] migration/multifd: Zero page transmission on the multifd thread.

2024-02-22 Thread Hao Xiang
On Thu, Feb 22, 2024 at 6:21 PM Peter Xu wrote: > > On Wed, Feb 21, 2024 at 06:04:10PM -0300, Fabiano Rosas wrote: > > Hao Xiang writes: > > > > > 1. Implements the zero page detection and handling on the multifd > > > threads for non-compression, zlib and zstd compression backends. > > > 2.

Re: [PATCH] hw/riscv/virt-acpi-build.c: Add SRAT and SLIT ACPI tables

2024-02-22 Thread Alistair Francis
On Tue, Jan 30, 2024 at 12:05 AM Haibo Xu wrote: > > Enable ACPI NUMA support by adding the following 2 ACPI tables: > SRAT: provides the association for memory/Harts and Proximity Domains > SLIT: provides the relative distance between Proximity Domains > > The SRAT RINTC Affinity Structure

Re: [External] Re: [PATCH v2 3/7] migration/multifd: Zero page transmission on the multifd thread.

2024-02-22 Thread Hao Xiang
On Wed, Feb 21, 2024 at 8:00 AM Elena Ufimtseva wrote: > > > > On Fri, Feb 16, 2024 at 2:42 PM Hao Xiang wrote: >> >> 1. Implements the zero page detection and handling on the multifd >> threads for non-compression, zlib and zstd compression backends. >> 2. Added a new value 'multifd' in

Re: [PATCH] target/riscv: Add missing include guard in pmu.h

2024-02-22 Thread Alistair Francis
On Tue, Feb 20, 2024 at 9:09 PM wrote: > > From: Frank Chang > > Add missing include guard in pmu.h to avoid the problem of double > inclusion. > > Signed-off-by: Frank Chang Thanks! Applied to riscv-to-apply.next Alistair > --- > target/riscv/pmu.h | 5 + > 1 file changed, 5

Re: [PATCH] target/riscv: Add missing include guard in pmu.h

2024-02-22 Thread Alistair Francis
On Tue, Feb 20, 2024 at 9:09 PM wrote: > > From: Frank Chang > > Add missing include guard in pmu.h to avoid the problem of double > inclusion. > > Signed-off-by: Frank Chang Reviewed-by: Alistair Francis Alistair > --- > target/riscv/pmu.h | 5 + > 1 file changed, 5 insertions(+) > >

Re: [External] Re: [PATCH v2 3/7] migration/multifd: Zero page transmission on the multifd thread.

2024-02-22 Thread Hao Xiang
On Fri, Feb 16, 2024 at 9:08 PM Richard Henderson wrote: > > On 2/16/24 12:39, Hao Xiang wrote: > > +void multifd_zero_page_check_recv(MultiFDRecvParams *p) > > +{ > > +for (int i = 0; i < p->zero_num; i++) { > > +void *page = p->host + p->zero[i]; > > +if

Re: [External] Re: [PATCH v2 1/7] migration/multifd: Add new migration option zero-page-detection.

2024-02-22 Thread Hao Xiang
On Wed, Feb 21, 2024 at 5:58 AM Elena Ufimtseva wrote: > > > > On Fri, Feb 16, 2024 at 2:41 PM Hao Xiang wrote: >> >> This new parameter controls where the zero page checking is running. >> 1. If this parameter is set to 'legacy', zero page checking is >> done in the migration main thread. >> 2.

Re: [PATCH] target/riscv: fix ACPI MCFG table

2024-02-22 Thread Alistair Francis
On Tue, Feb 20, 2024 at 2:10 AM X512 via wrote: > > MCFG segments should point to PCI configuration range, not BAR MMIO. > > Signed-off-by: Ilya Chugin Thanks! Applied to riscv-to-apply.next Alistair > --- > hw/riscv/virt-acpi-build.c | 4 ++-- > 1 file changed, 2 insertions(+), 2

Re: [RFC PATCH 14/14] migration: Fix return-path thread exit

2024-02-22 Thread Peter Xu
On Fri, Feb 16, 2024 at 02:35:26PM -0300, Fabiano Rosas wrote: > Cédric Le Goater writes: > > > Hello Fabiano > > > > On 2/14/24 21:35, Fabiano Rosas wrote: > >> Cédric Le Goater writes: > >> > >>> Hello Fabiano > >>> > >>> On 2/8/24 14:29, Fabiano Rosas wrote: > Cédric Le Goater writes:

Re: [RFC PATCH 14/14] migration: Fix return-path thread exit

2024-02-22 Thread Peter Xu
On Mon, Feb 12, 2024 at 05:04:28PM +0100, Cédric Le Goater wrote: > and then, in background we have open questions regarding : > > * the QEMUfile implementation and its QIOChannel usage for migration > streams > * qemu_file_set_error* vs. migrate_set_error. It is confusing, at least > for me.

Re: [External] Re: [PATCH v2 1/7] migration/multifd: Add new migration option zero-page-detection.

2024-02-22 Thread Hao Xiang
On Wed, Feb 21, 2024 at 4:03 AM Markus Armbruster wrote: > > Hao Xiang writes: > > > This new parameter controls where the zero page checking is running. > > 1. If this parameter is set to 'legacy', zero page checking is > > done in the migration main thread. > > 2. If this parameter is set to

Re: [External] Re: [PATCH v2 5/7] migration/multifd: Add new migration test cases for legacy zero page checking.

2024-02-22 Thread Hao Xiang
On Wed, Feb 21, 2024 at 12:59 PM Fabiano Rosas wrote: > > Hao Xiang writes: > > > Now that zero page checking is done on the multifd sender threads by > > default, we still provide an option for backward compatibility. This > > change adds a qtest migration test case to set the

Re: [PATCH 13/14] migration: Use migrate_has_error() in close_return_path_on_source()

2024-02-22 Thread Peter Xu
On Thu, Feb 08, 2024 at 10:07:44AM -0300, Fabiano Rosas wrote: > > diff --git a/migration/migration.c b/migration/migration.c > > index > > d5f705ceef4c925589aa49335969672c0d761fa2..5f55af3d7624750ca416c4177781241b3e291e5d > > 100644 > > --- a/migration/migration.c > > +++

Re: [External] Re: [PATCH v2 2/7] migration/multifd: Support for zero pages transmission in multifd format.

2024-02-22 Thread Hao Xiang
On Wed, Feb 21, 2024 at 7:37 AM Elena Ufimtseva wrote: > > > > On Fri, Feb 16, 2024 at 2:41 PM Hao Xiang wrote: >> >> This change adds zero page counters and updates multifd send/receive >> tracing format to track the newly added counters. >> >> Signed-off-by: Hao Xiang >> --- >>

Re: [PATCH 1/3] linux-user/loongarch64: Remove TARGET_FORCE_SHMLBA

2024-02-22 Thread gaosong
在 2024/2/23 上午11:03, Richard Henderson 写道: The upstream linux kernel does not define __ARCH_FORCE_SHMLBA. Cc: Song Gao Signed-off-by: Richard Henderson --- Did this definition come from the port before it was merged upstream? Yes, The patch [1]  dropped it .     [1]

Re: [PATCH v4 2/2] target/i386: add control bits support for LAM

2024-02-22 Thread Zhao Liu
On Fri, Jan 12, 2024 at 02:00:42PM +0800, Binbin Wu wrote: > Date: Fri, 12 Jan 2024 14:00:42 +0800 > From: Binbin Wu > Subject: [PATCH v4 2/2] target/i386: add control bits support for LAM > X-Mailer: git-send-email 2.25.1 > > LAM uses CR3[61] and CR3[62] to configure/enable LAM on user

Re: [PATCH v4 05/34] migration/multifd: Release recv sem_sync earlier

2024-02-22 Thread Peter Xu
On Tue, Feb 20, 2024 at 07:41:09PM -0300, Fabiano Rosas wrote: > Now that multifd_recv_terminate_threads() is called only once, release > the recv side sem_sync earlier like we do for the send side. > > Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH v4 04/34] migration/multifd: Remove p->quit from recv side

2024-02-22 Thread Peter Xu
On Tue, Feb 20, 2024 at 07:41:08PM -0300, Fabiano Rosas wrote: > Like we did on the sending side, replace the p->quit per-channel flag > with a global atomic 'exiting' flag. > > Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH v2] target/i386/kvm: Refine VMX controls setting for backward compatibility

2024-02-22 Thread Ewan Hai
On 2/20/24 06:07, Ewan Hai wrote: On 2/20/24 03:32, Xiaoyao Li wrote: diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 11b8177eff..c8f6c0b531 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -2296,6 +2296,7 @@ void kvm_arch_do_init_vcpu(X86CPU *cpu)   static

Re: [PATCH v4 03/34] tests/qtest/migration: Add a fd + file test

2024-02-22 Thread Peter Xu
On Tue, Feb 20, 2024 at 07:41:07PM -0300, Fabiano Rosas wrote: > The fd URI supports an fd that is backed by a file. The code should > select between QIOChannelFile and QIOChannelSocket, depending on the > type of the fd. Add a test for that. > > Signed-off-by: Fabiano Rosas Reviewed-by: Peter

[PATCH 0/3] linux-user: Rewrite target_shmat

2024-02-22 Thread Richard Henderson
There are multiple issues with the implementation of shmat(). (1) With reserved_va, which is the default for 32-on-64-bit, we mmap the entire guest address space. Unlike mmap, shmat refuses to replace an existing mapping without setting SHM_REMAP. This is the original subject of

Re: [PATCH v4 02/34] tests/qtest/migration: Rename fd_proto test

2024-02-22 Thread Peter Xu
On Tue, Feb 20, 2024 at 07:41:06PM -0300, Fabiano Rosas wrote: > Next patch adds another fd test. Rename the existing one closer to > what's used on other tests, with the 'precopy' prefix. > > Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu -- Peter Xu

[PATCH 3/3] linux-user: Rewrite target_shmat

2024-02-22 Thread Richard Henderson
Handle combined host and guest alignment requirements. Handle host and guest page size differences. Handle SHM_EXEC. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/115 Signed-off-by: Richard Henderson --- linux-user/mmap.c | 146 ++ 1 file

[PATCH 1/3] linux-user/loongarch64: Remove TARGET_FORCE_SHMLBA

2024-02-22 Thread Richard Henderson
The upstream linux kernel does not define __ARCH_FORCE_SHMLBA. Cc: Song Gao Signed-off-by: Richard Henderson --- Did this definition come from the port before it was merged upstream? Or was it incorrectly copied from MIPS? --- linux-user/loongarch64/target_syscall.h | 7 --- 1 file

[PATCH 2/3] linux-user: Add strace for shmat

2024-02-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/strace.c| 23 +++ linux-user/strace.list | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index cf26e55264..47d6ec3263 100644 --- a/linux-user/strace.c +++

Re: [PATCH v4 01/34] docs/devel/migration.rst: Document the file transport

2024-02-22 Thread Peter Xu
On Tue, Feb 20, 2024 at 07:41:05PM -0300, Fabiano Rosas wrote: > When adding the support for file migration with the file: transport, > we missed adding documentation for it. > > Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH v4 00/34] migration: File based migration with multifd and fixed-ram

2024-02-22 Thread Peter Xu
On Tue, Feb 20, 2024 at 07:41:04PM -0300, Fabiano Rosas wrote: > Latest numbers > == > > => guest: 128 GB RAM - 120 GB dirty - 1 vcpu in tight loop dirtying memory > => host: 128 CPU AMD EPYC 7543 - 2 NVMe disks in RAID0 (8586 MiB/s) - xfs > => pinned vcpus w/ NUMA shortest distances

Re: [PATCH v4 1/2] target/i386: add support for LAM in CPUID enumeration

2024-02-22 Thread Zhao Liu
On Fri, Jan 12, 2024 at 02:00:41PM +0800, Binbin Wu wrote: > Date: Fri, 12 Jan 2024 14:00:41 +0800 > From: Binbin Wu > Subject: [PATCH v4 1/2] target/i386: add support for LAM in CPUID > enumeration > X-Mailer: git-send-email 2.25.1 > > From: Robert Hoo > > Linear Address Masking (LAM) is a

Re: [PATCH v2 4/7] migration/multifd: Enable zero page checking from multifd threads.

2024-02-22 Thread Peter Xu
On Wed, Feb 21, 2024 at 06:06:19PM -0300, Fabiano Rosas wrote: > Hao Xiang writes: > > > This change adds a dedicated handler for MigrationOps::ram_save_target_page > > in > > nit: Add a dedicated handler... > > Usually "this patch/change" is used only when necessary to avoid > ambiguity. >

[PATCH v2 1/4] target/riscv: Add functions for common matching conditions of trigger

2024-02-22 Thread Alvin Chang via
According to RISC-V Debug specification, there are several common matching conditions before firing a trigger, including the enabled privilege levels of the trigger. This commit adds trigger_common_match() to prepare the common matching conditions for the type 2/3/6 triggers. For now, we just

[PATCH v2 0/4] RISC-V: Modularize common match conditions for trigger

2024-02-22 Thread Alvin Chang via
According to RISC-V Debug specification, the enabled privilege levels of the trigger is common match conditions for all the types of the trigger. This series modularize the code for checking the privilege levels of type 2/3/6 triggers by implementing functions trigger_common_match() and

[PATCH v2 4/4] target/riscv: Apply modularized matching conditions for icount trigger

2024-02-22 Thread Alvin Chang via
We have implemented trigger_common_match(), which checks if the enabled privilege levels of the trigger match CPU's current privilege level. We can invoke trigger_common_match() to check the privilege levels of the type 3 triggers. Signed-off-by: Alvin Chang --- target/riscv/debug.c | 2 +- 1

[PATCH v2 3/4] target/riscv: Apply modularized matching conditions for watchpoint

2024-02-22 Thread Alvin Chang via
We have implemented trigger_common_match(), which checks if the enabled privilege levels of the trigger match CPU's current privilege level. Remove the related code in riscv_cpu_debug_check_watchpoint() and invoke trigger_common_match() to check the privilege levels of the type 2 and type 6

[PATCH v2 2/4] target/riscv: Apply modularized matching conditions for breakpoint

2024-02-22 Thread Alvin Chang via
We have implemented trigger_common_match(), which checks if the enabled privilege levels of the trigger match CPU's current privilege level. Remove the related code in riscv_cpu_debug_check_breakpoint() and invoke trigger_common_match() to check the privilege levels of the type 2 and type 6

Re: [PATCH v2 3/7] migration/multifd: Zero page transmission on the multifd thread.

2024-02-22 Thread Peter Xu
On Wed, Feb 21, 2024 at 06:04:10PM -0300, Fabiano Rosas wrote: > Hao Xiang writes: > > > 1. Implements the zero page detection and handling on the multifd > > threads for non-compression, zlib and zstd compression backends. > > 2. Added a new value 'multifd' in ZeroPageDetection enumeration. > >

Re: [PATCH v4 50/66] i386/tdx: handle TDG.VP.VMCALL

2024-02-22 Thread Qiu, Feng
Actually the 4 byte length header is provided by client library(https://github.com/intel/SGXDataCenterAttestationPrimitives/blob/master/QuoteGeneration/quote_wrapper/tdx_attest/tdx_attest.c#L295), not QEMU. QEMUjust treats the how payload including the header a whole blob. BTW, in the latest

Re: [PULL 0/1] loongarch-to-apply queue

2024-02-22 Thread gaosong
在 2024/2/22 下午8:42, Peter Maydell 写道: On Wed, 21 Feb 2024 at 09:11, Song Gao wrote: The following changes since commit 760b4dcdddba4a40b9fa0eb78fdfc7eda7cb83d0: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-02-20 10:11:08 +) are available in the Git

Re: [PATCH] system/physmem: Fix migration dirty bitmap coherency with TCG memory access

2024-02-22 Thread Nicholas Piggin
On Fri Feb 23, 2024 at 6:59 AM AEST, Thomas Huth wrote: > On 20/02/2024 02.13, Nicholas Piggin wrote: > > On Tue Feb 20, 2024 at 12:10 AM AEST, Thomas Huth wrote: > >> On 19/02/2024 07.17, Nicholas Piggin wrote: > >>> The fastpath in cpu_physical_memory_sync_dirty_bitmap() to test large > >>>

Re: [PATCH v4 50/66] i386/tdx: handle TDG.VP.VMCALL

2024-02-22 Thread Xiaoyao Li
+ Feng Qiu, On 2/23/2024 12:30 AM, Daniel P. Berrangé wrote: On Wed, Jan 24, 2024 at 10:23:12PM -0500, Xiaoyao Li wrote: From: Isaku Yamahata Add property "quote-generation-socket" to tdx-guest, which is a property of type SocketAddress to specify Quote Generation Service(QGS). On request

Re: [RFC QEMU PATCH v4 1/1] xen: Use gsi instead of irq for mapping pirq

2024-02-22 Thread Stefano Stabellini
On Fri, 5 Jan 2024, Jiqian Chen wrote: > In PVH dom0, it uses the linux local interrupt mechanism, > when it allocs irq for a gsi, it is dynamic, and follow > the principle of applying first, distributing first. And > the irq number is alloced from small to large, but the > applying gsi number is

Re: [PATCH] migration: Fix qmp_query_migrate mbps value

2024-02-22 Thread Peter Xu
On Thu, Feb 22, 2024 at 10:49:12AM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Thu, Feb 22, 2024 at 05:40:41PM +0800, Peter Xu wrote: > >> On Wed, Feb 21, 2024 at 09:56:36AM -0300, Fabiano Rosas wrote: > >> > Peter Xu writes: > >> > > >> > > On Mon, Feb 19, 2024 at 04:44:57PM

[PATCH 1/6] hw/misc/ivshmem: Add ivshmem-flat device

2024-02-22 Thread Gustavo Romero
Add a new device, ivshmem-flat, which is similar to the ivshmem PCI but does not require a PCI bus. It's meant to be used on machines like those with Cortex-M MCUs, which usually lack a PCI/PCIe bus, e.g. lm3s6965evb and mps2-an385. The device currently only supports the sysbus bus. The new

[PATCH 0/6] Add ivshmem-flat device

2024-02-22 Thread Gustavo Romero
Since v1: - Correct code style - Correct trace event format strings - Include minimum headers in ivshmem-flat.h - Allow ivshmem_flat_recv_msg() take NULL - Factored ivshmem_flat_connect_server() out - Split sysbus-auto-wire controversial code in different patch - Document QDev interface Since v2:

[PATCH 4/6] hw/misc/ivshmem: Rename ivshmem to ivshmem-pci

2024-02-22 Thread Gustavo Romero
Because now there is also an MMIO ivshmem device (ivshmem-flat.c), and ivshmem.c is a PCI specific implementation, rename it to ivshmem-pci.c. Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231127052024.435743-5-gustavo.rom...@linaro.org> Signed-off-by: Gustavo Romero ---

[PATCH 5/6] tests/qtest: Reorganize common code in ivshmem-test

2024-02-22 Thread Gustavo Romero
This commit reorganizes the ivshmem-test qtest by moving common structs, functions, and code that can be utilized by other ivshmem qtests into two new files: ivshmem-utils.h and ivshmem-utils.c. Enum Reg, struct ServerThread, and mktempshm() have been relocated to these new files. Two new

[PATCH 2/6] hw/misc/ivshmem-flat: Allow device to wire itself on sysbus

2024-02-22 Thread Gustavo Romero
This commit enables the ivshmem-flat device to wire itself on sysbus. It maps the device's Memory-Mapped Registers (MMRs) and shared memory (shmem) into the VM's memory layout and also allows connection to an input IRQ so that the device can trigger an interrupt for notification. Three device

[PATCH 6/6] tests/qtest: Add ivshmem-flat test

2024-02-22 Thread Gustavo Romero
This commit adds a qtest for the ivshmem-flat device to test memory sharing, IRQ triggering, and the memory mapped registers in the device. Based-on: https://lists.gnu.org/archive/html/qemu-devel/2023-11/msg03176.html Message-ID: <20231127052024.435743-4-gustavo.rom...@linaro.org> Signed-off-by:

[PATCH 3/6] hw/arm: Allow some machines to use the ivshmem-flat device

2024-02-22 Thread Gustavo Romero
Allow Arm machine lm3s6965evb and the mps2 ones, like the mps2-an385, to use the ivshmem-flat device. Message-ID: <20231127052024.435743-2-gustavo.rom...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Gustavo Romero --- hw/arm/mps2.c | 3 +++ hw/arm/stellaris.c | 3 +++

[PATCH V5 5/5] migration: simplify exec migration functions

2024-02-22 Thread Steve Sistare
Simplify the exec migration code by using list utility functions. As a side effect, this also fixes a minor memory leak. On function return, "g_auto(GStrv) argv" frees argv and each element, which is wrong, because the function does not own the individual elements. To compensate, the code uses

[PATCH V5 2/5] qapi: QAPI_LIST_LENGTH

2024-02-22 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- include/qapi/util.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/qapi/util.h b/include/qapi/util.h index 81a2b13..20dfea8 100644 --- a/include/qapi/util.h +++ b/include/qapi/util.h @@ -56,4 +56,17 @@

[PATCH V5 0/5] string list functions

2024-02-22 Thread Steve Sistare
Add some handy string list functions for general use, and use them in live migration functions. These will also be needed for cpr exec mode. Changes in V5: * renamed some variables and one function, replaced GStrv with char ** * aligned backslashes in QAPI_LIST_LENGTH * restored cutils.h

[PATCH V5 1/5] util: str_split

2024-02-22 Thread Steve Sistare
Generalize hmp_split_at_comma() to take any delimiter string, rename as str_split(), and move it to util/strList.c. No functional change. Signed-off-by: Steve Sistare --- include/monitor/hmp.h | 1 - include/qemu/strList.h | 24 monitor/hmp-cmds.c | 19

[PATCH V5 3/5] util: strv_from_strList

2024-02-22 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- include/qemu/strList.h | 6 ++ util/strList.c | 14 ++ 2 files changed, 20 insertions(+) diff --git a/include/qemu/strList.h b/include/qemu/strList.h index 0f26116..c1eb1dd 100644 ---

[PATCH V5 4/5] util: strList unit tests

2024-02-22 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- tests/unit/meson.build| 1 + tests/unit/test-strList.c | 80 +++ 2 files changed, 81 insertions(+) create mode 100644 tests/unit/test-strList.c diff --git a/tests/unit/meson.build

Re: [RFC PATCH v2] arm/ptw: Handle atomic updates of page tables entries in MMIO during PTW.

2024-02-22 Thread Richard Henderson
On 2/19/24 06:12, Jonathan Cameron wrote: I'm far from confident this handling here is correct. Hence RFC. In particular not sure on what locks I should hold for this to be even moderately safe. The function already appears to be inconsistent in what it returns as the CONFIG_ATOMIC64 block

Re: [PATCH] system/physmem: Fix migration dirty bitmap coherency with TCG memory access

2024-02-22 Thread Thomas Huth
On 20/02/2024 02.13, Nicholas Piggin wrote: On Tue Feb 20, 2024 at 12:10 AM AEST, Thomas Huth wrote: On 19/02/2024 07.17, Nicholas Piggin wrote: The fastpath in cpu_physical_memory_sync_dirty_bitmap() to test large aligned ranges forgot to bring the TCG TLB up to date after clearing some of

[PULL 33/39] accel/tcg: Disconnect TargetPageDataNode from page size

2024-02-22 Thread Richard Henderson
Dynamically size the node for the runtime target page size. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich Acked-by: Helge Deller Message-Id: <20240102015808.132373-29-richard.hender...@linaro.org> --- accel/tcg/user-exec.c | 13

[PULL 34/39] linux-user: Allow TARGET_PAGE_BITS_VARY

2024-02-22 Thread Richard Henderson
If set, match the host and guest page sizes. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Acked-by: Helge Deller Message-Id: <20240102015808.132373-30-richard.hender...@linaro.org> --- linux-user/main.c | 16 +--- 1 file changed, 13 insertions(+), 3

[PULL 30/39] tests/tcg: Extend file in linux-madvise.c

2024-02-22 Thread Richard Henderson
When guest page size > host page size, this test can fail due to the SIGBUS protection hack. Avoid this by making sure that the file size is at least one guest page. Visible with alpha guest on x86_64 host. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Reviewed-by: Ilya

[PULL 31/39] *-user: Deprecate and disable -p pagesize

2024-02-22 Thread Richard Henderson
This option controls the host page size. From the mis-usage in our own testsuite, this is easily confused with guest page size. The only thing that occurs when changing the host page size is that stuff breaks, because one cannot actually change the host page size. Therefore reject all but the

[PULL 38/39] target/alpha: Enable TARGET_PAGE_BITS_VARY for user-only

2024-02-22 Thread Richard Henderson
Since alpha binaries are generally built for multiple page sizes, it is trivial to allow the page size to vary. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Reviewed-by: Ilya Leoshkevich Acked-by: Helge Deller Message-Id:

[PULL 15/39] hw/tpm: Remove HOST_PAGE_ALIGN from tpm_ppi_init

2024-02-22 Thread Richard Henderson
This removes a hidden use of qemu_host_page_size, hoisting two uses of qemu_real_host_page_size to a local variable. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ilya Leoshkevich Acked-by: Helge Deller --- hw/tpm/tpm_ppi.c | 6 -- 1 file changed, 4

[PULL 29/39] tests/tcg: Remove run-test-mmap-*

2024-02-22 Thread Richard Henderson
These tests are confused, because -p does not change the guest page size, but the host page size. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Reviewed-by: Ilya Leoshkevich Acked-by: Helge Deller Message-Id: <20240102015808.132373-25-richard.hender...@linaro.org> ---

[PULL 25/39] linux-user: Use do_munmap for target_mmap failure

2024-02-22 Thread Richard Henderson
For the cases for which the host mmap succeeds, but does not yield the desired address, use do_munmap to restore the reserved_va memory reservation. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/mmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3

[PULL 09/39] linux-user/nios2: Remove qemu_host_page_size from init_guest_commpage

2024-02-22 Thread Richard Henderson
Use qemu_real_host_page_size. If !reserved_va, use MAP_FIXED_NOREPLACE. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Acked-by: Helge Deller Message-Id: <20240102015808.132373-7-richard.hender...@linaro.org> --- linux-user/elfload.c | 14 +- 1 file changed, 9

[PULL 03/39] tcg: Avoid double lock if page tables happen to be in mmio memory.

2024-02-22 Thread Richard Henderson
From: Jonathan Cameron On i386, after fixing the page walking code to work with pages in MMIO memory (specifically CXL emulated interleaved memory), a crash was seen in an interrupt handling path. Useful part of backtrace 7 0x55ab1929 in bql_lock_impl (file=0x56049122

[PULL 13/39] linux-user: Remove HOST_PAGE_ALIGN from mmap.c

2024-02-22 Thread Richard Henderson
This removes a hidden use of qemu_host_page_size, using instead the existing host_page_size local within each function. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Reviewed-by: Ilya Leoshkevich Acked-by: Helge Deller Message-Id:

[PULL 22/39] linux-user: Split out mmap_end

2024-02-22 Thread Richard Henderson
Use a subroutine instead of a goto within target_mmap__locked. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich Acked-by: Helge Deller Message-Id: <20240102015808.132373-20-richard.hender...@linaro.org> --- linux-user/mmap.c | 71

[PULL 00/39] tcg and linux-user patch queue

2024-02-22 Thread Richard Henderson
The following changes since commit 6630bc04bccadcf868165ad6bca5a964bb69b067: Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging (2024-02-22 12:42:52 +) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20240222

[PULL 21/39] linux-user: Fix sub-host-page mmap

2024-02-22 Thread Richard Henderson
We cannot skip over the_end1 to the_end, because we fail to record the validity of the guest page with the interval tree. Remove "the_end" and rename "the_end1" to "the_end". Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Reviewed-by: Ilya Leoshkevich Acked-by: Helge Deller

[PULL 20/39] linux-user: Move some mmap checks outside the lock

2024-02-22 Thread Richard Henderson
Basic validation of operands does not require the lock. Hoist them from target_mmap__locked back into target_mmap. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich Acked-by: Helge Deller Message-Id:

[PULL 01/39] tcg/aarch64: Apple does not align __int128_t in even registers

2024-02-22 Thread Richard Henderson
>From >https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms When passing an argument with 16-byte alignment in integer registers, Apple platforms allow the argument to start in an odd-numbered xN register. The standard ABI requires it to begin in an

[PULL 27/39] linux-user: Split out mmap_h_lt_g

2024-02-22 Thread Richard Henderson
Work much harder to get alignment and mapping beyond the end of the file correct. Both of which are excercised by our test-mmap for alpha (8k pages) on any 4k page host. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Acked-by: Helge Deller Message-Id:

[PULL 28/39] linux-user: Split out mmap_h_gt_g

2024-02-22 Thread Richard Henderson
Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Acked-by: Helge Deller Message-Id: <20240102015808.132373-24-richard.hender...@linaro.org> --- linux-user/mmap.c | 288 ++ 1 file changed, 139 insertions(+), 149 deletions(-) diff --git

[PULL 23/39] linux-user: Do early mmap placement only for reserved_va

2024-02-22 Thread Richard Henderson
For reserved_va, place all non-fixed maps then proceed as for MAP_FIXED. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Reviewed-by: Ilya Leoshkevich Acked-by: Helge Deller Message-Id: <20240102015808.132373-21-richard.hender...@linaro.org> --- linux-user/mmap.c | 12

[PULL 07/39] linux-user: Remove qemu_host_page_size from create_elf_tables

2024-02-22 Thread Richard Henderson
AT_PAGESZ is supposed to advertise the guest page size. The random adjustment made here using qemu_host_page_size does not match anything else within linux-user. The idea here is good, but should be done more systemically via adjustment to TARGET_PAGE_SIZE. Signed-off-by: Richard Henderson

  1   2   3   4   >