[PATCH v3 2/2] linux-user: Fix openat() emulation to not modify atime

2023-12-08 Thread Shu-Chun Weng
Commit b8002058 strengthened openat()'s /proc detection by calling realpath(3) on the given path, which allows various paths and symlinks that points to the /proc file system to be intercepted correctly. Using realpath(3), though, has a side effect that it reads the symlinks along the way, and

Re: [PATCH] fix qemu build with xen-4.18.0

2023-12-08 Thread Stefano Stabellini
On Fri, 8 Dec 2023, Daniel P. Berrangé wrote: > CC'ing the Xen folks > > On Thu, Dec 07, 2023 at 11:12:48PM +, Michael Young wrote: > > Builds of qemu-8.2.0rc2 with xen-4.18.0 are currently failing > > with errors like > > ../hw/arm/xen_arm.c:74:5: error: ‘GUEST_VIRTIO_MMIO_SPI_LAST’

[PATCH v3 1/2] linux-user: Define TARGET_O_LARGEFILE for aarch64

2023-12-08 Thread Shu-Chun Weng
In 050a1ba, when moving the macros from preprocessor-guarding to file-based definition, TARGET_O_LARGEFILE appeared to have been accidentally left off. This may have correctness implication, but so far I was only confused by strace's output. Fixes: 050a1ba69a ("linux-user: move arm/aarch64/m68k

[PATCH v3 0/2] linux-user: openat() fixes

2023-12-08 Thread Shu-Chun Weng
Since v2: - More robust handling of `readlink()` Since v1: - Eliminate static buffers in do_guest_openat() Shu-Chun Weng (2): linux-user: Define TARGET_O_LARGEFILE for aarch64 linux-user: Fix openat() emulation to not modify atime linux-user/aarch64/target_fcntl.h | 1 +

Re: [RFC 1/2] qapi/virtio: introduce the "show-bits" argument for x-query-virtio-status

2023-12-08 Thread Yong Huang
On Fri, Dec 1, 2023 at 11:37 PM Laurent Vivier wrote: > On 12/1/23 16:21, Markus Armbruster wrote: > > Laurent Vivier writes: > > > >> On 11/21/23 08:58, Markus Armbruster wrote: > >>> Laurent, there's a question for you at the end. > >>> > >>> Yong Huang writes: > >>> > On Thu, Nov 16,

Re: Request for New PPC Machine Supporting Multiple SMP Cores

2023-12-08 Thread Cédric Le Goater
On 12/7/23 18:39, BALATON Zoltan wrote: On Thu, 7 Dec 2023, 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

[PATCH v1 14/17] hw/loongarch: fdt adds pcie irq_map node

2023-12-08 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/virt.c | 69 ++--- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 915357ca71..2f953e4a03 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@

[PATCH v1 13/17] hw/loongarch: fdt adds pch_msi Controller

2023-12-08 Thread Song Gao
fdt adds pch msi controller, we use 'loongson,pch-msi-1.0'. See: drivers/irqchip/irq-loongson-pch-msi.c Signed-off-by: Song Gao --- hw/loongarch/virt.c| 33 - include/hw/pci-host/ls7a.h | 1 + 2 files changed, 33 insertions(+), 1 deletion(-) diff

[PATCH v1 15/17] hw/loongarch: fdt remove unused irqchip node

2023-12-08 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/virt.c | 31 +-- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 2f953e4a03..7dfad60368 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -415,34 +415,6

[PATCH v1 10/17] hw/loongarch: fdt adds cpu interrupt controller node

2023-12-08 Thread Song Gao
fdt adds cpu interrupt controller node, we use 'loongson,cpu-interrupt-controller'. See: drivers/irqchip/irq-loongarch-cpu.c Signed-off-by: Song Gao --- hw/loongarch/virt.c | 21 + 1 file changed, 21 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c

[PATCH v1 08/17] hw/loongarch: Init efi_fdt table

2023-12-08 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/boot.c | 11 +++ include/hw/loongarch/boot.h | 4 2 files changed, 15 insertions(+) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index 991df2cc14..f2e13ad7e3 100644 --- a/hw/loongarch/boot.c +++ b/hw/loongarch/boot.c @@

[PATCH v1 17/17] hw/loongarch: Add cells missing from rtc node

2023-12-08 Thread Song Gao
rtc node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao --- hw/loongarch/virt.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index bd1db2de4f..eb568c71cf 100644 --- a/hw/loongarch/virt.c +++

[PATCH v1 16/17] hw/loongarch: Add cells missing from uart node

2023-12-08 Thread Song Gao
uart node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao --- hw/loongarch/virt.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 7dfad60368..bd1db2de4f 100644 --- a/hw/loongarch/virt.c +++

