Re: [PATCH v5 0/8] virtio-mem: Handle preallocation with migration

2023-01-23 Thread David Hildenbrand
On 17.01.23 12:22, David Hildenbrand wrote: While playing with migration of virtio-mem with an ordinary file backing, I realized that migration and prealloc doesn't currently work as expected for virtio-mem. Further, Jing Qi reported that setup issues (insufficient huge pages on the destin

Re: [PATCH v5 24/36] target/s390x: Use a single return for helper_divs32/u32

2023-01-26 Thread David Hildenbrand
On 26.01.23 05:38, Richard Henderson wrote: Pack the quotient and remainder into a single uint64_t. Signed-off-by: Richard Henderson --- v2: Fix operand ordering; use tcg_extr32_i64. Cc: David Hildenbrand Cc: Ilya Leoshkevich --- Reviewed-by: David Hildenbrand -- Thanks, David

Re: [PATCH v5 30/36] target/s390x: Use Int128 for returning float128

2023-01-26 Thread David Hildenbrand
On 26.01.23 05:38, Richard Henderson wrote: Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- v2: Remove extraneous return_low128. Cc: David Hildenbrand Cc: Ilya Leoshkevich --- Acked-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v5 31/36] target/s390x: Use Int128 for passing float128

2023-01-26 Thread David Hildenbrand
On 26.01.23 05:38, Richard Henderson wrote: Signed-off-by: Richard Henderson --- v2: Fix SPEC_in1_x1. Cc: David Hildenbrand Cc: Ilya Leoshkevich --- Acked-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v5 32/36] target/s390x: Use tcg_gen_atomic_cmpxchg_i128 for CDSG

2023-01-26 Thread David Hildenbrand
static DisasJumpType op_csst(DisasContext *s, DisasOps *o) @@ -5419,6 +5410,14 @@ static void prep_r1_P(DisasContext *s, DisasOps *o) } #define SPEC_prep_r1_P SPEC_r1_even +static void prep_r1_D64(DisasContext *s, DisasOps *o) +{ +int r1 = get_field(s, r1); +o->out_128 = tcg_temp

Re: [PATCH v5 33/36] target/s390x: Implement CC_OP_NZ in gen_op_calc_cc

2023-01-26 Thread David Hildenbrand
On 26.01.23 05:38, Richard Henderson wrote: This case is trivial to implement inline. Signed-off-by: Richard Henderson --- Cc: David Hildenbrand Cc: Ilya Leoshkevich --- Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v5 32/36] target/s390x: Use tcg_gen_atomic_cmpxchg_i128 for CDSG

2023-01-27 Thread David Hildenbrand
On 26.01.23 22:01, Richard Henderson wrote: On 1/26/23 01:27, David Hildenbrand wrote:   static DisasJumpType op_csst(DisasContext *s, DisasOps *o) @@ -5419,6 +5410,14 @@ static void prep_r1_P(DisasContext *s, DisasOps *o)   }   #define SPEC_prep_r1_P SPEC_r1_even +static void prep_r1_D64

Re: [PATCH v2] softmmu: Use memmove in flatview_write_continue

2023-01-31 Thread David Hildenbrand
/crash_47dfe62d9f911bf523ff48cd441b61c0013ed805 Signed-off-by: Akihiko Odaki Acked-by: Alexander Bulekov --- Acked-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v6 32/36] target/s390x: Use tcg_gen_atomic_cmpxchg_i128 for CDSG

2023-01-31 Thread David Hildenbrand
On 30.01.23 22:48, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Cc: David Hildenbrand Cc: Ilya Leoshkevich --- Acked-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [RFC PATCH v3 2/2] s390x: Implement the USER_SIGP_BUSY capability

2021-11-11 Thread David Hildenbrand
On 10.11.21 21:45, Eric Farman wrote: > With the USER_SIGP capability, the kernel will pass most (but not all) > SIGP orders to userspace for processing. But that means that the kernel > is unable to determine if/when the order has been completed by userspace, > and could potentially return an inco

Re: [PATCH] Fix tcg_out_vec_op argument type

2021-11-11 Thread David Hildenbrand
tcg_out_vec_op(TCGContext *s, TCGOpcode opc, >> unsigned vecl, unsigned vece, >> - const TCGArg *args, const int *const_args) >> + const TCGArg args[TCG_MAX_OP_ARGS], >> + const int const_args[TCG_MAX_OP_ARGS]) >> { >> TCGType type = vecl + TCG_TYPE_V64; >> TCGArg a0 = args[0], a1 = args[1], a2 = args[2]; > > Reviewed-by: Thomas Huth > Acked-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v2 0/3] Some watchpoint-related patches

2021-11-11 Thread David Hildenbrand
On 11.11.21 10:55, Pavel Dovgalyuk wrote: > The series includes several watchpoint-related patches. > > v2 changes: > - added patch to fix races with interrupts > - added patch to process watchpoints-on-stack > - removed upstreamed patches Out of interest, do we have any reproducer / tests for

