[PULL v2 07/15] s390x: introduce s390_get_memory_limit()

2024-12-21 Thread David Hildenbrand
Let's add s390_get_memory_limit(), to query what has been successfully set via s390_set_memory_limit(). Allow setting the limit only once. We'll remember the limit in the machine state. Move s390_set_memory_limit() to machine code, merging it into set_memory_limit(), because this really is a machi

[PULL v2 13/15] s390x: remember the maximum page size

2024-12-21 Thread David Hildenbrand
Let's remember the value (successfully) set via s390_set_max_pagesize(). This will be helpful to reject hotplugged memory devices that would exceed this initially set page size. Handle it just like how we handle s390_get_memory_limit(), storing it in the machine, and moving the handling to machine

[PULL v2 15/15] s390x: virtio-mem support

2024-12-21 Thread David Hildenbrand
Let's add our virtio-mem-ccw proxy device and wire it up. We should be supporting everything (e.g., device unplug, "dynamic-memslots") that we already support for the virtio-pci variant. With a Linux guest that supports virtio-mem (and has automatic memory onlining properly configured) the followi

[PULL v2 04/15] s390x/s390-virtio-hcall: prepare for more diag500 hypercalls

2024-12-21 Thread David Hildenbrand
Let's generalize, abstracting the virtio bits. diag500 is now a generic hypercall to handle QEMU/KVM specific things. Explicitly specify all already defined subcodes, including legacy ones (so we know what we can use for new hypercalls). Move the PGM_SPECIFICATION injection into the renamed functi

[PULL v2 08/15] s390x/s390-hypercall: introduce DIAG500 STORAGE_LIMIT

2024-12-21 Thread David Hildenbrand
A guest OS that supports memory hotplug / memory devices must during boot be aware of the maximum possible physical memory address that it might have to handle at a later stage during its runtime. For example, the maximum possible memory address might be required to prepare the kernel virtual addr

[PULL v2 05/15] s390x: rename s390-virtio-hcall* to s390-hypercall*

2024-12-21 Thread David Hildenbrand
Let's make it clearer that we are talking about general QEMU/KVM-specific hypercalls. Message-ID: <20241219144115.2820241-5-da...@redhat.com> Acked-by: Michael S. Tsirkin Reviewed-by: Thomas Huth Signed-off-by: David Hildenbrand --- hw/s390x/meson.build | 2 +- hw

[PULL v2 11/15] s390x/s390-virtio-ccw: prepare for memory devices

2024-12-21 Thread David Hildenbrand
Let's prepare our address space for memory devices if enabled via "maxmem" and if we have CONFIG_MEM_DEVICE enabled at all. Note that CONFIG_MEM_DEVICE will be selected automatically once we add support for devices. Just like on other architectures, the region container for memory devices is place

[PULL v2 10/15] s390x/s390-skeys: prepare for memory devices

2024-12-21 Thread David Hildenbrand
With memory devices, we will have storage keys for memory that exceeds the initial ram size. The TODO already states that current handling is subopimal, but we won't worry about improving that (TCG-only) thing for now. Message-ID: <20241219144115.2820241-10-da...@redhat.com> Acked-by: Michael S.

[PULL v2 01/15] virtio-mem: unplug memory only during system resets, not device resets

2024-12-21 Thread David Hildenbrand
We recently converted from the LegacyReset to the new reset framework in commit c009a311e939 ("virtio-mem: Use new Resettable framework instead of LegacyReset") to be able to use the ResetType to filter out wakeup resets. However, this change had an undesired implications: as we override the Reset

[PULL v2 12/15] s390x/pv: prepare for memory devices

2024-12-21 Thread David Hildenbrand
Let's avoid checking for the maxram_size, and instead rely on the memory limit determined in s390_memory_init(), that might be larger than maxram_size, for example due to alignment purposes. This check now correctly mimics what the kernel will check in kvm_s390_pv_set_aside(), whereby a VM <= 2 Gi

[PULL v2 09/15] s390x/s390-stattrib-kvm: prepare for memory devices and sparse memory layouts

2024-12-21 Thread David Hildenbrand
With memory devices, we will have storage attributes for memory that exceeds the initial ram size. Further, we can easily have memory holes, for which there (currently) are no storage attributes. In particular, with memory holes, KVM_S390_SET_CMMA_BITS will fail to set some storage attributes. So

[PULL v2 02/15] s390x/s390-virtio-ccw: don't crash on weird RAM sizes

2024-12-21 Thread David Hildenbrand
KVM is not happy when starting a VM with weird RAM sizes: # qemu-system-s390x --enable-kvm --nographic -m 1234K qemu-system-s390x: kvm_set_user_memory_region: KVM_SET_USER_MEMORY_REGION failed, slot=0, start=0x0, size=0x244000: Invalid argument kvm_set_phys_mem: error registering slot: I

[PULL v2 00/15] Host Memory Backends and Memory devices queue 2024-12-21

2024-12-21 Thread David Hildenbrand
Hi, this is the updated pull request from 2024-12-18; gitlab-ci seems to be happy with it (container,build,avocado tests). The following changes since commit 9863d46a5a25bfff7d2195ad5e3127ab3bae0a2b: Merge tag 'pull-loongarch-20241219' of https://gitlab.com/bibo-mao/qemu into staging (2024-12