[PATCH v1 06/17] hw/loongarch: Init efi_boot_memmap table

2023-12-08 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/boot.c | 45 + hw/loongarch/virt.c | 11 ++--- include/hw/loongarch/boot.h | 27 ++ include/hw/loongarch/virt.h | 10 + 4 files changed, 84 insertions(+), 9 deletions(-)

[PATCH v1 00/17] Add boot LoongArch elf kernel with FDT

2023-12-08 Thread Song Gao
Hi, All We already support boot efi kernel with bios, but not support boot elf kernel. This series adds boot elf kernel with FDT. 'LoongArch supports ACPI and FDT. The information that needs to be passed to the kernel includes the memmap, the initrd, the command line, optionally the ACPI/FDT

[PATCH v1 04/17] hw/loongarch: Add slave cpu boot_code

2023-12-08 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/boot.c | 66 - 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index b3fbed2ea0..742a70b7f0 100644 --- a/hw/loongarch/boot.c +++ b/hw/loongarch/boot.c @@

[PATCH for 8.2] target/riscv: Fix th.dcache.cval1 priviledge check

2023-12-08 Thread LIU Zhiwei
According to the specification, the th.dcache.cvall1 can be executed under all priviledges. The specification about xtheadcmo located in, https://github.com/T-head-Semi/thead-extension-spec/blob/master/xtheadcmo/dcache_cval1.adoc Signed-off-by: LIU Zhiwei ---

Re: [PATCH v3 09/70] physmem: Introduce ram_block_convert_range() for page conversion

2023-12-08 Thread Xiaoyao Li
On 11/18/2023 5:03 AM, Isaku Yamahata wrote: On Wed, Nov 15, 2023 at 02:14:18AM -0500, Xiaoyao Li wrote: It's used for discarding opposite memory after memory conversion, for confidential guest. When page is converted from shared to private, the original shared memory can be discarded via

Re: [PULL 29/32] virtio-blk: implement BlockDevOps->drained_begin()

2023-12-08 Thread Kevin Wolf
Am 07.12.2023 um 16:22 hat Fiona Ebner geschrieben: > Am 03.11.23 um 14:12 schrieb Fiona Ebner: > > Hi, > > > > I ran into a strange issue where guest IO would get completely stuck > > during certain block jobs a while ago and finally managed to find a > > small reproducer [0]. I'm using a VM

Re: [PATCH 09/11] replay: stop us hanging in rr_wait_io_event

2023-12-08 Thread Pavel Dovgalyuk
On 05.12.2023 23:41, Alex Bennée wrote: A lot of the hang I see are when we end up spinning in rr_wait_io_event for an event that will never come in playback. As a new check functions which can see if we are in PLAY mode and kick us us the wait function so the event can be processed. This fixes

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

2023-12-08 Thread Cédric Le Goater
Simply transform the VFIOIOMMUOps struct in an InterfaceClass and do some initial name replacements. Next changes will start converting VFIOIOMMUOps. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-container-base.h | 18 ++ hw/vfio/common.c | 2 +-

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

2023-12-08 Thread Cédric Le Goater
sPAPR IOMMU support is only needed for pseries machines. Compile out support when CONFIG_PSERIES is not set. This saves ~7K of text. Signed-off-by: Cédric Le Goater --- hw/vfio/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/meson.build

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

2023-12-08 Thread Cédric Le Goater
As previously done for the sPAPR and legacy IOMMU backends, convert the VFIOIOMMUOps struct to a QOM interface. The set of of operations for this backend can be referenced with a literal typename instead of a C struct. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h |

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

2023-12-08 Thread Cédric Le Goater
This will help in converting the sPAPR IOMMU backend to a QOM interface. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-container-base.h | 1 + hw/vfio/container.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/hw/vfio/vfio-container-base.h

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

2023-12-08 Thread Cédric Le Goater
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). Signed-off-by: Cédric Le Goater --- hw/vfio/common.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/vfio/common.c

[PATCH for-9.0 00/10] vfio: Introduce a VFIOIOMMUClass

2023-12-08 Thread Cédric Le Goater
Hello, The VFIO object hierarchy has some constraints because each VFIO type has a dual nature: a VFIO nature for passthrough support and a bus nature (PCI, AP, CCW, Platform) for its initial presentation. It seemed the best approach made because multi-inheritance is not feasible with QOM and

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

2023-12-08 Thread Cédric Le Goater
This allows to abstract a bit more the sPAPR IOMMU support in the legacy IOMMU backend. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-container-base.h | 1 + hw/vfio/container.c | 10 +++- hw/vfio/spapr.c | 35 +++

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