Re: [PATCH v2 2/3] softmmu: fix watchpoint-interrupt races

2021-11-12 Thread David Hildenbrand
if (replay_mode == REPLAY_MODE_PLAY && !replay_has_interrupt()) { > /* Do nothing */ > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v2] hw/arm/virt: Expose empty NUMA nodes through ACPI

2021-11-16 Thread David Hildenbrand
>> >> Examples include exposing HBM or PMEM to the VM. Just like on real HW, >> this memory is exposed via cpu-less, special nodes. In contrast to real >> HW, the memory is hotplugged later (I don't think HW supports hotplug >> like that yet, but it might just be a matter of time). > > I suppose s

Re: [PATCH v2] hw/arm/virt: Expose empty NUMA nodes through ACPI

2021-11-17 Thread David Hildenbrand
On 17.11.21 15:30, Jonathan Cameron wrote: > On Tue, 16 Nov 2021 12:11:29 +0100 > David Hildenbrand wrote: > >>>> >>>> Examples include exposing HBM or PMEM to the VM. Just like on real HW, >>>> this memory is exposed via cpu-less, special node

Re: [PATCH v2] hw/arm/virt: Expose empty NUMA nodes through ACPI

2021-11-17 Thread David Hildenbrand
On 12.11.21 14:27, Igor Mammedov wrote: > On Wed, 10 Nov 2021 12:01:11 +0100 > David Hildenbrand wrote: > >> On 10.11.21 11:33, Igor Mammedov wrote: >>> On Fri, 5 Nov 2021 23:47:37 +1100 >>> Gavin Shan wrote: >>> >>>> Hi Drew and

Re: [PATCH v2] hw/arm/virt: Expose empty NUMA nodes through ACPI

2021-11-18 Thread David Hildenbrand
On 18.11.21 11:28, Jonathan Cameron wrote: > On Wed, 17 Nov 2021 19:08:28 +0100 > David Hildenbrand wrote: > >> On 17.11.21 15:30, Jonathan Cameron wrote: >>> On Tue, 16 Nov 2021 12:11:29 +0100 >>> David Hildenbrand wrote: >>> >>>>>

Re: [PATCH v2] hw/arm/virt: Expose empty NUMA nodes through ACPI

2021-11-19 Thread David Hildenbrand
On 19.11.21 11:58, Jonathan Cameron wrote: > On Thu, 18 Nov 2021 11:23:06 + > Jonathan Cameron wrote: > >> On Thu, 18 Nov 2021 12:06:27 +0100 >> David Hildenbrand wrote: >> >>> On 18.11.21 11:28, Jonathan Cameron wrote: >>>> On Wed, 17 Nov 2

Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST

2021-11-19 Thread David Hildenbrand
On 19.11.21 14:47, Chao Peng wrote: > From: "Kirill A. Shutemov" > > The new seal type provides semantics required for KVM guest private > memory support. A file descriptor with the seal set is going to be used > as source of guest memory in confidential computing environments such as > Intel TDX

Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST

2021-11-19 Thread David Hildenbrand
On 19.11.21 16:19, Jason Gunthorpe wrote: > On Fri, Nov 19, 2021 at 09:47:27PM +0800, Chao Peng wrote: >> From: "Kirill A. Shutemov" >> >> The new seal type provides semantics required for KVM guest private >> memory support. A file descriptor with the seal set is going to be used >> as source of

Re: [PATCH v2] hw/arm/virt: Expose empty NUMA nodes through ACPI

2021-11-19 Thread David Hildenbrand
>> I'd really appreciate if we could instead have something that makes virt >> happy as well ("makes no sense in any physical system"), because virt is >> most probably the biggest actual consumer of ACPI memory hotplug out >> there (!). > > No problem with finding such a solution - but it's an

Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST

2021-11-22 Thread David Hildenbrand
On 19.11.21 17:00, Jason Gunthorpe wrote: > On Fri, Nov 19, 2021 at 04:39:15PM +0100, David Hildenbrand wrote: > >>> If qmeu can put all the guest memory in a memfd and not map it, then >>> I'd also like to see that the IOMMU can use this interface too so we >

Re: [PATCH] s390x/ipl: support extended kernel command line size

2021-11-22 Thread David Hildenbrand
rrp, > "kernel command line exceeds maximum size: > %zu > %lu", > - cmdline_size, KERN_PARM_AREA_SIZE); > + cmdline_size, max_cmdline_size); > return; > } > > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v1] virtio-mem: Don't skip alignment checks when warning about block size

2021-11-22 Thread David Hildenbrand
On 12.10.21 09:27, Michael S. Tsirkin wrote: > On Mon, Oct 11, 2021 at 07:33:05PM +0200, David Hildenbrand wrote: >> If we warn about the block size being smaller than the default, we skip >> some alignment checks. >> >> This can currently only fail on x86-64, when spec

Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST

2021-11-22 Thread David Hildenbrand
On 22.11.21 14:31, Jason Gunthorpe wrote: > On Mon, Nov 22, 2021 at 10:26:12AM +0100, David Hildenbrand wrote: > >> I do wonder if we want to support sharing such memfds between processes >> in all cases ... we most certainly don't want to be able to share >> encrypte

Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST

2021-11-22 Thread David Hildenbrand
On 22.11.21 15:01, Jason Gunthorpe wrote: > On Mon, Nov 22, 2021 at 02:35:49PM +0100, David Hildenbrand wrote: >> On 22.11.21 14:31, Jason Gunthorpe wrote: >>> On Mon, Nov 22, 2021 at 10:26:12AM +0100, David Hildenbrand wrote: >>> >>>> I do wonder if we want

Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST

2021-11-22 Thread David Hildenbrand
On 22.11.21 16:09, Jason Gunthorpe wrote: > On Mon, Nov 22, 2021 at 03:57:17PM +0100, David Hildenbrand wrote: >> On 22.11.21 15:01, Jason Gunthorpe wrote: >>> On Mon, Nov 22, 2021 at 02:35:49PM +0100, David Hildenbrand wrote: >>>> On 22.11.21 14:31, Jason Gunthor

Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST

2021-11-23 Thread David Hildenbrand
On 23.11.21 10:06, Paolo Bonzini wrote: > On 11/19/21 16:39, David Hildenbrand wrote: >>> If qmeu can put all the guest memory in a memfd and not map it, then >>> I'd also like to see that the IOMMU can use this interface too so we >>> can have VFIO working in t

Re: [PATCH 1/2] virito-balloon: process all in sgs for free_page_vq

2021-11-25 Thread David Hildenbrand
On 25.11.21 03:20, Jason Wang wrote: > We only process the first in sg which may lead to the bitmap of the > pages belongs to following sgs were not cleared. This may result more > pages to be migrated. Fixing this by process all in sgs for > free_page_vq. > > Signed-off-by: Jason Wang > --- > h

Re: [PATCH 1/2] virito-balloon: process all in sgs for free_page_vq

2021-11-25 Thread David Hildenbrand
On 25.11.21 17:09, Michael S. Tsirkin wrote: > On Thu, Nov 25, 2021 at 09:28:59AM +0100, David Hildenbrand wrote: >> On 25.11.21 03:20, Jason Wang wrote: >>> We only process the first in sg which may lead to the bitmap of the >>> pages belongs to following sgs were n

Re: [PATCH V2 2/2] virtio-balloon: correct used length

2021-11-29 Thread David Hildenbrand
g_free(elem); > virtio_balloon_pbp_free(&pbp); > @@ -552,7 +552,7 @@ static bool get_free_page_hints(VirtIOBalloon *dev) > } > > out: > -virtqueue_push(vq, elem, 1); > +virtqueue_push(vq, elem, 0); > g_free(elem); > return ret; > } > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v2 3/3] pci: ROM preallocation for incoming migration

2023-05-09 Thread David Hildenbrand
On 09.05.23 17:54, Michael S. Tsirkin wrote: On Wed, May 03, 2023 at 02:39:15PM +0300, Vladimir Sementsov-Ogievskiy wrote: On 03.05.23 13:05, Michael S. Tsirkin wrote: On Wed, May 03, 2023 at 12:50:09PM +0300, Vladimir Sementsov-Ogievskiy wrote: On 03.05.23 12:20, David Hildenbrand wrote: On

Re: [PATCH] target/s390x/tcg: SPX: check validity of new prefix

2022-06-27 Thread David Hildenbrand
On 27.06.22 15:12, Janis Schoetterl-Glausch wrote: > According to the architecture, SET PREFIX must try to access the new > prefix area and recognize an addressing exception if the area is not > accessible. > For qemu this check prevents a crash in cpu_map_lowcore after an > inaccessible prefix are

Re: [PATCH] target/s390x/tcg: SPX: check validity of new prefix

2022-06-27 Thread David Hildenbrand
On 27.06.22 19:06, Janis Schoetterl-Glausch wrote: > On 6/27/22 18:27, David Hildenbrand wrote: >> On 27.06.22 15:12, Janis Schoetterl-Glausch wrote: >>> According to the architecture, SET PREFIX must try to access the new >>> prefix area and recognize an addressing e

Re: [RESEND PATCH] hw/dma: fix crash caused by race condition

2022-06-29 Thread David Hildenbrand
On 06.05.22 18:31, Tong Zhang wrote: > assert(dbs->acb) is meant to check the return value of io_func per > documented in commit 6bee44ea34 ("dma: the passed io_func does not > return NULL"). However, there is a chance that after calling > aio_context_release(dbs->ctx); the dma_blk_cb function is c

Re: [RESEND PATCH] hw/dma: fix crash caused by race condition

2022-06-29 Thread David Hildenbrand
On 29.06.22 10:31, Tong Zhang wrote: > > > On Wed, Jun 29, 2022 at 12:29 AM David Hildenbrand <mailto:da...@redhat.com>> wrote: > > On 06.05.22 18:31, Tong Zhang wrote: > > assert(dbs->acb) is meant to check the return value of io_func per > >

