[Stable-8.2.1 15/38] hw/vfio: fix iteration over global VFIODevice list

2024-01-17 Thread Michael Tokarev
From: Volker Rümelin Commit 3d779abafe ("vfio/common: Introduce a global VFIODevice list") introduced a global VFIODevice list, but forgot to update the list element field name when iterating over the new list. Change the code to use the correct list element field. Fixes: 3d779abafe

[Stable-8.2.1 25/38] tests/qtest/virtio-ccw: Fix device presence checking

2024-01-17 Thread Michael Tokarev
From: Samuel Tardieu An apparent copy-paste error tests for the presence of the virtio-rng-ccw device in order to perform tests on the virtio-scsi-ccw device. Signed-off-by: Samuel Tardieu Message-ID: <20240106130121.1244993-1-...@rfc1149.net> Fixes: 65331bf5d1 ("tests/qtest: Check for

[Stable-8.2.1 37/38] target/hppa: Fix IOR and ISR on error in probe

2024-01-17 Thread Michael Tokarev
From: Helge Deller Put correct values (depending on CPU arch) into IOR and ISR on fault. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson (cherry picked from commit 31efbe72c6cc54b9cbc2505d78870a8a87a8d392) Signed-off-by: Michael Tokarev diff --git a/target/hppa/op_helper.c

[Stable-8.2.1 26/38] target/s390x: Fix LAE setting a wrong access register

2024-01-17 Thread Michael Tokarev
From: Ilya Leoshkevich LAE should set the access register corresponding to the first operand, instead, it always modifies access register 1. Co-developed-by: Ido Plat Cc: qemu-sta...@nongnu.org Fixes: a1c7610a6879 ("target-s390x: implement LAY and LAEY instructions") Reviewed-by: David

[Stable-8.2.1 30/38] hw/hppa/machine: Disable default devices with --nodefaults option

2024-01-17 Thread Michael Tokarev
From: Helge Deller Recognize the qemu --nodefaults option, which will disable the following default devices on hppa: - lsi53c895a SCSI controller, - artist graphics card, - LASI 82596 NIC, - tulip PCI NIC, - second serial PCI card, - USB OHCI controller. Adding this option is very useful to

[Stable-8.2.1 38/38] target/hppa: Update SeaBIOS-hppa to version 15

2024-01-17 Thread Michael Tokarev
From: Helge Deller SeaBIOS-hppa version 15: - Fix OpenBSD 7.4 boot (PDC_MEM_MAP call returned wrong values) SeaBIOS-hppa version 14 comes with those fixes: - Fix 32-bit HP-UX crash (fix in PDC_FIND_MODULE call) - Fix NetBSD boot (power button fix and add option to disable it) - Fix FPU

[Stable-8.2.1 33/38] hw/hppa: Move software power button address back into PDC

2024-01-17 Thread Michael Tokarev
From: Helge Deller The various operating systems (e.g. Linux, NetBSD) have issues mapping the power button when it's stored in page zero. NetBSD even crashes, because it fails to map that page and then accesses unmapped memory. Since we now have a consistent memory mapping of PDC in 32-bit and

[Stable-8.2.1 36/38] target/hppa: Fix IOR and ISR on unaligned access trap

2024-01-17 Thread Michael Tokarev
From: Helge Deller Put correct values (depending on CPU arch) into IOR and ISR on fault. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson (cherry picked from commit 910ada0225d17530188aa45afcb9412c17267f46) Signed-off-by: Michael Tokarev diff --git a/target/hppa/cpu.c

[Stable-8.2.1 19/38] tests/acpi: allow tests/data/acpi/virt/SSDT.memhp changes

2024-01-17 Thread Michael Tokarev
From: Gerd Hoffmann Signed-off-by: Gerd Hoffmann (cherry picked from commit ca8b0cc8e9176419960b844abb522a2298a794d6) Signed-off-by: Michael Tokarev diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..e569098abd 100644 ---

[Stable-8.2.1 31/38] hw/pci-host/astro: Add missing astro & elroy registers for NetBSD

2024-01-17 Thread Michael Tokarev
From: Helge Deller NetBSD accesses some astro and elroy registers which aren't accessed by Linux yet. Add emulation for those registers to allow NetBSD to boot further. Please note that this patch is not sufficient to completely boot up NetBSD on the 64-bit C3700 machine yet. Signed-off-by:

[Stable-8.2.1 32/38] target/hppa: Fix PDC address translation on PA2.0 with PSW.W=0

2024-01-17 Thread Michael Tokarev
From: Helge Deller Fix the address translation for PDC space on PA2.0 if PSW.W=0. Basically, for any address in the 32-bit PDC range from 0xf000 to 0xf100 keep the lower 32-bits and just set the upper 32-bits to 0xfff0. This mapping fixes the emulated power button in PDC space for

[Stable-8.2.1 35/38] target/hppa: Export function hppa_set_ior_and_isr()

2024-01-17 Thread Michael Tokarev
From: Helge Deller Move functionality to set IOR and ISR on fault into own function. This will be used by follow-up patches. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson (cherry picked from commit 3824e0d643f34ee09e0cc75190c0c4b60928b78c) Signed-off-by: Michael Tokarev diff

[Stable-8.2.1 28/38] readthodocs: fully specify a build environment

2024-01-17 Thread Michael Tokarev
From: Alex Bennée This is now expected by rtd so I've expanded using their example as 22.04 is one of our supported platforms. I tried to work out if there was an easy way to re-generate a requirements.txt from our pythondeps.toml but in the end went for the easier solution. Cc:

[Stable-8.2.1 29/38] hw/hppa/machine: Allow up to 3840 MB total memory

2024-01-17 Thread Michael Tokarev
From: Helge Deller The physical hardware allows DIMMs of 4 MB size and above, allowing up to 3840 MB of memory, but is restricted by setup code to 3 GB. Increase the limit to allow up to the maximum amount of memory. Btw. the memory area from 0xf000. to 0x. is reserved by the

[Stable-8.2.1 09/38] target/riscv: Fix mcycle/minstret increment behavior

2024-01-17 Thread Michael Tokarev
From: Xu Lu The mcycle/minstret counter's stop flag is mistakenly updated on a copy on stack. Thus the counter increments even when the CY/IR bit in the mcountinhibit register is set. This commit corrects its behavior. Fixes: 3780e33732f88 (target/riscv: Support mcycle/minstret write operation)

[Stable-8.2.1 34/38] target/hppa: Avoid accessing %gr0 when raising exception

2024-01-17 Thread Michael Tokarev
From: Helge Deller The value of unwind_breg may reference register %r0, but we need to avoid accessing gr0 directly and use the value 0 instead. At runtime I've seen unwind_breg being zero with the Linux kernel when rfi is used to jump to smp_callin(). Signed-off-by: Helge Deller Reviewed-by:

[Stable-8.2.1 12/38] hw/net: cadence_gem: Fix MDIO_OP_xxx values

2024-01-17 Thread Michael Tokarev
From: Bin Meng Testing upstream U-Boot with 'sifive_u' machine we see: => dhcp ethernet@1009: PHY present at 0 Could not get PHY for ethernet@1009: addr 0 phy_connect failed This has been working till QEMU 8.1 but broken since QEMU 8.2. Fixes: 1b09eeb122aa

[Stable-8.2.1 20/38] edk2: update to git snapshot

2024-01-17 Thread Michael Tokarev
From: Gerd Hoffmann Want pick up edk2 commit cee7ba349c0c ("ArmVirtQemu: Allow EFI memory attributes protocol to be disabled"). Needed to fix issue #1990. Signed-off-by: Gerd Hoffmann (cherry picked from commit c3667412582cdda42b36418bed135db96005bb85) Signed-off-by: Michael Tokarev diff

[Stable-8.2.1 05/38] include/ui/rect.h: fix qemu_rect_init() mis-assignment

2024-01-17 Thread Michael Tokarev
From: Elen Avan Signed-off-by: Elen Avan Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2051 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2050 Fixes: a200d53b1fde "virtio-gpu: replace PIXMAN for region/rect test" Cc: qemu-sta...@nongnu.org Reviewed-by: Michael Tokarev

[Stable-8.2.1 21/38] edk2: update build config, set PcdUninstallMemAttrProtocol = TRUE.

2024-01-17 Thread Michael Tokarev
From: Gerd Hoffmann Needed to workaround buggy EFI_MEMORY_ATTRIBUTE_PROTOCOL usage in shim.efi. Signed-off-by: Gerd Hoffmann (cherry picked from commit 6f79fa5f097aa41fc96a14dfccdb0ea8d9facd6c) Signed-off-by: Michael Tokarev diff --git a/roms/edk2-build.config b/roms/edk2-build.config index

[Stable-8.2.1 02/38] vl: Improve error message for conflicting -incoming and -loadvm

2024-01-17 Thread Michael Tokarev
From: Kevin Wolf Currently, the conflict between -incoming and -loadvm is only detected when loading the snapshot fails because the image is still inactive for the incoming migration. This results in a suboptimal error message: $ ./qemu-system-x86_64 -hda /tmp/test.qcow2 -loadvm foo -incoming

[Stable-8.2.1 27/38] .gitlab-ci.d/buildtest.yml: Work around htags bug when environment is large

2024-01-17 Thread Michael Tokarev
From: Peter Maydell Sometimes the CI "pages" job fails with a message like this from htags: $ htags -anT --tree-view=filetree -m qemu_init -t "Welcome to the QEMU sourcecode" htags: Negative exec line limit = -371 This is due to a bug in hflags where if the environment is too large it falls

[Stable-8.2.1 13/38] edu: fix DMA range upper bound check

2024-01-17 Thread Michael Tokarev
From: Max Erenberg The edu_check_range function checks that start <= end1 < end2, where end1 is the upper bound (exclusive) of the guest-supplied DMA range and end2 is the upper bound (exclusive) of the device's allowed DMA range. When the guest tries to transfer exactly DMA_SIZE (4096) bytes,

[Stable-8.2.1 01/38] block: Fix crash when loading snapshot on inactive node

2024-01-17 Thread Michael Tokarev
From: Kevin Wolf bdrv_is_read_only() only checks if the node is configured to be read-only eventually, but even if it returns false, writing to the node may not be permitted at the moment (because it's inactive). bdrv_is_writable() checks that the node can be written to right now, and this is

[Stable-8.2.1 14/38] vfio/container: Replace basename with g_path_get_basename

2024-01-17 Thread Michael Tokarev
From: Cédric Le Goater g_path_get_basename() is a portable utility function that has the advantage of not modifing the string argument. It also fixes a compile breakage with the Musl C library reported in [1]. [1] https://lore.kernel.org/all/20231212010228.2701544-1-raj.k...@gmail.com/

[Stable-8.2.1 24/38] tests/acpi: disallow tests/data/acpi/virt/SSDT.memhp changes

2024-01-17 Thread Michael Tokarev
From: Gerd Hoffmann Signed-off-by: Gerd Hoffmann (cherry picked from commit 704f7cad5105246822686f65765ab92045f71a3b) Signed-off-by: Michael Tokarev diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index e569098abd..dfb8523c8b 100644 ---

[Stable-8.2.1 18/38] util: fix build with musl libc on ppc64le

2024-01-17 Thread Michael Tokarev
From: Natanael Copa Use PPC_FEATURE2_ISEL and PPC_FEATURE2_VEC_CRYPTO from linux headers instead of the GNU specific PPC_FEATURE2_HAS_ISEL and PPC_FEATURE2_HAS_VEC_CRYPTO. This fixes build with musl libc. Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1861

[Stable-8.2.1 22/38] edk2: update binaries to git snapshot

2024-01-17 Thread Michael Tokarev
From: Gerd Hoffmann Resolves: #1990 Signed-off-by: Gerd Hoffmann (cherry picked from commit 5058720151961d79ef3abdacea94327f2c63951a) Signed-off-by: Michael Tokarev diff --git a/pc-bios/edk2-aarch64-code.fd.bz2 b/pc-bios/edk2-aarch64-code.fd.bz2 index 985e69a66a..fdcf89022a 100644 Binary

[Stable-8.2.1 10/38] chardev/char.c: fix "abstract device type" error message

2024-01-17 Thread Michael Tokarev
Current error message: qemu-system-x86_64: -chardev spice,id=foo: Parameter 'driver' expects an abstract device type while in fact the meaning is in reverse, -chardev expects a non-abstract device type. Fixes: 777357d758d9 ("chardev: qom-ify" 2016-12-07) Signed-off-by: Michael Tokarev

[Stable-8.2.1 06/38] configure: use a native non-cross compiler for linux-user

2024-01-17 Thread Michael Tokarev
From: Paolo Bonzini Commit c2118e9e1ab ("configure: don't try a "native" cross for linux-user", 2023-11-23) sought to avoid issues with using the native compiler with a cross-endian or cross-bitness setup. However, in doing so it ended up requiring a cross compiler setup (and most likely a slow

[Stable-8.2.1 04/38] target/riscv/kvm: do not use non-portable strerrorname_np()

2024-01-17 Thread Michael Tokarev
From: Natanael Copa strerrorname_np is non-portable and breaks building with musl libc. Use strerror(errno) instead, like we do other places. Cc: qemu-sta...@nongnu.org Fixes: commit 082e9e4a58ba (target/riscv/kvm: improve 'init_multiext_cfg' error msg) Resolves:

[Stable-8.2.1 11/38] audio/audio.c: remove trailing newline in error_setg

2024-01-17 Thread Michael Tokarev
error_setg() appends newline to the formatted message. Fixes: cb94ff5f80c5 ("audio: propagate Error * out of audio_init") Signed-off-by: Michael Tokarev Reviewed-by: Philippe Mathieu-Daudé (cherry picked from commit 09a36158c283f7448d1b00fdbb6634f05d27f922) Signed-off-by: Michael Tokarev diff

[Stable-8.2.1 07/38] target/i386: the sgx_epc_get_section stub is reachable

2024-01-17 Thread Michael Tokarev
From: Paolo Bonzini The sgx_epc_get_section stub is reachable from cpu_x86_cpuid. It should not assert, instead it should just return true just like the "real" sgx_epc_get_section does when SGX is disabled. Reported-by: Vladimír Beneš Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini

[Stable-8.2.1 03/38] iotests: Basic tests for internal snapshots

2024-01-17 Thread Michael Tokarev
From: Kevin Wolf We have a few test cases that include tests for corner case aspects of internal snapshots, but nothing that tests that they actually function as snapshots or that involves deleting a snapshot. Add a test for this kind of basic internal snapshot functionality. The error cases

[Stable-8.2.1 08/38] hw/net/can/sja1000: fix bug for single acceptance filter and standard frame

2024-01-17 Thread Michael Tokarev
From: Pavel Pisa A CAN sja1000 standard frame filter mask has been computed and applied incorrectly for standard frames when single Acceptance Filter Mode (MOD_AFM = 1) has been selected. The problem has not been found by Linux kernel testing because it uses dual filter mode (MOD_AFM = 0) and

[Stable-8.2.1 00/38] Patch Round-up for stable 8.2.1, freeze on 2024-01-27

2024-01-17 Thread Michael Tokarev
The following patches are queued for QEMU stable v8.2.1: https://gitlab.com/qemu-project/qemu/-/commits/staging-8.2 Patch freeze is 2024-01-27, and the release is planned for 2024-01-29: https://wiki.qemu.org/Planning/8.2 Please respond here or CC qemu-sta...@nongnu.org on any additional

[Stable-8.2.1 17/38] tcg/ppc: Use new registers for LQ destination

2024-01-17 Thread Michael Tokarev
From: Richard Henderson LQ has a constraint that RTp != RA, else SIGILL. Therefore, force the destination of INDEX_op_qemu_*_ld128 to be a new register pair, so that it cannot overlap the input address. This requires new support in process_op_defs and tcg_reg_alloc_op. Cc:

[PATCH v3] hw/char/imx_serial: Implement receive FIFO and ageing timer for imx serial.

2024-01-17 Thread Rayhan Faizel
This patch implements a 32 half word FIFO as per imx serial device specifications. If a non empty FIFO is below the trigger level, an ageing timer will tick for a duration of 8 characters. On expiry, AGTIM will be set triggering an interrupt. AGTIM timer resets when there is activity in the

Re: [RFC PATCH v3 15/30] io: Add a pwritev/preadv version that takes a discontiguous iovec

2024-01-17 Thread Peter Xu
On Wed, Jan 17, 2024 at 03:06:15PM -0300, Fabiano Rosas wrote: > Oh no, you're right. Because of p->pending_job. And thinking about > p->pending_job, wouldn't a trylock to the same job while being more > explicit? > > next_channel %= migrate_multifd_channels(); > for (i = next_channel;; i

RE: [RFC 4/7] virtio-iommu: Implement PCIIOMMUOps set_host_resv_regions

2024-01-17 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Subject: [RFC 4/7] virtio-iommu: Implement PCIIOMMUOps >set_host_resv_regions > >Reuse the implementation of virtio_iommu_set_iova_ranges() which >will be removed in subsequent patches. > >Signed-off-by: Eric Auger >--- >

Re: [PATCH v2 2/2] target/riscv: Export sdtrig in ISA string

2024-01-17 Thread Andrew Jones
On Wed, Jan 17, 2024 at 07:54:12PM +0530, Himanshu Chauhan wrote: > This patch adds "x-sdtrig" in the ISA string when sdtrig extension is enabled. > The sdtrig extension may or may not be implemented in a system. Therefore, the > -cpu rv64,x-sdtrig= > option can be used to dynamically

Re: [PATCH 0/3] s390x/pci: fix ISM reset

2024-01-17 Thread Michael Tokarev
18.01.2024 10:19, Thomas Huth: Is it a -stable material, or not worth picking up for stable? It's definitely stable material, but IIUC there will be a v2 with some minor fixes. Yeah, I figured there will be v2. Just to remind, - please add Cc: qemu-stable@ when appropriate (or mark it any

RE: [RFC 2/7] hw/pci: Introduce pci_device_iommu_bus

2024-01-17 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: [RFC 2/7] hw/pci: Introduce pci_device_iommu_bus > >This helper will allow subsequent patches to retrieve the IOMMU bus >and call its associated PCIIOMMUOps callbacks. > >Signed-off-by: Eric Auger >--- > include/hw/pci/pci.h | 1 + >

Re: [PATCH] vfio: use matching sizeof type

2024-01-17 Thread Paolo Bonzini
Il gio 18 gen 2024, 06:09 Peter Xu ha scritto: > On Wed, Jan 17, 2024 at 05:03:44PM +0100, Paolo Bonzini wrote: > > Do not use uint64_t for the type of the declaration and __u64 when > > computing the number of elements in the array. > > > > Signed-off-by: Paolo Bonzini > > --- > >

Re: [PATCH] vfio: use matching sizeof type

2024-01-17 Thread Cédric Le Goater
On 1/18/24 06:09, Peter Xu wrote: On Wed, Jan 17, 2024 at 05:03:44PM +0100, Paolo Bonzini wrote: Do not use uint64_t for the type of the declaration and __u64 when computing the number of elements in the array. Signed-off-by: Paolo Bonzini --- hw/vfio/common.c | 2 +- 1 file changed, 1

Re: [PATCH 0/3] s390x/pci: fix ISM reset

2024-01-17 Thread Thomas Huth
On 18/01/2024 07.03, Michael Tokarev wrote: 17.01.2024 01:31, Matthew Rosato: Commit ef1535901a0 (re-)introduced an issue where passthrough ISM devices on s390x would enter an error state after reboot.  This was previously fixed by 03451953c79e, using device reset callbacks, however the change

Re: [PATCH 2/2] tests/tcg/s390x: Import linux tools/testing/crypto/chacha20-s390

2024-01-17 Thread Thomas Huth
On 17/01/2024 22.36, Richard Henderson wrote: Modify and simplify the driver, as we're really only interested in correctness of translation of chacha-vx.S. Signed-off-by: Richard Henderson --- tests/tcg/s390x/chacha.c| 341 tests/tcg/s390x/Makefile.target | 4 +

Re: [RFC PATCH v3 13/30] migration/multifd: Add outgoing QIOChannelFile support

2024-01-17 Thread Peter Xu
On Wed, Jan 17, 2024 at 02:34:18PM -0300, Fabiano Rosas wrote: > Well this sequence: > > multifd_new_send_channel_async() -> multifd_channel_connect() -> > multifd_tls_channel_connect() -> new thread -> > multifd_tls_handshake_thread() -> new task -> > multifd_tls_outgoing_handshake() ->

RE: [RFC 0/7] VIRTIO-IOMMU/VFIO: Fix host iommu geometry handling for hotplugged devices

2024-01-17 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Cc: m...@redhat.com; c...@redhat.com >Subject: [RFC 0/7] VIRTIO-IOMMU/VFIO: Fix host iommu geometry handling >for hotplugged devices > >In [1] we attempted to fix a case where a VFIO-PCI device protected >with a virtio-iommu was assigned to

Re: [PATCH 1/2] tcg/s390x: Fix encoding of VRIc, VRSa, VRSc insns

2024-01-17 Thread Richard Henderson
On 1/18/24 17:50, Thomas Huth wrote: Do you want to take it through our TCG branch or shall I pick it up for my s390x branch? I can take it through tcg. r~

Re: [PATCH 0/2] tcg/s390x: Fix chacha20-s390

2024-01-17 Thread Richard Henderson
On 1/18/24 17:07, Michael Tokarev wrote: Why the problem didn't occur on non-s390x *host*?  As I noted in my initial email, the testcase worked on amd64 host but not on s390x host.. Because the error was in the s390x host tcg backend. r~

Re: [PATCH 3/3] s390x/pci: drive ISM reset from subsystem reset

2024-01-17 Thread Cédric Le Goater
On 1/17/24 22:11, Matthew Rosato wrote: On 1/17/24 10:19 AM, Matthew Rosato wrote: On 1/17/24 6:01 AM, Cédric Le Goater wrote: Adding Alex, On 1/16/24 23:31, Matthew Rosato wrote: ISM devices are sensitive to manipulation of the IOMMU, so the ISM device needs to be reset before the vfio-pci

Re: [PATCH] migration: Plug memory leak on HMP migrate error path

2024-01-17 Thread Peter Xu
On Wed, Jan 17, 2024 at 03:07:22PM +0100, Markus Armbruster wrote: > hmp_migrate() leaks @caps when qmp_migrate() fails. Plug the leak > with g_autoptr(). > > Fixes: 967f2de5c9ec (migration: Implement MigrateChannelList to hmp migration > flow.) v8.2.0-rc0 > Fixes: CID 1533124 > Signed-off-by:

Re: [PATCH 1/2] tcg/s390x: Fix encoding of VRIc, VRSa, VRSc insns

2024-01-17 Thread Thomas Huth
On 17/01/2024 22.36, Richard Henderson wrote: While the format names the second vector register 'v3', it is still in the second position (bits 12-15) and the argument to RXB must match. Example error: - e7 00 00 10 2a 33 verllf %v16,%v0,16 + e7 00 00 10 2c 33 verllf

Re: [PATCH] qdev: not add devices to bus in reverse order

2024-01-17 Thread Kai
On 1/18/24 01:31, Peter Maydell wrote: (cc'd the people listed for this file in MAINTAINERS) On Tue, 9 Jan 2024 at 13:53, Kai Kang wrote: When this section of source codes were added via commit: * 02e2da45c4 Add common BusState it added devices to bus with LIST_INSERT_HEAD() which operated

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

2024-01-17 Thread Tomoyuki Hirose
Hello, Thank you for reviewing my patches. Examples of corner case you explained is very helpful. I'm currently working on patches. I will submit v2 as soon as it's completed, so please wait a little longer. thanks, Tomoyuki HIROSE

[PATCH] qemu-docs: Update options for graphical frontends

2024-01-17 Thread Yihuan Pan
The command line options `-ctrl-grab` and `-alt-grab` have been removed in QEMU 7.1. Instead, use the `-display sdl,grab-mod=` option to specify the grab modifiers. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2103 Signed-off-by: Yihuan Pan --- docs/system/keys.rst.inc | 5 +++-- 1

Re: Assistance Required for QEMU Hardfault Error with Cortex-M33 on MPS2AN505

2024-01-17 Thread sanjana gogte
Hi, 1) I am using QEMU Version 7.1.0. I am currently using this version with a plan to connect the remote port from Xilinx to the mps2an505 board. The decision to use this specific version is heavily influenced by the fact that it is the same version utilized by Xilinx's QEMU. 2) Debug Logs :

Re: [PATCH 0/2] tcg/s390x: Fix chacha20-s390

2024-01-17 Thread Michael Tokarev
18.01.2024 00:36, Richard Henderson: So it turns out the regression exposed by "Optimize env memory operations" is caused by an s390x host encoding error. This is the first time that we have had sufficient register pressure to use more than a few vector registers at the same time. As such, the

Re: [PATCH 0/3] s390x/pci: fix ISM reset

2024-01-17 Thread Michael Tokarev
17.01.2024 01:31, Matthew Rosato: Commit ef1535901a0 (re-)introduced an issue where passthrough ISM devices on s390x would enter an error state after reboot. This was previously fixed by 03451953c79e, using device reset callbacks, however the change in ef1535901a0 effectively triggers a cold

Re: [PATCH 3/3] cli: Remove deprecated '-singlestep' command line option

2024-01-17 Thread Thomas Huth
On 17/01/2024 16.14, Philippe Mathieu-Daudé wrote: This option has been deprecated before the 8.1 release, in commit 12fd0f41d0 ("Document that -singlestep command line option is deprecated"). Time to drop it. Inspired-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH v3 13/15] spapr: nested: Introduce H_GUEST_RUN_VCPU hcall.

2024-01-17 Thread Harsh Prateek Bora
The H_GUEST_RUN_VCPU hcall is used to start execution of a Guest VCPU. The Hypervisor will update the state of the Guest VCPU based on the input buffer, restore the saved Guest VCPU state, and start its execution. The Guest VCPU can stop running for numerous reasons including HCALLs, hypervisor

[PATCH v3 14/15] spapr: nested: Introduce cap-nested-papr for Nested PAPR API

2024-01-17 Thread Harsh Prateek Bora
Introduce a SPAPR capability cap-nested-papr which enables nested PAPR API for nested guests. This new API is to enable support for KVM on PowerVM and the support in Linux kernel has already merged upstream. Signed-off-by: Michael Neuling Signed-off-by: Harsh Prateek Bora ---

[PATCH v3 12/15] spapr: nested: Use correct source for parttbl info for nested PAPR API.

2024-01-17 Thread Harsh Prateek Bora
For nested PAPR API, we use SpaprMachineStateNestedGuest struct to store partition table info, use the same in spapr_get_pate_nested() via helper. Signed-off-by: Michael Neuling Signed-off-by: Harsh Prateek Bora --- include/hw/ppc/spapr_nested.h | 4 hw/ppc/spapr.c| 2 ++

[PATCH v3 06/15] spapr: nested: Introduce H_GUEST_[GET|SET]_CAPABILITIES hcalls.

2024-01-17 Thread Harsh Prateek Bora
Introduce the nested PAPR hcalls: - H_GUEST_GET_CAPABILITIES which is used to query the capabilities of the API and the L2 guests it provides. - H_GUEST_SET_CAPABILITIES which is used to set the Guest API capabilities that the Host Partition supports and may use. [amachhiw: support for p9

[PATCH v3 08/15] spapr: nested: Introduce H_GUEST_CREATE_VCPU hcall.

2024-01-17 Thread Harsh Prateek Bora
Introduce the nested PAPR hcall H_GUEST_CREATE_VCPU which is used to create and initialize the specified VCPU resource for the previously created guest. Each guest can have multiple VCPUs upto max 2048. All VCPUs for a guest gets deallocated on guest delete. Signed-off-by: Michael Neuling

[PATCH v3 09/15] spapr: nested: Extend nested_ppc_state for nested PAPR API

2024-01-17 Thread Harsh Prateek Bora
Currently, nested_ppc_state stores a certain set of registers and works with nested_[load|save]_state() for state transfer as reqd for nested-hv API. Extending these with additional registers state as reqd for nested PAPR API. Signed-off-by: Harsh Prateek Bora Suggested-by: Nicholas Piggin ---

[PATCH v3 00/15] Nested PAPR API (KVM on PowerVM)

2024-01-17 Thread Harsh Prateek Bora
There is an existing Nested-HV API to enable nested guests on powernv machines. However, that is not supported on pseries/PowerVM LPARs. This patch series implements required hcall interfaces to enable nested guests with KVM on PowerVM. Unlike Nested-HV, with this API, entire L2 state is retained

[PATCH v3 15/15] spapr: nested: Set the PCR when logical PVR is set

2024-01-17 Thread Harsh Prateek Bora
From: Amit Machhiwal In APIv1, KVM L0 sets the PCR, while in the nested papr APIv2, this doesn't work as the PCR can't be set via the guest state buffer; the logical PVR is set via the GSB though. This change sets the PCR whenever the logical PVR is set via the GSB. Also, unlike the other

[PATCH v3 01/15] spapr: nested: register nested-hv api hcalls only for cap-nested-hv

2024-01-17 Thread Harsh Prateek Bora
Since cap-nested-hv is an optional capability, it makes sense to register api specfic hcalls only when respective capability is enabled. Signed-off-by: Harsh Prateek Bora Reviewed-by: Nicholas Piggin --- include/hw/ppc/spapr.h| 1 + include/hw/ppc/spapr_nested.h | 1 -

[PATCH v3 02/15] spapr: nested: move nested part of spapr_get_pate into spapr_nested.c

2024-01-17 Thread Harsh Prateek Bora
Most of the nested code has already been moved to spapr_nested.c This logic inside spapr_get_pate is related to nested guests and better suited for spapr_nested.c, hence moving there. Signed-off-by: Harsh Prateek Bora Reviewed-by: Nicholas Piggin --- include/hw/ppc/spapr_nested.h | 3 ++-

[PATCH v3 11/15] spapr: nested: Introduce H_GUEST_[GET|SET]_STATE hcalls.

2024-01-17 Thread Harsh Prateek Bora
Introduce the nested PAPR hcalls: - H_GUEST_GET_STATE which is used to get state of a nested guest or a guest VCPU. The value field for each element in the request is ignored and on success, will be updated to reflect current state. - H_GUEST_SET_STATE which is used to modify

[PATCH v3 07/15] spapr: nested: Introduce H_GUEST_[CREATE|DELETE] hcalls.

2024-01-17 Thread Harsh Prateek Bora
Introduce the nested PAPR hcalls: - H_GUEST_CREATE which is used to create and allocate resources for nested guest being created. - H_GUEST_DELETE which is used to delete and deallocate resources for the nested guest being deleted. It also supports deleting all nested guests at once using

[PATCH v3 03/15] spapr: nested: Introduce SpaprMachineStateNested to store related info.

2024-01-17 Thread Harsh Prateek Bora
Currently, nested_ptcr is being used by existing nested-hv API to store nested guest related info. This need to be organised to extend support for the nested PAPR API which would need to store additional info related to nested guests in next series of patches. Signed-off-by: Michael Neuling

[PATCH v3 10/15] spapr: nested: Initialize the GSB elements lookup table.

2024-01-17 Thread Harsh Prateek Bora
Nested PAPR API provides a standard Guest State Buffer (GSB) format with unique IDs for each guest state element for which get/set state is supported by the API. Some of the elements are read-only and/or guest-wide. Introducing helper routines for state exchange of each of the nested guest state

[PATCH v3 04/15] spapr: nested: keep nested-hv related code restricted to its API.

2024-01-17 Thread Harsh Prateek Bora
spapr_exit_nested and spapr_get_pate_nested_hv contains code which is specific to nested-hv API. Isolating code flows based on API helps extending it to be used with different API as well. Signed-off-by: Harsh Prateek Bora Suggested-by: Nicholas Piggin --- include/hw/ppc/spapr_nested.h | 4

[PATCH v3 05/15] spapr: nested: Document Nested PAPR API

2024-01-17 Thread Harsh Prateek Bora
Adding initial documentation about Nested PAPR API to describe the set of APIs and its usage. Also talks about the Guest State Buffer elements and it's format which is used between L0/L1 to communicate L2 state. Signed-off-by: Michael Neuling Signed-off-by: Harsh Prateek Bora ---

Re: [PATCH] vfio: use matching sizeof type

2024-01-17 Thread Peter Xu
On Wed, Jan 17, 2024 at 05:03:44PM +0100, Paolo Bonzini wrote: > Do not use uint64_t for the type of the declaration and __u64 when > computing the number of elements in the array. > > Signed-off-by: Paolo Bonzini > --- > hw/vfio/common.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH v2 2/2] docs/about: Deprecate the old "power5+" and "power7+" CPU names

2024-01-17 Thread Harsh Prateek Bora
On 1/17/24 19:40, Thomas Huth wrote: For consistency we should drop the names with a "+" in it in the long run. Signed-off-by: Thomas Huth Reviewed-by: Harsh Prateek Bora --- docs/about/deprecated.rst | 9 + 1 file changed, 9 insertions(+) diff --git

Re: [PATCH v2 1/2] target/ppc/cpu-models: Rename power5+ and power7+ for new QOM naming rules

2024-01-17 Thread Harsh Prateek Bora
On 1/17/24 19:40, Thomas Huth wrote: The character "+" is now forbidden in QOM device names (see commit b447378e1217 - "Limit type names to alphanumerical and some few special characters"). For the "power5+" and "power7+" CPU names, there is currently a hack in type_name_is_valid() to still

Re: [PATCH] userfaultfd: use 1ULL to build ioctl masks

2024-01-17 Thread Peter Xu
On Wed, Jan 17, 2024 at 05:03:13PM +0100, Paolo Bonzini wrote: > There is no need to use the Linux-internal __u64 type, 1ULL is > guaranteed to be wide enough. > > Signed-off-by: Paolo Bonzini queued in staging, thanks. -- Peter Xu

[PATCH] ppc/pnv: Add PowerPC Special Purpose Registers (SPRs):

2024-01-17 Thread dan tan
The handling of the following SPRs are added - ITV1 (0x375, 885) - noop (not in Power10 ISA) SIER2 (0x2f0, 752) - Sampled Instruction Event Register 2 SIER2 (0x2f1, 753) - Sampled Instruction Event Register 3 MMCR3 (0x2f2, 754) - Performance Monitor Mode

[PATCH] ppc/pnv: Add PowerPC Special Purpose Registers

2024-01-17 Thread dan tan
The handling of the following two registers are added - DAWR1 (0x0bd, 189) - Data Address Watchpoint 1 DAWRX1 (0x0b5, 181) - Data Address Watchpoint Extension 1 Signed-off-by: dan tan --- target/ppc/cpu.c | 51

[PATCH v2 09/14] contrib/plugins/hotblocks: migrate to new per_vcpu API

2024-01-17 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- contrib/plugins/hotblocks.c | 46 + 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 4de1b134944..fa1e2f02178 100644 ---

[PATCH v2 00/14] TCG Plugin inline operation enhancement

2024-01-17 Thread Pierrick Bouvier
This series adds a new thread-safe API to declare inline operation inside plugins. As well, it removes the existing non thread-safe API, and migrates all existing plugins to use it. Tested on Linux (user, system) for i386, x86_64 and aarch64. To give some context, this a long term series of work

[PATCH v2 04/14] plugins: add inline operation per vcpu

2024-01-17 Thread Pierrick Bouvier
Extends API with three new functions: qemu_plugin_register_vcpu_{tb, insn, mem}_exec_inline_per_vcpu(). Those functions takes a qemu_plugin_u64_t as input. This allows to have a thread-safe and type-safe version of inline operations. Signed-off-by: Pierrick Bouvier ---

[PATCH v2 01/14] plugins: implement inline operation relative to cpu_index

2024-01-17 Thread Pierrick Bouvier
Instead of working on a fixed memory location, allow to address it based on cpu_index, an element size and a given offset. Result address: ptr + offset + cpu_index * element_size. With this, we can target a member in a struct array from a base pointer. Current semantic is not modified, thus

[PATCH v2 13/14] MAINTAINERS: Add myself as reviewer for TCG Plugins

2024-01-17 Thread Pierrick Bouvier
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Pierrick Bouvier --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index b406fb20c05..206d813ea5e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3675,6 +3675,7 @@ TCG Plugins M: Alex Bennée R:

[PATCH v2 07/14] tests/plugin/insn: migrate to new per_vcpu API

2024-01-17 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- tests/plugin/insn.c | 106 +--- 1 file changed, 50 insertions(+), 56 deletions(-) diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c index 5fd3017c2b3..6fff51121d4 100644 --- a/tests/plugin/insn.c +++

[PATCH v2 11/14] plugins: remove non per_vcpu inline operation from API

2024-01-17 Thread Pierrick Bouvier
Now we have a thread-safe equivalent of inline operation, and that all plugins were changed to use it, there is no point to keep the old API. In more, it will help when we implement more functionality (conditional callbacks), as we can assume that we operate on a scoreboard. Bump API version as

[PATCH v2 03/14] docs/devel: plugins can trigger a tb flush

2024-01-17 Thread Pierrick Bouvier
When scoreboards need to be reallocated. Signed-off-by: Pierrick Bouvier --- docs/devel/multi-thread-tcg.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/devel/multi-thread-tcg.rst b/docs/devel/multi-thread-tcg.rst index 7302c3bf534..1420789fff3 100644 ---

[PATCH v2 12/14] plugins: register inline op with a qemu_plugin_u64_t

2024-01-17 Thread Pierrick Bouvier
Now inline previous API was removed, we can cleanup code path associated. Signed-off-by: Pierrick Bouvier --- accel/tcg/plugin-gen.c | 7 ++- include/qemu/plugin.h | 1 - plugins/api.c | 12 +++- plugins/core.c | 17 ++--- plugins/plugin.h | 3

[PATCH v2 05/14] tests/plugin: add test plugin for inline operations

2024-01-17 Thread Pierrick Bouvier
For now, it simply performs instruction, bb and mem count, and ensure that inline vs callback versions have the same result. Later, we'll extend it when new inline operations are added. Use existing plugins to test everything works is a bit cumbersome, as different events are treated in different

[PATCH v2 08/14] tests/plugin/bb: migrate to new per_vcpu API

2024-01-17 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- tests/plugin/bb.c | 63 +++ 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index df50d1fd3bc..3f0c25883de 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c

[PATCH v2 14/14] contrib/plugins/execlog: fix new warnings

2024-01-17 Thread Pierrick Bouvier
‘g_pattern_match_string’ is deprecated, Use 'g_pattern_spec_match_string' instead. passing argument 2 of ‘g_ptr_array_add’ discards ‘const’ qualifier from pointer target type Signed-off-by: Pierrick Bouvier --- contrib/plugins/execlog.c | 6 +++--- 1 file changed, 3 insertions(+), 3

[PATCH v2 02/14] plugins: scoreboard API

2024-01-17 Thread Pierrick Bouvier
We introduce a cpu local storage, automatically managed (and extended) by QEMU itself. Plugin allocate a scoreboard, and don't have to deal with how many cpus are launched. This API will be used by new inline functions but callbacks can benefit from this as well. This way, they can operate

[PATCH v2 10/14] contrib/plugins/howvec: migrate to new per_vcpu API

2024-01-17 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- contrib/plugins/howvec.c | 50 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 644a7856bb2..497b86fcd6b 100644 --- a/contrib/plugins/howvec.c +++

[PATCH v2 06/14] tests/plugin/mem: migrate to new per_vcpu API

2024-01-17 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- tests/plugin/mem.c | 39 --- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/tests/plugin/mem.c b/tests/plugin/mem.c index 44e91065ba7..83b7fa1f187 100644 --- a/tests/plugin/mem.c +++ b/tests/plugin/mem.c @@

Re: [PATCH V2 11/11] vfio: allow cpr-reboot migration if suspended

2024-01-17 Thread Peter Xu
On Wed, Jan 17, 2024 at 04:30:48PM -0500, Steven Sistare wrote: > On 1/17/2024 2:12 AM, Peter Xu wrote: > > On Tue, Jan 16, 2024 at 03:37:33PM -0500, Steven Sistare wrote: > >> On 1/15/2024 2:33 AM, Peter Xu wrote: > >>> On Fri, Jan 12, 2024 at 07:05:10AM -0800, Steve Sistare wrote: > Allow

Re: [PATCH v1 2/2] memory-device: reintroduce memory region size check

2024-01-17 Thread Zhenyu Zhang
[PATCH v1 2/2] memory-device: reintroduce memory region size check Test on 64k basic page size aarch64 The patches work well on my Ampere host. The test results are as expected. (a) 1M with 512M THP /home/zhenyzha/sandbox/qemu.main/build/qemu-system-aarch64 \ -name 'avocado-vt-vm1' \ -sandbox

  1   2   3   4   >