2023-12-08 Thread Cédric Le Goater
This will help subsequent patches to unify the initialization of type1 and sPAPR IOMMU backends. Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 63 + 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/hw/vfio/container.c

[PATCH v1 01/17] hw/loongarch: Move boot fucntions to boot.c

2023-12-08 Thread Song Gao
Move some boot functions to boot.c and struct loongarch_boot_info into struct LoongArchMachineState. Signed-off-by: Song Gao --- hw/loongarch/boot.c | 125 hw/loongarch/meson.build| 1 + hw/loongarch/virt.c | 110

[PATCH v1 07/17] hw/loongarch: Init efi_initrd table

2023-12-08 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/boot.c | 29 +++-- include/hw/loongarch/boot.h | 9 + 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index 60babe3a6e..991df2cc14 100644 ---

[PATCH v1 05/17] hw/loongarch: Init efi_system_table

2023-12-08 Thread Song Gao
Add init_systab and set boot_info->a2 Signed-off-by: Song Gao --- hw/loongarch/boot.c | 39 + include/hw/loongarch/boot.h | 50 + 2 files changed, 89 insertions(+) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c

[PATCH v1 11/17] hw/loongarch: fdt adds Extend I/O Interrupt Controller

2023-12-08 Thread Song Gao
fdt adds Extend I/O Interrupt Controller, we use 'loongson,ls2k2000-eiointc'. See: drivers/irqchip/irq-loongson-eiointc.c Signed-off-by: Song Gao --- hw/loongarch/virt.c| 30 +- include/hw/intc/loongarch_extioi.h | 1 + 2 files changed, 30

[PATCH v1 09/17] hw/loongarch: Fix fdt memory node wrong 'reg'

2023-12-08 Thread Song Gao
The right fdt memory node like [1], not [2] [1] memory@0 { device_type = "memory"; reg = <0x00 0x00 0x00 0x1000>; }; [2] memory@0 { device_type = "memory"; reg = <0x02 0x00 0x02 0x1000>; };

Re: [PATCH 09/11] replay: stop us hanging in rr_wait_io_event

2023-12-08 Thread Alex Bennée
Pavel Dovgalyuk writes: > On 05.12.2023 23:41, Alex Bennée wrote: >> A lot of the hang I see are when we end up spinning in >> rr_wait_io_event for an event that will never come in playback. As a >> new check functions which can see if we are in PLAY mode and kick us >> us the wait function so

Re: [PATCH] fix qemu build with xen-4.18.0

2023-12-08 Thread Daniel P . Berrangé
CC'ing the Xen folks On Thu, Dec 07, 2023 at 11:12:48PM +, Michael Young wrote: > Builds of qemu-8.2.0rc2 with xen-4.18.0 are currently failing > with errors like > ../hw/arm/xen_arm.c:74:5: error: ‘GUEST_VIRTIO_MMIO_SPI_LAST’ undeclared > (first use in this function) >74 |

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

2023-12-08 Thread Cédric Le Goater
vfio_init_container() already defines the IOMMU type of the container. Do the same for the VFIOIOMMUOps struct. This prepares ground for the following patches that will deduce the associated VFIOIOMMUOps struct from the IOMMU type. Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 6

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

2023-12-08 Thread Cédric Le Goater
Convert the legacy VFIOIOMMUOps struct to the new VFIOIOMMU QOM interface. The set of of operations for this backend can be referenced with a literal typename instead of a C struct. This will simplify support of multiple backends. Signed-off-by: Cédric Le Goater ---

[PATCH v1 12/17] hw/loongarch: fdt adds pch_pic Controller

2023-12-08 Thread Song Gao
fdt adds pch pic controller, we use 'loongson,pch-pic-1.0' See: drivers/irqchip/irq-loongson-pch-pic.c Signed-off-by: Song Gao --- hw/loongarch/virt.c| 30 +- include/hw/pci-host/ls7a.h | 1 + 2 files changed, 30 insertions(+), 1 deletion(-) diff --git

[PATCH v1 03/17] hw/loongarch: Add init_cmdline

2023-12-08 Thread Song Gao
Add init_cmline and set boot_info->a0, a1 Signed-off-by: Song Gao --- hw/loongarch/boot.c | 21 + include/hw/loongarch/virt.h | 2 ++ target/loongarch/cpu.h | 2 ++ 3 files changed, 25 insertions(+) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index

[PATCH v1 02/17] hw/loongarch: Add load initrd

2023-12-08 Thread Song Gao
we load initrd ramdisk after kernel_high address Signed-off-by: Song Gao --- hw/loongarch/boot.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index bd20421745..40796d97bd 100644 --- a/hw/loongarch/boot.c

Re: [PATCH v5] crypto: Introduce SM4 symmetric cipher algorithm