Re: [PATCH 1/3] hostmem: Detect and cache fs type for file hostmem

2023-04-19 Thread David Hildenbrand
On 19.04.23 00:57, Peter Xu wrote: Detect the file system for a memory-backend-file object and cache it within the object if possible when CONFIG_LINUX (using statfs). Only support the two important types of memory (tmpfs, hugetlbfs) and keep the rest as "unknown" for now. Signed-off-by: Peter

Re: [PATCH v2 1/4] util/mmap-alloc: qemu_fd_getfs()

2023-04-19 Thread David Hildenbrand
ing the default handling. Whatever you prefer: Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v2 2/4] vl.c: Create late backends before migration object

2023-04-19 Thread David Hildenbrand
compat properties have been set up. */ migration_object_init(); -qemu_create_late_backends(); - /* parse features once if machine provides default cpu_type */ current_machine->cpu_type = machine_class->default_cpu_type; if (cpu_option) { Reviewed-by: David

Re: [PATCH v2] s390x/gdb: Split s390-virt.xml

2023-04-20 Thread David Hildenbrand
d, David, Alex, Christian, any objections? If not, I could queue this for my next pull request if nobody else wants to take it. No objection from my side. Don't have time to try it out, though Acked-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v5] hostmem-file: add offset option

2023-04-20 Thread David Hildenbrand
On 11.04.23 13:46, Igor Mammedov wrote: On Wed, 5 Apr 2023 15:58:31 +0200 David Hildenbrand wrote: On 04.04.23 16:36, Peter Xu wrote: On Mon, Apr 03, 2023 at 10:14:21PM +, Alexander Graf wrote: Add an option for hostmem-file to start the memory object at an offset into the target file

Re: [PATCH v2 2/3] pci: pci_add_option_rom(): refactor: use g_autofree for path variable

2023-05-02 Thread David Hildenbrand
On 25.04.23 18:14, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/pci/pci.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v2 1/3] pci: pci_add_option_rom(): improve style

2023-05-02 Thread David Hildenbrand
ile) +if (!pdev->romfile) { return; -if (strlen(pdev->romfile) == 0) +} +if (strlen(pdev->romfile) == 0) { return; +} Could be further simplified to if (!pdev->romfile || !strlen(pdev->romfile)) { return; } Reviewed-by: David Hilde

Re: [PATCH 6/9] target/s390x: Finish conversion to tcg_gen_qemu_{ld,st}_*

2023-05-03 Thread David Hildenbrand
On 02.05.23 15:57, Richard Henderson wrote: Convert away from the old interface with the implicit MemOp argument. Signed-off-by: Richard Henderson --- Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH 9/9] tcg: Remove compatability helpers for qemu ld/st

2023-05-03 Thread David Hildenbrand
description + cover letter talks about "helpers for qemu ld/st", so these two would not fall into the context of this patch (and series). Acked-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v2 3/3] pci: ROM preallocation for incoming migration

2023-05-03 Thread David Hildenbrand
On 25.04.23 18:14, Vladimir Sementsov-Ogievskiy wrote: On incoming migration we have the following sequence to load option ROM: 1. On device realize we do normal load ROM from the file 2. Than, on incoming migration we rewrite ROM from the incoming RAM block. If sizes mismatch we fail. Thi

Re: [PATCH v5] hostmem-file: add offset option

2023-05-03 Thread David Hildenbrand
On 04.04.23 00:14, Alexander Graf wrote: Add an option for hostmem-file to start the memory object at an offset into the target file. This is useful if multiple memory objects reside inside the same target file, such as a device node. In particular, it's useful to map guest memory directly into

Re: [PATCH v2 0/3] vhost: memslot handling improvements

2023-05-03 Thread David Hildenbrand
On 20.04.23 16:28, Igor Mammedov wrote: On Thu, 16 Mar 2023 16:36:55 +0100 David Hildenbrand wrote: Following up on my previous work to make virtio-mem consume multiple memslots dynamically [1] that requires precise accounting between used vs. reserved memslots, I realized that vhost makes

[PATCH v3 0/3] vhost: memslot handling improvements

2023-05-03 Thread David Hildenbrand
Rework memslot filtering and fix "used_memslot" tracking" -- New approach: keep filtering, but make filtering less generic and track separately. This should keep any existing setups working. - "softmmu/physmem: Fixup qemu_ram_block_from_host() documentation" -- As requested by

[PATCH v3 3/3] softmmu/physmem: Fixup qemu_ram_block_from_host() documentation

2023-05-03 Thread David Hildenbrand
Let's fixup the documentation (e.g., removing traces of the ram_addr parameter that no longer exists) and move it to the header file while at it. Suggested-by: Igor Mammedov Acked-by: Igor Mammedov Signed-off-by: David Hildenbrand --- include/exec/cpu-common.h | 15 +++ so

