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

2023-12-10 Thread Jiqian Chen
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 not, may gsi 38 comes before gsi 28, that causes t

[RFC QEMU PATCH v3 0/1] Support device passthrough when dom0 is PVH on Xen

2023-12-10 Thread Jiqian Chen
Hi All, v2->v3 changes: * du to changes in the implementation of the second patch on kernel side(that adds a new sysfs for gsi instead of a new syscall), so read gsi number from the sysfs of gsi. v3 patch on kernel side: https://lore.kernel.org/lkml/20231210161519.1550860-1-jiqian.c...@amd.com/

[PATCH qemu 0/3] [PATCH qemu 0/3] hw/arm: Add device STM32L4x5 SYSCFG

2023-12-10 Thread ~inesvarhol
This patch adds a new SYSCFG peripheral used by the STM32L4x5 SoC. The implementation is inspired from the STM32F4xx SYSCFG, the device registers however aren't the same. The patch is split up in 3 commits : - implementing the SYSCFG device - adding tests (that fail in this commit) - connecting th

[PATCH qemu 3/3] hw/arm: Connect STM32L4xx SYSCFG to STM32L4x5 SoC

2023-12-10 Thread ~inesvarhol
From: Inès Varhol Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/arm/Kconfig | 1 + hw/arm/stm32l4x5_soc.c | 24 include/hw/arm/stm32l4x5_soc.h | 2 ++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/hw/arm/Kcon

[PATCH qemu 2/3] tests/qtest: Add STM32L4xx SYSCFG QTest testcase

2023-12-10 Thread ~inesvarhol
From: Inès Varhol Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- tests/qtest/meson.build | 3 +- tests/qtest/stm32l4xx_syscfg-test.c | 408 2 files changed, 410 insertions(+), 1 deletion(-) create mode 100644 tests/qtest/stm32l4xx_syscfg

[PATCH qemu 1/3] hw/misc: Implement STM32L4xx SYSCFG

2023-12-10 Thread ~inesvarhol
From: Inès Varhol Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/misc/Kconfig| 3 + hw/misc/meson.build| 1 + hw/misc/stm32l4xx_syscfg.c | 277 + hw/misc/trace-events | 6 + include/hw/m

[PATCH] target/i386: Give IRQs a chance when resetting HF_INHIBIT_IRQ_MASK

2023-12-10 Thread Ruihan Li
When emulated with QEMU, interrupts will never come in the following loop. However, if the NOP instruction is uncommented, interrupts will fire as normal. loop: cli call do_sti jmp loop do_sti: sti # n

[PATCH v2 6/9] Hexagon (target/hexagon) Make generators object oriented - gen_op_regs

2023-12-10 Thread Taylor Simpson
Reviewed-by: Brian Cain Signed-off-by: Taylor Simpson --- target/hexagon/gen_op_regs.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/hexagon/gen_op_regs.py b/target/hexagon/gen_op_regs.py index a8a7712129..7b7b33895a 100755 --- a/target/hexagon/gen_op_regs.py

[PATCH v2 1/9] Hexagon (target/hexagon) Clean up handling of modifier registers

2023-12-10 Thread Taylor Simpson
Currently, the register number (MuN) for modifier registers is the modifier register number rather than the index into hex_gpr. This patch changes MuN to the hex_gpr index, which is consistent with the handling of control registers. Note that HELPER(fcircadd) needs the CS register corresponding t

[PATCH v2 3/9] Hexagon (target/hexagon) Make generators object oriented - gen_helper_protos

2023-12-10 Thread Taylor Simpson
Signed-off-by: Taylor Simpson --- target/hexagon/gen_helper_protos.py | 149 ++-- target/hexagon/hex_common.py| 7 -- 2 files changed, 8 insertions(+), 148 deletions(-) diff --git a/target/hexagon/gen_helper_protos.py b/target/hexagon/gen_helper_protos.py index