2023-12-08 Thread Daniel P . Berrangé
On Thu, Dec 07, 2023 at 11:30:45PM +0800, Hyman Huang wrote: > Introduce the SM4 cipher algorithms (OSCCA GB/T 32907-2016). > > SM4 (GBT.32907-2016) is a cryptographic standard issued by the > Organization of State Commercial Administration of China (OSCCA) > as an authorized cryptographic

Re: [PATCH v6] crypto: Introduce SM4 symmetric cipher algorithm

2023-12-08 Thread Daniel P . Berrangé
On Thu, Dec 07, 2023 at 11:47:35PM +0800, Hyman Huang wrote: > Introduce the SM4 cipher algorithms (OSCCA GB/T 32907-2016). > > SM4 (GBT.32907-2016) is a cryptographic standard issued by the > Organization of State Commercial Administration of China (OSCCA) > as an authorized cryptographic

Re: [PATCH v3 3/4] accel/tcg: Remove #ifdef TARGET_I386 from perf.c

2023-12-08 Thread Alex Bennée
Ilya Leoshkevich writes: > Preparation for moving perf.c to tcg/. > > This affects only profiling guest code, which has code in a non-0 based > segment, e.g., 16-bit code, which is not particularly important. I have no objection to removing the wart. Is it worth adding a note:: to tcg.rst to

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

2023-12-08 Thread Cédric Le Goater
Move vfio_spapr_container_setup() to a VFIOIOMMUClass::setup handler and convert the sPAPR VFIOIOMMUOps struct to a QOM interface. The sPAPR QOM interface inherits from the legacy QOM interface because because both have the same basic needs. The sPAPR interface is then extended with the handlers

Re: [PATCH] fix qemu build with xen-4.18.0

2023-12-08 Thread Richard W.M. Jones
(Adding Xen maintainers) On Thu, Dec 07, 2023 at 11:12:48PM +, Michael Young wrote: > Builds of qemu-8.2.0rc2 with xen-4.18.0 are currently failing > with errors like > ../hw/arm/xen_arm.c:74:5: error: ‘GUEST_VIRTIO_MMIO_SPI_LAST’ undeclared > (first use in this function) >74 |

Re: Kext files for VirtIO

2023-12-08 Thread Alex Bennée
aziz tlili writes: > Do u guys have some free time to develop kext files "drivers" for VirtIO > devices (like virtio-gpu-pci and virtio-blk-pci and > virtio-net-pci) for PowerPC MacOS X Tiger (10.4.11) and later (till > Leopard 10.5)? Please, I need them as soon as possible! I don't think open

[ANNOUNCE] QEMU 8.2.0-rc3 is now available

2023-12-08 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the fourth release candidate for the QEMU 8.2 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu.org/qemu-8.2.0-rc3.tar.xz

[PATCH v2] riscv: support new isa extension detection devicetree properties

2023-12-08 Thread Conor Dooley
From: Conor Dooley A few months ago I submitted a patch to various lists, deprecating "riscv,isa" with a lengthy commit message [0] that is now commit aeb71e42caae ("dt-bindings: riscv: deprecate riscv,isa") in the Linux kernel tree. Primarily, the goal was to replace "riscv,isa" with a new set

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

2023-12-08 Thread Laszlo Ersek
On 11/22/23 17:30, Gerd Hoffmann wrote: > Hi, > >> - in general, we should filter out surrogate code points, for any use. >> any UCS2 string from the guest that contains a surrogate code point >> should be considered invalid, and the request should be rejected based >> just on that. > >

Re: [PATCH] fix qemu build with xen-4.18.0

2023-12-08 Thread Richard W.M. Jones
On Fri, Dec 08, 2023 at 08:47:07AM +, Richard W.M. Jones wrote: > (Adding Xen maintainers) > > On Thu, Dec 07, 2023 at 11:12:48PM +, Michael Young wrote: > > Builds of qemu-8.2.0rc2 with xen-4.18.0 are currently failing > > with errors like > > ../hw/arm/xen_arm.c:74:5: error:

Re: [PATCH v2 2/5] target/arm: Ensure icount is enabled when emulating INST_RETIRED

2023-12-08 Thread Philippe Mathieu-Daudé
On 7/12/23 23:12, Richard Henderson wrote: On 12/7/23 07:45, Philippe Mathieu-Daudé wrote: pmu_init() register its event checking the pm_event::supported() handler. For INST_RETIRED, the event is only registered and the bit enabled in the PMU Common Event Identification register when icount is

Re: [PATCH v3 3/4] accel/tcg: Remove #ifdef TARGET_I386 from perf.c