[PATCH v3 1/3] vhost: Rework memslot filtering and fix "used_memslot" tracking

2023-05-03 Thread David Hildenbrand
When not using MAP_SHARED, it might not work as expected. Add a TODO for now. [1] https://lkml.kernel.org/r/fad9136f-08d3-3fd9-71a1-502069c00...@redhat.com Fixes: 988a27754bbb ("vhost: allow backends to filter memory sections") Cc: Tiwei Bie Acked-by: Igor Mammedov Signed-off-by: Davi

[PATCH v3 2/3] vhost: Remove vhost_backend_can_merge() callback

2023-05-03 Thread David Hildenbrand
r Mammedov Signed-off-by: David Hildenbrand --- hw/virtio/vhost-user.c| 14 -- hw/virtio/vhost-vdpa.c| 1 - hw/virtio/vhost.c | 6 +- include/hw/virtio/vhost-backend.h | 4 4 files changed, 1 insertion(+), 24 deletions(-) diff

[PATCH v1] virtio-mem: Default to "unplugged-inaccessible=on" with 8.1 on x86-64

2023-05-03 Thread David Hildenbrand
by we'll actually no longer allow the guest to even read from unplugged memory. At some point, we might want to deprecate and remove that property. Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: D

[PATCH v1] vhost-user: Remove acpi-specific memslot limit

2023-05-03 Thread David Hildenbrand
mprove in the near future. We'll leave the PPC special-case as is for now. Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Stefan Hajnoczi Signed-off-by: David Hildenbrand --- hw/virtio/vhost-user.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/

Re: [PATCH 15/27] target/s390x: Use tcg_gen_qemu_{ld,st}_i128 for LPQ, STPQ

2023-05-22 Thread David Hildenbrand
On 20.05.23 18:26, Richard Henderson wrote: No need to roll our own, as this is now provided by tcg. This was the last use of retxl, so remove that too. That's nice! Signed-off-by: Richard Henderson --- Cc: qemu-s3...@nongnu.org Cc: David Hildenbrand Cc: Ilya Leoshk

Re: [PATCH 17/27] target/s390x: Use cpu_{ld,st}*_mmu in do_csst

2023-05-22 Thread David Hildenbrand
On 20.05.23 18:26, Richard Henderson wrote: Use cpu_ld16_mmu and cpu_st16_mmu to eliminate the special case, and change all of the *_data_ra functions to match. Signed-off-by: Richard Henderson --- Cc: qemu-s3...@nongnu.org Cc: David Hildenbrand Cc: Ilya Leoshkevich

Re: [PATCH 18/27] target/s390x: Always use cpu_atomic_cmpxchgl_be_mmu in do_csst

2023-05-22 Thread David Hildenbrand
On 20.05.23 18:26, Richard Henderson wrote: Eliminate the CONFIG_USER_ONLY specialization. Signed-off-by: Richard Henderson --- Cc: qemu-s3...@nongnu.org Cc: David Hildenbrand Cc: Ilya Leoshkevich --- Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v2 15/27] target/s390x: Use tcg_gen_qemu_{ld, st}_i128 for LPQ, STPQ

2023-05-23 Thread David Hildenbrand
On 23.05.23 15:47, Richard Henderson wrote: No need to roll our own, as this is now provided by tcg. This was the last use of retxl, so remove that too. Signed-off-by: Richard Henderson --- Cc: qemu-s3...@nongnu.org Cc: David Hildenbrand Cc: Ilya Leoshkevich --- target/s390x/cpu.h

Re: [PATCH v2 17/27] target/s390x: Use cpu_{ld,st}*_mmu in do_csst

2023-05-23 Thread David Hildenbrand
from the individual memory operations. Signed-off-by: Richard Henderson --- Cc: qemu-s3...@nongnu.org Cc: David Hildenbrand Cc: Ilya Leoshkevich --- Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v3 0/3] vhost: memslot handling improvements

2023-05-23 Thread David Hildenbrand
On 03.05.23 19:21, David Hildenbrand wrote: Following up on my previous work to make virtio-mem consume multiple memslots dynamically [1] that requires precise accounting between used vs. reserved memslots, I realized that vhost makes this extra hard by filtering out some memory region sections

[GIT PULL 1/1] hostmem-file: add offset option

2023-05-23 Thread David Hildenbrand
m for experimentation. To make this work consistently, also fix up all places in QEMU that expect fd offsets to be 0. Signed-off-by: Alexander Graf Message-Id: <20230403221421.60877-1-g...@amazon.com> Acked-by: Markus Armbruster Acked-by: Peter Xu Reviewed-by: David Hildenbrand Signed-of

[GIT PULL 0/1] Host Memory Backends and Memory devices queue 2023-05-23

2023-05-23 Thread David Hildenbrand
The following changes since commit 886c0453cbf10eebd42a9ccf89c3e46eb389c357: Merge tag 'pull-qapi-2023-05-17-v2' of https://repo.or.cz/qemu/armbru into staging (2023-05-22 15:54:21 -0700) are available in the Git repository at: https://github.com/davidhildenbrand/qemu.git tags/mem-2023-05-2