[PATCH v2 0/9] Hexagon (target/hexagon) Make generators object oriented

2023-12-10 Thread Taylor Simpson
See commit message in second patch Changes in v2 Address feedback from Brian Cain - Consolidate logic to create helper arg lists Taylor Simpson (9): Hexagon (target/hexagon) Clean up handling of modifier registers Hexagon (target/hexagon) Make generators object oriented - gen_

[PATCH v2 2/9] Hexagon (target/hexagon) Make generators object oriented - gen_tcg_funcs

2023-12-10 Thread Taylor Simpson
The generators are generally a bunch of Python if-then-else statements based on the regtype and regid. Encapsulate regtype/regid into a class hierarchy. Clients lookup the register and invoke methods. This has several advantages for making the code easier to read, understand, and maintain - The

[PATCH v2 9/9] Hexagon (target/hexagon) Remove dead functions from hex_common.py

2023-12-10 Thread Taylor Simpson
These functions are no longer used after making the generators object oriented. Signed-off-by: Taylor Simpson --- target/hexagon/hex_common.py | 51 1 file changed, 51 deletions(-) diff --git a/target/hexagon/hex_common.py b/target/hexagon/hex_common.py inde

[PATCH v2 7/9] Hexagon (target/hexagon) Make generators object oriented - gen_analyze_funcs

2023-12-10 Thread Taylor Simpson
This patch conflicts with https://lists.gnu.org/archive/html/qemu-devel/2023-11/msg00729.html If that series goes in first, we'll rework this patch and vice versa. Signed-off-by: Taylor Simpson --- target/hexagon/gen_analyze_funcs.py | 163 +--- target/hexagon/hex_common.

[PATCH v2 5/9] Hexagon (target/hexagon) Make generators object oriented - gen_idef_parser_funcs

2023-12-10 Thread Taylor Simpson
Signed-off-by: Taylor Simpson --- target/hexagon/gen_idef_parser_funcs.py | 20 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/target/hexagon/gen_idef_parser_funcs.py b/target/hexagon/gen_idef_parser_funcs.py index f4518e653f..550a48cb7b 100644 --- a/target/h

[PATCH v2 8/9] Hexagon (target/hexagon) Remove unused WRITES_PRED_REG attribute

2023-12-10 Thread Taylor Simpson
This is the only remaining use of the is_written function. We will remove it in the subsequent commit. Signed-off-by: Taylor Simpson --- target/hexagon/attribs_def.h.inc | 1 - target/hexagon/hex_common.py | 11 --- 2 files changed, 12 deletions(-) diff --git a/target/hexagon/attr

[PATCH v2 4/9] Hexagon (target/hexagon) Make generators object oriented - gen_helper_funcs

2023-12-10 Thread Taylor Simpson
Signed-off-by: Taylor Simpson --- target/hexagon/gen_helper_funcs.py | 368 + target/hexagon/hex_common.py | 48 +++- 2 files changed, 103 insertions(+), 313 deletions(-) diff --git a/target/hexagon/gen_helper_funcs.py b/target/hexagon/gen_helper_funcs.py inde

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

2023-12-10 Thread Gavin Shan
Hi Shaoqin, On 12/7/23 20:36, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provide the ability to let the VMM decide ^^^ provides which PMU events are provided to the guest. Add a new option `pmu-filter` as -accel sub

Re: [PATCH] target/i386: Give IRQs a chance when resetting HF_INHIBIT_IRQ_MASK