2023-12-08 Thread Ilya Leoshkevich
On Fri, 2023-12-08 at 09:53 +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > Preparation for moving perf.c to tcg/. > > > > This affects only profiling guest code, which has code in a non-0 > > based > > segment, e.g., 16-bit code, which is not particularly important. > > I have no

Re: [PATCH v3 0/4] accel/tcg: Move perf and debuginfo support to tcg

2023-12-08 Thread Philippe Mathieu-Daudé
Hi Richard, On 8/12/23 01:35, Ilya Leoshkevich wrote: v2: https://patchew.org/QEMU/20230630234230.596193-1-...@linux.ibm.com/ v2 -> v3: Rebased. This series was lost and forgotten until Philippe reminded me about it. v1:

Re: [PATCH v2 2/5] target/arm: Ensure icount is enabled when emulating INST_RETIRED

2023-12-08 Thread Philippe Mathieu-Daudé
Hi Peter, On 8/12/23 11:59, Peter Maydell wrote: On Fri, 8 Dec 2023 at 10:36, Philippe Mathieu-Daudé wrote: On 7/12/23 23:12, Richard Henderson wrote: On 12/7/23 07:45, Philippe Mathieu-Daudé wrote: pmu_init() register its event checking the pm_event::supported() handler. For INST_RETIRED,

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

2023-12-08 Thread Daniel P . Berrangé
On Fri, Dec 08, 2023 at 05:56:11PM +0530, 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

Re: [PATCH] fix qemu build with xen-4.18.0

2023-12-08 Thread Peter Maydell
On Fri, 8 Dec 2023 at 09:25, Daniel P. Berrangé wrote: > > CC'ing the Xen folks > > On Thu, Dec 07, 2023 at 11:12:48PM +, Michael Young wrote: > > diff --git a/include/hw/xen/xen_native.h b/include/hw/xen/xen_native.h > > index 6f09c48823..04b1ef4d34 100644 > > ---

Re: [PATCH v3 1/4] target: Make qemu_target_page_mask() available for *-user

2023-12-08 Thread Philippe Mathieu-Daudé
On 8/12/23 01:35, Ilya Leoshkevich wrote: Currently qemu_target_page_mask() is usable only from the softmmu code. Make it possible to use it from the *-user code as well. Make use of it in perf.c. Signed-off-by: Ilya Leoshkevich --- accel/tcg/perf.c | 3 ++- system/physmem.c |

Re: [PATCH v2 4/5] system/vl: Restrict icount to TCG emulation

2023-12-08 Thread Philippe Mathieu-Daudé
On 7/12/23 23:38, Richard Henderson wrote: On 12/7/23 07:45, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé ---   stubs/icount.c | 6 --   system/vl.c    | 6 +-   2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/stubs/icount.c b/stubs/icount.c index

[PATCH v3 2/6] system/vl: Evaluate icount after accelerator options are parsed

2023-12-08 Thread Philippe Mathieu-Daudé
We need to parse the accelerators first, to be able to check whether TCG is enabled or not. Then we can parse the -icount option. This allows removing the icount_configure() stub. Fixes: 7f8b6126e7 ("vl: move icount configuration earlier") Reported-by: Richard Henderson Signed-off-by: Philippe

[PATCH v3 4/6] target/arm: Ensure icount is enabled when emulating INST_RETIRED

2023-12-08 Thread Philippe Mathieu-Daudé
pmu_init() register its event checking the pm_event::supported() handler. For INST_RETIRED, the event is only registered and the bit enabled in the PMU Common Event Identification register when icount is enabled as ICOUNT_PRECISE. PMU events are TCG-only, hardware accelerators handle them

[PATCH v3 1/6] sysemu/cpu-timers: Have icount_configure() return a boolean

2023-12-08 Thread Philippe Mathieu-Daudé
Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have icount_configure() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/cpu-timers.h | 10 --

[PATCH v3 5/6] util/async: Only call icount_notify_exit() if icount is enabled

2023-12-08 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/icount-common.c | 4 +++- stubs/icount.c| 2 +- util/async.c | 16 +--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/accel/tcg/icount-common.c b/accel/tcg/icount-common.c index

[PATCH v3 6/6] sysemu/replay: Restrict icount to system emulation

2023-12-08 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/cpu-timers.h | 2 +- include/sysemu/replay.h | 11 --- stubs/icount.c | 19 --- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/include/sysemu/cpu-timers.h

Re: [PATCH v3 09/70] physmem: Introduce ram_block_convert_range() for page conversion

2023-12-08 Thread David Hildenbrand
On 08.12.23 08:59, Xiaoyao Li wrote: On 11/18/2023 5:03 AM, Isaku Yamahata wrote: On Wed, Nov 15, 2023 at 02:14:18AM -0500, Xiaoyao Li wrote: It's used for discarding opposite memory after memory conversion, for confidential guest. When page is converted from shared to private, the original