Re: [PATCH v3 1/3] vhost: Rework memslot filtering and fix "used_memslot" tracking

2023-05-23 Thread David Hildenbrand
[...] --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -46,20 +46,33 @@ static struct vhost_log *vhost_log; static struct vhost_log *vhost_log_shm; +/* Memslots used by backends that support private memslots (without an fd). */ static unsigned int used_memslots; + +/* Memslots used b

Re: [PATCH 06/11] hw/virtio/virtio-mem: Use qemu_ram_get_fd() helper

2023-05-23 Thread David Hildenbrand
IO_MEM_HAS_LEGACY_GUESTS */ Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

[PATCH v1] virtio-mem: Simplify bitmap handling and virtio_mem_set_block_state()

2023-05-23 Thread David Hildenbrand
Let's separate plug and unplug handling to prepare for future changes and make the code a bit easier to read -- working on block states (plugged/unplugged) instead of on a bitmap. Cc: "Michael S. Tsirkin" Cc: Gavin Shan Signed-off-by: David Hildenbrand --- hw/virtio/vir

[PATCH v1 2/3] memory-device: Factor out device memory initialization into memory_devices_init()

2023-05-23 Thread David Hildenbrand
Let's factor the common setup out, to prepare for further changes. On arm64, we'll add the subregion to system RAM now earlier -- which shouldn't matter, because the system RAM memory region should already be alive at that point. Signed-off-by: David Hildenbrand ---

[PATCH v1 1/3] memory-device: Refactor memory_device_pre_plug()

2023-05-23 Thread David Hildenbrand
Let's move memory_device_check_addable() and basic checks out of memory_device_get_free_addr() directly into memory_device_pre_plug(). Separating basic checks from address assignment is cleaner and prepares for further changes. Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c

[PATCH v1 3/3] memory-device: Track used region size in DeviceMemoryState

2023-05-23 Thread David Hildenbrand
Let's avoid iterating over all devices and simply track it in the DeviceMemoryState. Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c | 22 +++--- include/hw/boards.h| 2 ++ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/hw/mem/memory-devic

[PATCH v1 0/3] memory-device: Some cleanups

2023-05-23 Thread David Hildenbrand
t; Cc: David Gibson Cc: Greg Kurz Cc: Harsh Prateek Bora Cc: "Philippe Mathieu-Daudé" Cc: Yanan Wang David Hildenbrand (3): memory-device: Refactor memory_device_pre_plug() memory-device: Factor out device memory initialization into memory_devices_init() memory-dev

[PATCH v4 1/3] vhost: Rework memslot filtering and fix "used_memslot" tracking

2023-05-23 Thread David Hildenbrand
When not using MAP_SHARED, it might not work as expected. Add a TODO for now. [1] https://lkml.kernel.org/r/fad9136f-08d3-3fd9-71a1-502069c00...@redhat.com Fixes: 988a27754bbb ("vhost: allow backends to filter memory sections") Cc: Tiwei Bie Acked-by: Igor Mammedov Signed-off-by: Davi

[PATCH v4 3/3] softmmu/physmem: Fixup qemu_ram_block_from_host() documentation

2023-05-23 Thread David Hildenbrand
Let's fixup the documentation (e.g., removing traces of the ram_addr parameter that no longer exists) and move it to the header file while at it. Suggested-by: Igor Mammedov Acked-by: Igor Mammedov Reviewed-by: Peter Xu Signed-off-by: David Hildenbrand --- include/exec/cpu-common.h

[PATCH v4 0/3] vhost: memslot handling improvements

2023-05-23 Thread David Hildenbrand
track separately. This should keep any existing setups working. - "softmmu/physmem: Fixup qemu_ram_block_from_host() documentation" -- As requested by Igor David Hildenbrand (3): vhost: Rework memslot filtering and fix "used_memslot" tracking vhost: Remove vhost_backend_c

[PATCH v4 2/3] vhost: Remove vhost_backend_can_merge() callback

2023-05-23 Thread David Hildenbrand
r Mammedov Reviewed-by: Peter Xu Signed-off-by: David Hildenbrand --- hw/virtio/vhost-user.c| 14 -- hw/virtio/vhost-vdpa.c| 1 - hw/virtio/vhost.c | 6 +- include/hw/virtio/vhost-backend.h | 4 4 files changed, 1 insertion(+), 24

Re: [PATCH v1 2/3] memory-device: Factor out device memory initialization into memory_devices_init()

2023-05-25 Thread David Hildenbrand
On 25.05.23 15:30, Philippe Mathieu-Daudé wrote: Hi David, On 23/5/23 20:51, David Hildenbrand wrote: Let's factor the common setup out, to prepare for further changes. On arm64, we'll add the subregion to system RAM now earlier -- which shouldn't matter, because the system RA

Re: [PATCH v1 2/3] memory-device: Factor out device memory initialization into memory_devices_init()