[PULL v2 14/15] s390x/virtio-ccw: add support for virtio based memory devices

2024-12-21 Thread David Hildenbrand
Let's implement support for abstract virtio based memory devices, using the virtio-pci implementation as an orientation. Wire them up in the machine hotplug handler, taking care of s390x page size limitations. As we neither support virtio-mem or virtio-pmem yet, the code is effectively unused. We'

[PULL v2 03/15] s390x/s390-virtio-hcall: remove hypercall registration mechanism

2024-12-21 Thread David Hildenbrand
Nowadays, we only have a single machine type in QEMU, everything is based on virtio-ccw and the traditional virtio machine does no longer exist. No need to dynamically register diag500 handlers. Move the two existing handlers into s390-virtio-hcall.c. Message-ID: <20241219144115.2820241-3-da...@re

[PULL v2 06/15] s390x/s390-virtio-ccw: move setting the maximum guest size from sclp to machine code

2024-12-21 Thread David Hildenbrand
Nowadays, it feels more natural to have that code located in s390_memory_init(), where we also have direct access to the machine object. While at it, use the actual RAM size, not the maximum RAM size which cannot currently be reached without support for any memory devices. Consequently update s390

Re: [PULL 12/40] rust: build integration test for the qemu_api crate

2024-12-21 Thread Bernhard Beschow
Am 20. Dezember 2024 10:42:09 UTC schrieb Paolo Bonzini : > > >On Thu, Dec 19, 2024 at 12:22 PM Paolo Bonzini wrote: >> >> On 12/19/24 10:53, Bernhard Beschow wrote: >> > >> > >> > Am 4. November 2024 17:26:51 UTC schrieb Paolo Bonzini >> > : >> >> Adjust the integration test to compile with

Re: [PULL 00/59] Accel & exec patches for 2024-12-20

2024-12-21 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL v2 00/39] riscv-to-apply queue

2024-12-21 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL v3 00/42] Rust, qdev, target/i386 changes for 2024-12-19

2024-12-21 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes. signature.asc Description: PGP signature

[PATCH] accel/tcg: Move gen_intermediate_code to TCGCPUOps.translate_core

2024-12-21 Thread Richard Henderson
Convert all targets simultaneously, as the gen_intermediate_code function disappears from the target. While there are possible workarounds, they're larger than simply performing the conversion. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 8 +--- accel/tcg/transl

Re: [PATCH v2] physmem: allow cpu_memory_rw_debug to write to MMIO devices

2024-12-21 Thread David Hildenbrand
On 20.12.24 23:22, vringar wrote: On 20/12/2024 21:59, David Hildenbrand wrote: Good point, I suspect that will be problematic. Looking at flatview_write_continue I see no early exit, so maybe it would still try to get through everything and work as we are hoping, but that's why I'd like to wr

Re: [PATCH RFCv2 00/20] kvm/arm: Introduce a customizable aarch64 KVM host model

2024-12-21 Thread Marc Zyngier
On Fri, 20 Dec 2024 11:52:51 +, Kashyap Chamarthy wrote: > > On Thu, Dec 19, 2024 at 03:41:56PM +, Marc Zyngier wrote: > > On Thu, 19 Dec 2024 15:07:25 +, > > Kashyap Chamarthy wrote: > > > > > > On Thu, Dec 19, 2024 at 12:26:29PM +, Marc Zyngier wrote: > > > > On Thu, 19 Dec 20

Re: [PATCH RFCv2 00/20] kvm/arm: Introduce a customizable aarch64 KVM host model

2024-12-21 Thread Marc Zyngier
On Thu, 19 Dec 2024 17:51:44 +, Daniel "P. Berrangé" wrote: > > On Thu, Dec 19, 2024 at 03:41:56PM +, Marc Zyngier wrote: > > On Thu, 19 Dec 2024 15:07:25 +, > > Kashyap Chamarthy wrote: > > > > > > On Thu, Dec 19, 2024 at 12:26:29PM +, Marc Zyngier wrote: > > > > On Thu, 19 Dec

Re: [PATCH 5/5] qtest/e1000e|igb: Fix msix to re-trigger interrupts

2024-12-21 Thread Akihiko Odaki
On 2024/12/21 17:11, Nicholas Piggin wrote: On Sat Dec 21, 2024 at 2:26 PM AEST, Akihiko Odaki wrote: On 2024/12/21 13:14, Nicholas Piggin wrote: On Thu Dec 19, 2024 at 6:53 PM AEST, Akihiko Odaki wrote: On 2024/12/18 16:42, Nicholas Piggin wrote: The e1000e and igb tests don't clear the msix

Re: [PATCH 5/5] qtest/e1000e|igb: Fix msix to re-trigger interrupts

2024-12-21 Thread Nicholas Piggin
On Sat Dec 21, 2024 at 2:26 PM AEST, Akihiko Odaki wrote: > On 2024/12/21 13:14, Nicholas Piggin wrote: > > On Thu Dec 19, 2024 at 6:53 PM AEST, Akihiko Odaki wrote: > >> On 2024/12/18 16:42, Nicholas Piggin wrote: > >>> The e1000e and igb tests don't clear the msix pending bit after waiting > >>>