Re: [PATCH] fix qemu build with xen-4.18.0

2023-12-08 Thread Richard W.M. Jones
On Fri, Dec 08, 2023 at 08:47:07AM +, Richard W.M. Jones wrote: > (Adding Xen maintainers) > > On Thu, Dec 07, 2023 at 11:12:48PM +, Michael Young wrote: > > Builds of qemu-8.2.0rc2 with xen-4.18.0 are currently failing > > with errors like > > ../hw/arm/xen_arm.c:74:5: error:

Re: [PATCH v2 2/5] target/arm: Ensure icount is enabled when emulating INST_RETIRED

2023-12-08 Thread Peter Maydell
On Fri, 8 Dec 2023 at 10:36, Philippe Mathieu-Daudé wrote: > > On 7/12/23 23:12, Richard Henderson wrote: > > On 12/7/23 07:45, Philippe Mathieu-Daudé wrote: > >> pmu_init() register its event checking the pm_event::supported() > >> handler. For INST_RETIRED, the event is only registered and the

[PATCH v3 3/6] sysemu/cpu-timers: Introduce ICountMode enumerator

2023-12-08 Thread Philippe Mathieu-Daudé
Rather than having to lookup for what the 0, 1, 2, ... icount values are, use a enum definition. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/cpu-timers.h | 20 +--- accel/tcg/icount-common.c | 16 +++- stubs/icount.c | 2 +-

[PATCH v3 0/6] sysemu/replay: Restrict icount to TCG system emulation

2023-12-08 Thread Philippe Mathieu-Daudé
Slightly simplify non-TCG and user emulation code. This series still adds assertions in ARM INST_RETIRED PMU events, in order to bypass a linking failure. Better would be to restrict ARM PMU events to TCG. Left for another series. Since v2: - Have icount_configure() return bool - Addressed rth's

[PATCH] pc: q35: Bump max_cpus to 4096

2023-12-08 Thread Ani Sinha
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 newer to 4096. Older q35 machines

Re: [PATCH v3 3/6] sysemu/cpu-timers: Introduce ICountMode enumerator

2023-12-08 Thread Philippe Mathieu-Daudé
On 8/12/23 12:35, Philippe Mathieu-Daudé wrote: Rather than having to lookup for what the 0, 1, 2, ... icount values are, use a enum definition. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/cpu-timers.h | 20 +--- accel/tcg/icount-common.c | 16 +++-

Re: [PATCH] fix qemu build with xen-4.18.0

2023-12-08 Thread Daniel P . Berrangé
On Fri, Dec 08, 2023 at 10:59:03AM +, Peter Maydell wrote: > On Fri, 8 Dec 2023 at 09:25, Daniel P. Berrangé wrote: > > > > CC'ing the Xen folks > > > > On Thu, Dec 07, 2023 at 11:12:48PM +, Michael Young wrote: > > > diff --git a/include/hw/xen/xen_native.h b/include/hw/xen/xen_native.h

[PATCH for-8.2] block: Fix AioContext locking in qmp_block_resize()

2023-12-08 Thread Kevin Wolf
The AioContext must be unlocked before calling blk_co_unref(), because it takes the AioContext lock internally in blk_unref_bh(), which is scheduled in the main thread. If we don't unlock, the AioContext is locked twice and nested event loops such as in bdrv_graph_wrlock() will deadlock. Cc:

[PATCH v8 3/3] hw/ppc: N1 chiplet wiring

2023-12-08 Thread Chalapathi V
This part of the patchset connects the nest1 chiplet model to p10 chip. Signed-off-by: Chalapathi V --- include/hw/ppc/pnv_chip.h | 2 ++ hw/ppc/pnv.c | 15 +++ 2 files changed, 17 insertions(+) diff --git a/include/hw/ppc/pnv_chip.h b/include/hw/ppc/pnv_chip.h index

[PATCH v8 2/3] hw/ppc: Add N1 chiplet model

2023-12-08 Thread Chalapathi V
The N1 chiplet handle the high speed i/o traffic over PCIe and others. The N1 chiplet consists of PowerBus Fabric controller, nest Memory Management Unit, chiplet control unit and more. This commit creates a N1 chiplet model and initialize and realize the pervasive chiplet model where chiplet

[PATCH v8 1/3] hw/ppc: Add pnv nest pervasive common chiplet model

2023-12-08 Thread Chalapathi V
A POWER10 chip is divided into logical units called chiplets. Chiplets are broadly divided into "core chiplets" (with the processor cores) and "nest chiplets" (with everything else). Each chiplet has an attachment to the pervasive bus (PIB) and with chiplet-specific registers. All nest chiplets