2023-12-10 Thread Ruihan Li
On Mon, Dec 11, 2023 at 03:01:48AM +0800, Ruihan Li wrote: > [ .. ] > > This problem is caused because the previous code may choose not to end > the TB even if the HF_INHIBIT_IRQ_MASK has just been reset (e.g., in the > case where the RET instruction is immediately followed by the STI > instructio

Re: [PATCH RFC v2 00/12] virtio-net: add support for SR-IOV emulation

2023-12-10 Thread Jason Wang
On Sun, Dec 10, 2023 at 12:06 PM Akihiko Odaki wrote: > > Introduction > > > This series is based on the RFC series submitted by Yui Washizu[1]. > See also [2] for the context. > > This series enables SR-IOV emulation for virtio-net. It is useful > to test SR-IOV support on the guest,

Re: [PATCH RFC v2 00/12] virtio-net: add support for SR-IOV emulation

2023-12-10 Thread Akihiko Odaki
On 2023/12/11 11:52, Jason Wang wrote: On Sun, Dec 10, 2023 at 12:06 PM Akihiko Odaki wrote: Introduction This series is based on the RFC series submitted by Yui Washizu[1]. See also [2] for the context. This series enables SR-IOV emulation for virtio-net. It is useful to test S

[PATCH v6] ui/cocoa: Use NSWindow's ability to resize

2023-12-10 Thread Akihiko Odaki
This change brings two new features: - The window will be resizable if "Zoom To Fit" is eanbled - The window can be made full screen by clicking full screen button provided by the platform. (The left-top green button.) Signed-off-by: Akihiko Odaki --- V5 -> V6: Rebased. --- ui/cocoa.m | 542

RE: [PATCH for-9.0 01/10] vfio/spapr: Extend VFIOIOMMUOps with a release handler

2023-12-10 Thread Duan, Zhenzhong
Hi Cédric, >-Original Message- >From: Cédric Le Goater >Sent: Friday, December 8, 2023 4:46 PM >Subject: [PATCH for-9.0 01/10] vfio/spapr: Extend VFIOIOMMUOps with a >release handler > >This allows to abstract a bit more the sPAPR IOMMU support in the >legacy IOMMU backend. > >Signed-off-

RE: [PATCH for-9.0 02/10] vfio/container: Introduce vfio_legacy_setup() for further cleanups

2023-12-10 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Friday, December 8, 2023 4:46 PM >Subject: [PATCH for-9.0 02/10] vfio/container: Introduce vfio_legacy_setup() >for further cleanups > >This will help subsequent patches to unify the initialization of type1 >and sPAPR IOMMU backends. > >

Re: [PATCH] pc: q35: Bump max_cpus to 4096

2023-12-10 Thread Thomas Huth
On 08/12/2023 13.26, Ani Sinha wrote: Since commit f10a570b093e6 ("KVM: x86: Add CONFIG_KVM_MAX_NR_VCPUS to allow up to 4096 vCPUs") Linux kernel can support upto a maximum number of 4096 vCPUS when MAXSMP is enabled in the kernel. So bump up the max_cpus value for q35 machines versions 8.3 and

RE: [PATCH for-9.0 03/10] vfio/container: Initialize VFIOIOMMUOps under vfio_init_container()

2023-12-10 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Friday, December 8, 2023 4:46 PM >Subject: [PATCH for-9.0 03/10] vfio/container: Initialize VFIOIOMMUOps >under vfio_init_container() > >vfio_init_container() already defines the IOMMU type of the container. >Do the same for the VFIOIOMM

Re: [PATCH v3 3/3] cpu, softmmu/vl.c: Change parsing of -cpu argument to allow -cpu cpu, help to print options for the CPU type similar to how the '-device' option works.

2023-12-10 Thread Dinah B
Hi, Due to extracting CPU features via a qmp command, it only works on qemu-system-* builds. Building qmp for non system builds strikes me as extreme overkill so I need a way to exclude this from non system builds. Or maybe there's a way to disentangle querying CPU features independent from the qo

RE: [PATCH for-9.0 04/10] vfio/container: Introduce a VFIOIOMMU QOM interface

2023-12-10 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Friday, December 8, 2023 4:46 PM >Subject: [PATCH for-9.0 04/10] vfio/container: Introduce a VFIOIOMMU >QOM interface > >Simply transform the VFIOIOMMUOps struct in an InterfaceClass and do >some initial name replacements. Next changes w

Re: Request for New PPC Machine Supporting Multiple SMP Cores

2023-12-10 Thread Thomas Huth
On 07/12/2023 13.53, aziz tlili wrote: Dear QEMU Team, I hope this message finds you well. I've been a user of QEMU for well over a year. I wanted to share an idea for a potential enhancement that I believe could benefit many users, including myself. It would be fantastic to have a new PPC

RE: [PATCH for-9.0 05/10] vfio/container: Introduce a VFIOIOMMU legacy QOM interface

2023-12-10 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Friday, December 8, 2023 4:46 PM >Subject: [PATCH for-9.0 05/10] vfio/container: Introduce a VFIOIOMMU >legacy QOM interface > >Convert the legacy VFIOIOMMUOps struct to the new VFIOIOMMU QOM >interface. The set of of operations for this

RE: [PATCH for-9.0 06/10] vfio/container: Intoduce a new VFIOIOMMUClass::setup handler

2023-12-10 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Friday, December 8, 2023 4:46 PM >Subject: [PATCH for-9.0 06/10] vfio/container: Intoduce a new >VFIOIOMMUClass::setup handler > >This will help in converting the sPAPR IOMMU backend to a QOM interface. > >Signed-off-by: Cédric Le Goater

Re: [PATCH V7 02/12] cpus: stop vm in suspended runstate

2023-12-10 Thread Peter Xu
On Wed, Dec 06, 2023 at 10:09:32PM +0100, Philippe Mathieu-Daudé wrote: > What about runstate_is_vcpu_clock_ticking() then? The problem is vCPU clock ticks can only be one part of "VM is running" state (no matter whether vCPUs are running or not). I'm even thinking whether cpu_enable_ticks() shou

RE: [PATCH for-9.0 07/10] vfio/spapr: Introduce a sPAPR VFIOIOMMU QOM interface

2023-12-10 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Friday, December 8, 2023 4:46 PM >Subject: [PATCH for-9.0 07/10] vfio/spapr: Introduce a sPAPR VFIOIOMMU >QOM interface > >Move vfio_spapr_container_setup() to a VFIOIOMMUClass::setup handler >and convert the sPAPR VFIOIOMMUOps struct to

RE: [PATCH for-9.0 08/10] vfio/iommufd: Introduce a VFIOIOMMU iommufd QOM interface

2023-12-10 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Friday, December 8, 2023 4:46 PM >Subject: [PATCH for-9.0 08/10] vfio/iommufd: Introduce a VFIOIOMMU >iommufd QOM interface > >As previously done for the sPAPR and legacy IOMMU backends, convert >the VFIOIOMMUOps struct to a QOM interfac

RE: [PATCH for-9.0 09/10] vfio/spapr: Only compile sPAPR IOMMU support when needed

2023-12-10 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Friday, December 8, 2023 4:46 PM >Subject: [PATCH for-9.0 09/10] vfio/spapr: Only compile sPAPR IOMMU >support when needed > >sPAPR IOMMU support is only needed for pseries machines. Compile out >support when CONFIG_PSERIES is not set. T

RE: [PATCH for-9.0 10/10] vfio/iommufd: Remove CONFIG_IOMMUFD usage

2023-12-10 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: [PATCH for-9.0 10/10] vfio/iommufd: Remove CONFIG_IOMMUFD >usage > >Availability of the IOMMUFD backend can now be fully determined at >runtime and the ifdef check was a build time protection (for PPC not >supporting it mostly). > >Si

Re: [PATCH V7 05/12] migration: propagate suspended runstate

2023-12-10 Thread Peter Xu
On Wed, Dec 06, 2023 at 09:23:30AM -0800, Steve Sistare wrote: > If the outgoing machine was previously suspended, propagate that to the > incoming side via global_state, so a subsequent vm_start restores the > suspended state. To maintain backward and forward compatibility, reclaim > some space f

Re: [PATCH v2] qdev: Report an error for machine without HotplugHandler

2023-12-10 Thread Markus Armbruster
Akihiko Odaki writes: > The HotplugHandler of the machine will be used when the parent bus does > not exist, but the machine may not have one. Report an error in such a > case instead of aborting. > > Fixes: 7716b8ca74 ("qdev: HotplugHandler: Add support for unplugging BUS-less > devices") > Sig

Re: [PATCH V7 11/12] tests/qtest: precopy migration with suspend

2023-12-10 Thread Peter Xu
On Wed, Dec 06, 2023 at 09:23:36AM -0800, Steve Sistare wrote: > Add a test case to verify that the suspended state is handled correctly > during live migration precopy. The test suspends the src, migrates, then > wakes the dest. > > Signed-off-by: Steve Sistare Reviewed-by: Peter Xu -- Pete

Re: [PATCH V7 12/12] tests/qtest: postcopy migration with suspend

2023-12-10 Thread Peter Xu
On Wed, Dec 06, 2023 at 09:23:37AM -0800, Steve Sistare wrote: > Add a test case to verify that the suspended state is handled correctly by > live migration postcopy. The test suspends the src, migrates, then wakes > the dest. > > Signed-off-by: Steve Sistare Reviewed-by: Peter Xu -- Peter X

Re: [PATCH V7 00/12] fix migration of suspended runstate

2023-12-10 Thread Peter Xu
On Wed, Dec 06, 2023 at 12:30:02PM -0500, Steven Sistare wrote: > cpus: stop vm in suspended runstate This patch still didn't copy the QAPI maintainers, please remember to do so in a new post. Maybe it would be easier to move the QAPI doc changes into a separate patch? Thanks, -- Peter Xu

[PATCH 0/2] support unaligned access for some xHCI registers

2023-12-10 Thread Tomoyuki HIROSE
According to xHCI spec rev 1.2, unaligned access to xHCI Host Controller Capability Registers are not prohibited. But current implementation does not support unaligned access to 'MemoryRegion'. These patches contain 2 changes: 1. support unaligned access to 'MemoryRegion' 2. allow unaligned access

[PATCH 1/2] system/memory.c: support unaligned access

2023-12-10 Thread Tomoyuki HIROSE
The previous code ignored 'impl.unaligned' and handled unaligned accesses as is. But this implementation cannot emulate specific registers of some devices that allow unaligned access such as xHCI Host Controller Capability Registers. This commit checks 'impl.unaligned' and if it is false, QEMU emul

[PATCH 2/2] hw/usb/hcd-xhci.c: allow unaligned access to Capability Registers

2023-12-10 Thread Tomoyuki HIROSE
According to xHCI spec rev 1.2, unaligned access to xHCI Host Controller Capability Registers is not prohibited. In Addition, the limit of access size is also unspecified. Actually, some real devices allow unaligned access and 8-byte access to these registers. This commit makes it possible to unali

Re: [PATCH RFC v2 00/12] virtio-net: add support for SR-IOV emulation

2023-12-10 Thread Jason Wang
On Mon, Dec 11, 2023 at 1:30 PM Akihiko Odaki wrote: > > On 2023/12/11 11:52, Jason Wang wrote: > > On Sun, Dec 10, 2023 at 12:06 PM Akihiko Odaki > > wrote: > >> > >> Introduction > >> > >> > >> This series is based on the RFC series submitted by Yui Washizu[1]. > >> See also [2] f

Re: [PATCH 01/40] linux-headers: add vhost_types.h and vhost.h

2023-12-10 Thread Eugenio Perez Martin
On Thu, Dec 7, 2023 at 7:50 PM Si-Wei Liu wrote: > > Signed-off-by: Si-Wei Liu This should be updated from scripts/update-linux-headers.sh. > --- > include/standard-headers/linux/vhost_types.h | 13 + > linux-headers/linux/vhost.h | 9 + > 2 files changed,