2023-05-26 Thread David Hildenbrand
On 25.05.23 15:30, Philippe Mathieu-Daudé wrote: Hi David, On 23/5/23 20:51, David Hildenbrand wrote: Let's factor the common setup out, to prepare for further changes. On arm64, we'll add the subregion to system RAM now earlier -- which shouldn't matter, because the system RA

Re: [PATCH 1/4] target/s390x: Fix LCBB overwriting the top 32 bits

2023-05-28 Thread David Hildenbrand
BB,RXE, V, la2, 0, new, r1_32, lcbb, 0) /* LOAD HALFWORD */ C(0xb927, LHR, RRE, EI, 0, r2_16s, 0, r1_32, mov2, 0) C(0xb907, LGHR,RRE, EI, 0, r2_16s, 0, r1, mov2, 0) Thanks! Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH 3/4] target/s390x: Fix LOCFHR taking the wrong half of R2

2023-05-28 Thread David Hildenbrand
2h, loc, 0) +C(0xb9e0, LOCFHR, RRF_c, LOC2, r1_sr32, r2_sr32, new, r1_32h, loc, 0) C(0xebe0, LOCFH, RSY_b, LOC2, r1_sr32, m2_32u, new, r1_32h, loc, 0) /* LOAD PAIR DISJOINT */ D(0xc804, LPD, SSF, ILA, 0, 0, new_P, r3_P32, lpd, 0, MO_TEUL) Reviewed-by: David Hildenbrand

Re: [PATCH 2/4] tests/tcg/s390x: Test LCBB

2023-05-28 Thread David Hildenbrand
bb(&buf[511], 3, 1, 3); +test_lcbb(&buf[0],4, 16, 0); +test_lcbb(&buf[1023], 4, 1, 3); +test_lcbb(&buf[0],5, 16, 0); +test_lcbb(&buf[2047], 5, 1, 3); + test_lcbb(&buf[0],6, 16, 0); +test_lcbb(&buf[4095], 6, 1, 3); + +return EXIT_SUCCESS; +} Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH 4/4] tests/tcg/s390x: Test LOCFHR

2023-05-28 Thread David Hildenbrand
3); +assert(locfhr(0x, 0x, 11, 1) == + 0x5555); + +return EXIT_SUCCESS; +} Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

[PATCH 08/10] hw/i386/pc: Remove PC_MACHINE_DEVMEM_REGION_SIZE

2023-05-30 Thread David Hildenbrand
There are no remaining users in the tree, so let's remove it. Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Signed-off-by: David Hildenbrand --- hw/i386/pc.c | 19 --- include/hw/i386/pc.h

[PATCH 06/10] hw/i386/pc: Use memory_devices_init()

2023-05-30 Thread David Hildenbrand
;device_memory->base. Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Signed-off-by: David Hildenbrand --- hw/i386/pc.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/hw/i38

[PATCH 00/10] memory-device: Some cleanups

2023-05-30 Thread David Hildenbrand
ms->device_memory only if the size > 0. - Split it up and include more cleanups David Hildenbrand (10): memory-device: Unify enabled vs. supported error messages memory-device: Introduce memory_devices_init() hw/arm/virt: Use memory_devices_init() hw/ppc/spapr: Use memory_devices_in

[PATCH 02/10] memory-device: Introduce memory_devices_init()

2023-05-30 Thread David Hildenbrand
Let's intrduce a new helper that we will use to replace existing memory device setup code during machine initialization. We'll enforce that the size has to be > 0. Once all machines were converted, we'll only allocate ms->device_memory if the size > 0. Signed-off-by: Da

[PATCH 01/10] memory-device: Unify enabled vs. supported error messages

2023-05-30 Thread David Hildenbrand
ces, it usually doesn't call the pre_plug handler ... Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/mem/memory-device.c b/hw/mem/memory-device.c index 1636db9679..49f86ec8a8 100644 --- a/hw/mem/

[PATCH 10/10] memory-device: Track used region size in DeviceMemoryState

2023-05-30 Thread David Hildenbrand
Let's avoid iterating over all devices and simply track it in the DeviceMemoryState. Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c | 22 +++--- include/hw/boards.h| 2 ++ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/hw/mem/memory-devic

[PATCH 03/10] hw/arm/virt: Use memory_devices_init()

2023-05-30 Thread David Hildenbrand
Let's use our new helper. We'll add the subregion to system RAM now earlier. That shouldn't matter, because the system RAM memory region should already be alive at that point. Cc: Peter Maydell Signed-off-by: David Hildenbrand --- hw/arm/virt.c | 9 + 1 file changed, 1

[PATCH 04/10] hw/ppc/spapr: Use memory_devices_init()

2023-05-30 Thread David Hildenbrand
can now modify two maxram_size checks to rely on ms->device_memory for detecting whether we have memory devices. Cc: Daniel Henrique Barboza Cc: "Cédric Le Goater" Cc: David Gibson Cc: Greg Kurz Cc: Harsh Prateek Bora Signed-off-by: David Hildenbrand