Re: [PATCH v1 2/5] tests/qtest/migration: Add infrastructure to skip tests on older QEMUs

2023-12-08 Thread Fabiano Rosas
Fabiano Rosas writes: > We can run the migration tests with two different QEMU binaries to > test migration compatibility between QEMU versions. This means we'll > be running the tests with an older QEMU in either source or > destination. > > We need to avoid trying to test functionality that is

Re: [PATCH v2 2/5] target/arm: Ensure icount is enabled when emulating INST_RETIRED

2023-12-08 Thread Philippe Mathieu-Daudé
On 8/12/23 12:23, Philippe Mathieu-Daudé wrote: Hi Peter, On 8/12/23 11:59, Peter Maydell wrote: On Fri, 8 Dec 2023 at 10:36, Philippe Mathieu-Daudé wrote: On 7/12/23 23:12, Richard Henderson wrote: On 12/7/23 07:45, Philippe Mathieu-Daudé wrote: pmu_init() register its event checking the

[PATCH 2/3] hw/scsi: add mode sense support for zbc device

2023-12-08 Thread Daejun Park
This patch enables mode sense for zbc devices. Signed-off-by: Daejun Park --- hw/scsi/scsi-disk.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 6691f5edb8..f1ecb77317 100644 --- a/hw/scsi/scsi-disk.c +++

[PATCH 1/3] hw/ufs: Support for Zoned UFS

2023-12-08 Thread Daejun Park
This patch enables zoned ufs support. By setting the LU parameter, each LU can be a host-managed zoned device. This patch manages the zone condition and write pointer of each zone for a zoned LU. It supports the report zones and reset write pointer commands for Zoned LUs. Signed-off-by: Daejun

[PATCH 3/3] tests/qtest: Add tests for Zoned UFS

2023-12-08 Thread Daejun Park
This patch includes the following tests Test VPD page and report zones Test write and unaligned write error Signed-off-by: Daejun Park --- tests/qtest/ufs-test.c | 178 + 1 file changed, 178 insertions(+) diff --git a/tests/qtest/ufs-test.c

Adding MSI support for virtio-pci to QEMU as Xen backend on ARM

2023-12-08 Thread Mykyta Poturai
Hello everyone, I am currently working on adding MSI support to virtio-pci on ARM with Xen. As far as I understand QEMU Xen ARM machine that is used for virtio-pci device emulation does not initialize any interrupt controllers. And that makes it somewhat unclear what is the best approach to

[PATCH 0/3] Support for Zoned UFS

2023-12-08 Thread Daejun Park
This patch enables zoned support for UFS devices. By applying this patch, a QEMU run can use parameters to configure whether each LU of each UFS is zoned, and the capacity, size, and max open zones. Zoned UFS is implemented by referencing ZBC2. (https://www.t10.org/members/w_zbc2.htm) Daejun

[PATCH v8 2/3] hw/ppc: Add N1 chiplet model

2023-12-08 Thread Chalapathi V
The N1 chiplet handle the high speed i/o traffic over PCIe and others. The N1 chiplet consists of PowerBus Fabric controller, nest Memory Management Unit, chiplet control unit and more. This commit creates a N1 chiplet model and initialize and realize the pervasive chiplet model where chiplet

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

2023-12-08 Thread Ani Sinha
> On 08-Dec-2023, at 6:27 PM, Daniel P. Berrangé wrote: > > On Fri, Dec 08, 2023 at 05:56:11PM +0530, 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

[PATCH v8 0/3] pnv N1 chiplet model

2023-12-08 Thread Chalapathi V
Hello, Thank you for the review and suggestions on V7. There are no major design/logic changes done in revision 8 from revision 7. Addressed the minor comments. The qom-tree looks like below. (qemu) info qom-tree /machine (powernv10-machine) /chip[0] (power10_v2.0-pnv-chip) /n1-chiplet

[PATCH v8 1/3] hw/ppc: Add pnv nest pervasive common chiplet model

2023-12-08 Thread Chalapathi V
A POWER10 chip is divided into logical units called chiplets. Chiplets are broadly divided into "core chiplets" (with the processor cores) and "nest chiplets" (with everything else). Each chiplet has an attachment to the pervasive bus (PIB) and with chiplet-specific registers. All nest chiplets

Re: [PATCH v2 for-8.2?] i386/sev: Avoid SEV-ES crash due to missing MSR_EFER_LMA bit

2023-12-08 Thread Maxim Levitsky
On Wed, 2023-12-06 at 11:42 -0600, Michael Roth wrote: > On Wed, Dec 06, 2023 at 07:20:14PM +0200, Maxim Levitsky wrote: > > On Tue, 2023-12-05 at 16:28 -0600, Michael Roth wrote: > > > Commit 7191f24c7fcf ("accel/kvm/kvm-all: Handle register access errors") > > > added error checking for

[PATCH v8 3/3] hw/ppc: N1 chiplet wiring

2023-12-08 Thread Chalapathi V
This part of the patchset connects the nest1 chiplet model to p10 chip. Signed-off-by: Chalapathi V --- include/hw/ppc/pnv_chip.h | 2 ++ hw/ppc/pnv.c | 15 +++ 2 files changed, 17 insertions(+) diff --git a/include/hw/ppc/pnv_chip.h b/include/hw/ppc/pnv_chip.h index

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

2023-12-08 Thread Fabiano Rosas
Steve Sistare writes: > 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 from the runstate member. > >

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

2023-12-08 Thread Fabiano Rosas
Steve Sistare writes: > 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: Fabiano Rosas

Re: udp guestfwd

2023-12-08 Thread Patrick Venture
On Fri, Oct 27, 2023 at 11:44 PM Louai Al-Khanji wrote: > Hi, > > I'm interested in having the guestfwd option work for udp. My > understanding is that currently it's restricted to only tcp. > > I'm not familiar with libslirp internals. What would need to be changed to > implement this? I'm

Re: [PATCH v3 1/6] sysemu/cpu-timers: Have icount_configure() return a boolean

2023-12-08 Thread Richard Henderson
On 12/8/23 03:35, Philippe Mathieu-Daudé wrote: Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have icount_configure() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH v3 2/6] system/vl: Evaluate icount after accelerator options are parsed