Re: [PATCH 00/10] memory-device: Some cleanups

2023-05-30 Thread David Hildenbrand
This was supposed to carry the "v2" indicator ;) On 30.05.23 13:38, David Hildenbrand wrote: Working on adding multi-memslot support for virtio-mem (teaching memory device code about memory devices that can consume multiple memslots), I have some preparatory cleanups in my queue

[PATCH 05/10] hw/loongarch/virt: Use memory_devices_init()

2023-05-30 Thread David Hildenbrand
Let's use our new helper. Cc: Xiaojuan Yang Cc: Song Gao Signed-off-by: David Hildenbrand --- hw/loongarch/virt.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index ceddec1b23..a6790714fe 100644 ---

[PATCH 07/10] hw/i386/acpi-build: Rely on machine->device_memory when building SRAT

2023-05-30 Thread David Hildenbrand
de now looks much more similar the hw/arm/virt-acpi-build.c variant. Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Signed-off-by: David Hildenbrand --- hw/i386/acpi-build.c | 9 +++-- 1 file changed, 3 insertions(+),

[PATCH 09/10] memory-device: Refactor memory_device_pre_plug()

2023-05-30 Thread David Hildenbrand
that function enforces that the size is 0, we can drop the check for an empty region. Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/mem/memory-device.c b/hw/mem/memory-device.c

Re: [PATCH 02/10] memory-device: Introduce memory_devices_init()

2023-05-30 Thread David Hildenbrand
On 30.05.23 14:29, Philippe Mathieu-Daudé wrote: Hi David, On 30/5/23 13:38, David Hildenbrand wrote: Let's intrduce a new helper that we will use to replace existing memory device setup code during machine initialization. We'll enforce that the size has to be > 0. Once all

Re: [PATCH 08/10] hw/i386/pc: Remove PC_MACHINE_DEVMEM_REGION_SIZE

2023-05-30 Thread David Hildenbrand
On 30.05.23 15:07, Michael S. Tsirkin wrote: On Tue, May 30, 2023 at 01:38:36PM +0200, David Hildenbrand wrote: There are no remaining users in the tree, so let's remove it. Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: "Michael S. Tsirkin" Cc: Marcel Ap

Re: [PATCH 02/10] memory-device: Introduce memory_devices_init()

2023-05-30 Thread David Hildenbrand
On 30.05.23 15:04, David Hildenbrand wrote: On 30.05.23 14:29, Philippe Mathieu-Daudé wrote: Hi David, On 30/5/23 13:38, David Hildenbrand wrote: Let's intrduce a new helper that we will use to replace existing memory device setup code during machine initialization. We'll enforc

Re: [PATCH v1 0/2] vhost: memslot handling improvements

2023-03-08 Thread David Hildenbrand
On 07.03.23 12:14, Igor Mammedov wrote: On Fri, 17 Feb 2023 09:20:27 -0500 "Michael S. Tsirkin" wrote: On Thu, Feb 16, 2023 at 12:47:50PM +0100, David Hildenbrand wrote: Following up on my previous work to make virtio-mem consume multiple memslots dynamically [1] that requir

Re: [PATCH v2] virtio-balloon: optimize the virtio-balloon on the ARM platform

2023-03-08 Thread David Hildenbrand
On 08.03.23 01:42, Michael S. Tsirkin wrote: On Wed, Mar 01, 2023 at 06:38:13AM +, Yangming wrote: Optimize the virtio-balloon feature on the ARM platform by adding a variable to keep track of the current hot-plugged pc-dimm size, instead of traversing the virtual machine's memory modules to

Re: [PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-03-08 Thread David Hildenbrand
So we tricked used_memslots to be smaller than it actually has to be, because we're ignoring the memslots filtered out by the vhost-user device. Now, this is all far from relevant in practice as of now I think, and usually would indicate user errors already (memory that's not shared with vhost-

Re: [PATCH v3] virtio-balloon: optimize the virtio-balloon on the ARM platform

2023-03-09 Thread David Hildenbrand
on to 64GB of a 128GB guest under stress. Before: 102 seconds After: 42 seconds Signed-off-by: Qi Xi Signed-off-by: Ming Yang yangmin...@huawei.com --- Acked-by: David Hildenbrand -- Thanks, David / dhildenb

Re: Reply: [PATCH v2] virtio-balloon: optimize the virtio-balloon on the ARM platform

2023-03-09 Thread David Hildenbrand
On 09.03.23 07:14, Yangming wrote: On 08.03.23 01:42, Michael S. Tsirkin wrote: On Wed, Mar 01, 2023 at 06:38:13AM +, Yangming wrote: Optimize the virtio-balloon feature on the ARM platform by adding a variable to keep track of the current hot-plugged pc-dimm size, instead of traversing the

Re: [PATCH v3 2/2] tests/tcg/s390x: Add C(G)HRL test

2023-03-10 Thread David Hildenbrand
Schoetterl-Glausch --- Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

<    3   4   5   6   7   8   9   10   11   12   >