2023-12-08 Thread Richard Henderson
On 12/8/23 03:35, Philippe Mathieu-Daudé wrote: We need to parse the accelerators first, to be able to check whether TCG is enabled or not. Then we can parse the -icount option. This allows removing the icount_configure() stub. Fixes: 7f8b6126e7 ("vl: move icount configuration earlier")

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

2023-12-08 Thread Steven Sistare
On 12/8/2023 11:37 AM, Fabiano Rosas wrote: > Steve Sistare writes: > >> 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

Re: [PATCH v3 4/6] target/arm: Ensure icount is enabled when emulating INST_RETIRED

2023-12-08 Thread Richard Henderson
On 12/8/23 03:35, Philippe Mathieu-Daudé wrote: pmu_init() register its event checking the pm_event::supported() handler. For INST_RETIRED, the event is only registered and the bit enabled in the PMU Common Event Identification register when icount is enabled as ICOUNT_PRECISE. PMU events are

Re: [PATCH for 8.2] accel/tcg/cputlb: Fix iotlb page alignment check

2023-12-08 Thread Richard Henderson
On 12/7/23 18:06, LIU Zhiwei wrote: For ram memory region the iotlb(which will be filled into the xlat_section of CPUTLBEntryFull) is calculated as: iotlb = memory_region_get_ram_addr(section->mr) + xlat; 1) xlat here is the offset_within_region of a MemoryRegionSection, which maybe not

Re: [PATCH v3 5/6] util/async: Only call icount_notify_exit() if icount is enabled

2023-12-08 Thread Richard Henderson
On 12/8/23 03:35, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/icount-common.c | 4 +++- stubs/icount.c| 2 +- util/async.c | 16 +--- 3 files changed, 13 insertions(+), 9 deletions(-) Reviewed-by: Richard

Re: [PATCH v3 6/6] sysemu/replay: Restrict icount to system emulation

2023-12-08 Thread Richard Henderson
On 12/8/23 03:35, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/cpu-timers.h | 2 +- include/sysemu/replay.h | 11 --- stubs/icount.c | 19 --- 3 files changed, 9 insertions(+), 23 deletions(-) Reviewed-by:

[PATCH for-9.0 5/5] target/riscv/kvm: rename riscv_reg_id() to riscv_reg_id_ulong()

2023-12-08 Thread Daniel Henrique Barboza
kvm_riscv_reg_id() returns an id encoded with an ulong size, i.e. an u32 size when running TARGET_RISCV32 and u64 when running TARGET_RISCV64. Rename it to kvm_riscv_reg_id_ulong() to enhance code readability. It'll be in line with the existing kvm_riscv_reg_id_() helpers. Signed-off-by: Daniel

[PATCH for-9.0 0/5] target/riscv/kvm: fix KVM reg id sizes

2023-12-08 Thread Daniel Henrique Barboza
Hi, While working in a follow-up for the Vector KVM regs, where we would read 'vlenb' and then all other vregs [1], Drew noticed that we're using kvm_riscv_reg_id() in registers that are u32 and u64. The helper is returning ulong regs for all cases, meaning that we return the wrong size for u32

  1   2   >