Re: [PATCH v2 3/4] backends/hostmem: Report error on qemu_madvise() failures

2024-05-31 Thread David Hildenbrand
Privoznik --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v2 1/4] osdep: Make qemu_madvise() to set errno in all cases

2024-05-31 Thread David Hildenbrand
On 31.05.24 10:12, Philippe Mathieu-Daudé wrote: On 31/5/24 10:01, David Hildenbrand wrote: On 31.05.24 09:57, Philippe Mathieu-Daudé wrote: Hi Michal, On 31/5/24 09:28, Michal Privoznik wrote: The unspoken premise of qemu_madvise() is that errno is set on error. And it is mostly the case

Re: [PATCH v2 1/4] osdep: Make qemu_madvise() to set errno in all cases

2024-05-31 Thread David Hildenbrand
On 31.05.24 09:57, Philippe Mathieu-Daudé wrote: Hi Michal, On 31/5/24 09:28, Michal Privoznik wrote: The unspoken premise of qemu_madvise() is that errno is set on error. And it is mostly the case except for posix_madvise() which is documented to return either zero (on success) or a positive

Re: [PATCH v2 2/4] osdep: Make qemu_madvise() return ENOSYS on unsupported OSes

2024-05-31 Thread David Hildenbrand
to configuration). Yes and no. According to the man page " EINVAL advice is not a valid." if a particular MADV_* call is not implemented, we would get EINVAL, which is really unfortunate ... to detect what is actually supported :( For the patch here ENOSYS makes sense: Reviewed

Re: [PATCH 3/3] backends/hostmem: Round up memory size for qemu_madvise() and mbind()

2024-05-29 Thread David Hildenbrand
On 29.05.24 08:48, Michal Prívozník wrote: On 5/28/24 18:47, David Hildenbrand wrote: Am 28.05.24 um 18:15 schrieb Michal Privoznik: ./build/qemu-system-x86_64 \ -m size=8389632k,slots=16,maxmem=2560k \ -object '{"qom-type":"memory-backend-file","id":"

Re: [PATCH 1/3] osdep: Make qemu_madvise() to set errno in all cases

2024-05-28 Thread David Hildenbrand
, advice); +if (rc) { +errno = rc; +return -1; +} +return 0; #else errno = EINVAL; return -1; Interesting, seems to be correct Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH 3/3] backends/hostmem: Round up memory size for qemu_madvise() and mbind()

2024-05-28 Thread David Hildenbrand
uot;size":8590983168,"host-nodes":[0],"policy":"bind"}' \ -numa node,nodeid=0,cpus=0,memdev=ram-node0 For DIMMs and friends we now (again) enforce that the size must be aligned to the page size: commit 540a1abbf0b243e4cfb4333c5d30a041f7080ba4 Author: Davi

Re: [PATCH v2 1/3] hw/riscv/virt: Add memory hotplugging and virtio-md-pci support

2024-05-27 Thread David Hildenbrand
I wonder if we should forbid users from removing memory that is 'out of place', i.e. users should always remove pc-dimms in LIFO order. Usually this kind of control is done by management, e.g. libvirt, but if we're not sure we'll keep consistency during memory unplugs ... I really don't

Re: [RFC PATCH 1/3] hw/intc/s390_flic: Migrate pending state

2024-05-26 Thread David Hildenbrand
Am 26.05.24 um 21:44 schrieb Richard Henderson: On 5/26/24 08:53, David Hildenbrand wrote: Am 25.05.24 um 15:12 schrieb Nicholas Piggin: The flic pending state is not migrated, so if the machine is migrated while an interrupt is pending, it can be lost. This shows up in qtest migration test

Re: [RFC PATCH 1/3] hw/intc/s390_flic: Migrate pending state

2024-05-26 Thread David Hildenbrand
Am 25.05.24 um 15:12 schrieb Nicholas Piggin: The flic pending state is not migrated, so if the machine is migrated while an interrupt is pending, it can be lost. This shows up in qtest migration test, an extint is pending (due to console writes?) and the CPU waits via s390_cpu_set_psw and

Re: [PATCH v2 1/3] hw/riscv/virt: Add memory hotplugging and virtio-md-pci support

2024-05-24 Thread David Hildenbrand
On 24.05.24 15:14, Daniel Henrique Barboza wrote: On 5/21/24 07:56, Björn Töpel wrote: From: Björn Töpel Virtio-based memory devices (virtio-mem/virtio-pmem) allows for dynamic resizing of virtual machine memory, and requires proper hotplugging (add/remove) support to work. Add device

Re: [PATCH v5 13/13] tests/qtest/vhost-user-test: add a test case for memory-backend-shm

2024-05-23 Thread David Hildenbrand
On 23.05.24 16:55, Stefano Garzarella wrote: `memory-backend-shm` can be used with vhost-user devices, so let's add a new test case for it. Acked-by: Thomas Huth Acked-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v5 12/13] tests/qtest/vhost-user-blk-test: use memory-backend-shm

2024-05-23 Thread David Hildenbrand
, -" -object memory-backend-memfd,id=mem,size=256M,share=on " +" -object memory-backend-shm,id=mem,size=256M,share=on " Can we simplifya nd drop the share=on? Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v5 07/13] vhost-user: enable frontends on any POSIX system

2024-05-23 Thread David Hildenbrand
-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v5 06/13] contrib/vhost-user-*: use QEMU bswap helper functions

2024-05-23 Thread David Hildenbrand
-off-by: Stefano Garzarella --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v5 04/13] vhost-user-server: do not set memory fd non-blocking

2024-05-23 Thread David Hildenbrand
. Berrangé Acked-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v5 05/13] contrib/vhost-user-blk: fix bind() using the right size of the address

2024-05-23 Thread David Hildenbrand
, addrlen can be specified as sizeof(struct sockaddr_un). So let's follow the last advice and simplify the code as well. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella --- Reviewed-by: David

Re: [PATCH v5 03/13] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported

2024-05-23 Thread David Hildenbrand
, let's mask that feature if the backend is not able to properly handle these messages. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v5 02/13] libvhost-user: fail vu_message_write() if sendmsg() is failing

2024-05-23 Thread David Hildenbrand
Signed-off-by: Stefano Garzarella --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH] hw/riscv/virt: Add hotplugging and virtio-md-pci support

2024-05-21 Thread David Hildenbrand
On 19.05.24 11:24, Daniel Henrique Barboza wrote: On 5/18/24 16:50, David Hildenbrand wrote: Hi, diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 4fdb66052587..16c2bdbfe6b6 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -53,6 +53,8 @@    #include "hw/pci-host/g

Re: [PATCH] hw/riscv/virt: Add hotplugging and virtio-md-pci support

2024-05-18 Thread David Hildenbrand
I got your comment right, but virtio-mem was never supposed to be a virtio-balloon replacement (especially of the free-page-reporting and memory stats part). I see that David Hildenbrand is also CCed in the patch so he'll let us know if I'm out of line with what I'm asking. Supporting PC-DIMMs might be required at some point when dealing with OSes that don't support virtio-mem and friends. -- Cheers, David / dhildenb

Re: [PATCH v6 6/8] xen: mapcache: Pass the ram_addr offset to xen_map_cache()

2024-05-16 Thread David Hildenbrand
Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v6 5/8] softmmu: Replace check for RAMBlock offset 0 with xen_mr_is_memory

2024-05-16 Thread David Hildenbrand
r existing machines. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v6 4/8] softmmu: xen: Always pass offset + addr to xen_map_cache

2024-05-16 Thread David Hildenbrand
y: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH 11/14] target/s390x: Fix helper_per_ifetch flags

2024-05-07 Thread David Hildenbrand
, noreturn, env, i32) DEF_HELPER_FLAGS_1(stfl, TCG_CALL_NO_RWG, void, env) Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v4 14/17] xen: Add xen_mr_is_memory()

2024-05-02 Thread David Hildenbrand
t;offset == 0) { +if (xen_mr_is_memory(block->mr)) { return xen_map_cache(block->mr, addr, len, lock, lock, is_write); } I'd have moved that into a separate patch, because this is not a simple abstraction here. Acked-by

Re: [PATCH v4 13/17] softmmu: Pass RAM MemoryRegion and is_write xen_map_cache()

2024-05-02 Thread David Hildenbrand
On 30.04.24 18:49, Edgar E. Iglesias wrote: From: "Edgar E. Iglesias" Propagate MR and is_write to xen_map_cache(). I'm pretty sure the patch subject is missing a "to" :) This is in preparation for adding support for grant mappings. No functional change. Reviewed-b

Re: [PATCH v4 01/17] softmmu: let qemu_map_ram_ptr() use qemu_ram_ptr_length()

2024-05-01 Thread David Hildenbrand
-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Reviewed-by: Alex Bennée Reviewed-by: Edgar E. Iglesias --- Acked-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v2] hw/s390x: Attach the sclpconsole to /machine/sclp/s390-sclp-event-facility

2024-04-30 Thread David Hildenbrand
(MachineState *machine) Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v4 1/2] target/s390x: report deprecated-props in cpu-model-expansion reply

2024-04-30 Thread David Hildenbrand
true, ...a lot more props... "skey": false, "vxpdeh2": false } } } } It is recommended that s390 guests operate with these features explicitly disabled to ensure compatability with future hardware. Signed-off-by: Collin Walling Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v4 2/2] target/s390x: flag te and cte as deprecated

2024-04-30 Thread David Hildenbrand
*/ S390_FEAT_CONDITIONAL_SSKE, S390_FEAT_BPB, + /* Deprecated on z16 */ + S390_FEAT_CONSTRAINT_TRANSACTIONAL_EXE, + S390_FEAT_TRANSACTIONAL_EXE }; int i; Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH] hw/s390x: Attach the sclpconsole to the /machine/sclp node

2024-04-30 Thread David Hildenbrand
On 30.04.24 10:04, Thomas Huth wrote: The sclpconsole currently does not have a proper parent in the QOM tree, so it shows up under /machine/unattached - which is somewhat ugly. Let's attach it to /machine/sclp instead. IIRC, this should not affect migration Reviewed-by: David Hildenbrand

Re: [PATCH v3 1/2] target/s390x: report deprecated-props in cpu-model-expansion reply

2024-04-26 Thread David Hildenbrand
On 26.04.24 19:44, David Hildenbrand wrote: On 24.04.24 23:56, Collin Walling wrote: Retain a list of deprecated features disjoint from any particular CPU model. A query-cpu-model-expansion reply will now provide a list of properties (i.e. features) that are flagged as deprecated. Example

Re: [PATCH v3 1/2] target/s390x: report deprecated-props in cpu-model-expansion reply

2024-04-26 Thread David Hildenbrand
On 24.04.24 23:56, Collin Walling wrote: Retain a list of deprecated features disjoint from any particular CPU model. A query-cpu-model-expansion reply will now provide a list of properties (i.e. features) that are flagged as deprecated. Example: { "return": { "model": {

Re: [PATCH v2 2/3] target/s390x: add support for "disable-deprecated-feats" expansion option

2024-04-25 Thread David Hildenbrand
On 24.04.24 20:33, Collin Walling wrote: On 4/24/24 03:24, David Hildenbrand wrote: On 23.04.24 23:06, Collin Walling wrote: Retain a list of deprecated features disjoint from any particular CPU model. When a query-cpu-model-expansion is provided with the "disable-deprecated-feats"

Re: [PATCH v2 2/3] target/s390x: add support for "disable-deprecated-feats" expansion option

2024-04-24 Thread David Hildenbrand
On 23.04.24 23:06, Collin Walling wrote: Retain a list of deprecated features disjoint from any particular CPU model. When a query-cpu-model-expansion is provided with the "disable-deprecated-feats" option set, the resulting properties list will include all deprecated features paired with false.

Re: [PATCH 0/3] Remove useless architecture prefix from the CPU list

2024-04-20 Thread David Hildenbrand
On 20.04.24 07:46, Thomas Huth wrote: Printing an architecture prefix in front of each CPU name is not helpful at all: It is confusing for the users since they don't know whether they have to specify these letters for the "-cpu" parameter, too, and it also takes some precious space in the dense

[PATCH v1] virtio-mem: improve error message when unplug of device fails due to plugged memory

2024-04-16 Thread David Hildenbrand
size" property. Let's simply avoid talking about the "size" property and spell out that some device memory is still plugged. Cc: Liang Cong Cc: Mario Casquero Cc: "Michael S. Tsirkin" Signed-off-by: David Hildenbrand --- hw/virtio/virtio-mem.c | 4 ++-- 1 file changed, 2

Re: [PATCH for-9.1 v3 09/11] hostmem: add a new memory backend based on POSIX shm_open()

2024-04-08 Thread David Hildenbrand
On 08.04.24 09:58, Stefano Garzarella wrote: On Thu, Apr 04, 2024 at 04:09:34PM +0200, David Hildenbrand wrote: On 04.04.24 14:23, Stefano Garzarella wrote: shm_open() creates and opens a new POSIX shared memory object. A POSIX shared memory object allows creating memory backend

Re: [PATCH for-9.1 v3 09/11] hostmem: add a new memory backend based on POSIX shm_open()

2024-04-04 Thread David Hildenbrand
+## +{ 'struct': 'MemoryBackendShmProperties', + 'base': 'MemoryBackendProperties', + 'data': { } } + Acked-by: David Hildenbrand One comment: we should maybe just forbid setting share=off. it doesn't make any sense and it can even result in an unexpected double memory consumption. We missed doing

Re: [PATCH for-9.1 v2 09/11] hostmem: add a new memory backend based on POSIX shm_open()

2024-03-27 Thread David Hildenbrand
So I thought that for now we only support the "anonymous" mode, and if in the future we have a use case where the user wants to specify the name, we can add it later. Okay, so for now you really only want an anonymous fd that behaves like a memfd, got it. Likely we should somehow fail if the

Re: [PATCH for-9.1 v2 09/11] hostmem: add a new memory backend based on POSIX shm_open()

2024-03-27 Thread David Hildenbrand
On 27.03.24 11:23, Stefano Garzarella wrote: On Tue, Mar 26, 2024 at 03:45:52PM +0100, David Hildenbrand wrote: +mode = 0; +oflag = O_RDWR | O_CREAT | O_EXCL; +backend_name = host_memory_backend_get_name(backend); + +/* + * Some operating systems allow creating anonymous

Re: [PATCH-for-9.1 v2 13/21] hw/mem/pc-dimm: Remove legacy_align argument from pc_dimm_pre_plug()

2024-03-27 Thread David Hildenbrand
endent on another one. Please make sure to CC people you CC on patches to also CC on the cover letter. Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH-for-9.1 v2 14/21] hw/mem/memory-device: Remove legacy_align from memory_device_pre_plug()

2024-03-27 Thread David Hildenbrand
NULL : , align, memory_region_size(mr), _err); Very nice! Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH for-9.1 v2 02/11] libvhost-user: fail vu_message_write() if sendmsg() is failing

2024-03-27 Thread David Hildenbrand
I was wondering if we could see some partial sendmsg()/write succeeding. Meaning, we transferred some bytes but not all, and we'd actually need to loop ... Yep, true, but I would fix it in another patch/series if you agree. Absolutely. -- Cheers, David / dhildenb

Re: [PATCH for-9.1 v2 09/11] hostmem: add a new memory backend based on POSIX shm_open()

2024-03-26 Thread David Hildenbrand
+mode = 0; +oflag = O_RDWR | O_CREAT | O_EXCL; +backend_name = host_memory_backend_get_name(backend); + +/* + * Some operating systems allow creating anonymous POSIX shared memory + * objects (e.g. FreeBSD provides the SHM_ANON constant), but this is not + * defined by

Re: [PATCH for-9.1 v2 02/11] libvhost-user: fail vu_message_write() if sendmsg() is failing

2024-03-26 Thread David Hildenbrand
On 26.03.24 15:34, Eric Blake wrote: On Tue, Mar 26, 2024 at 02:39:27PM +0100, Stefano Garzarella wrote: In vu_message_write() we use sendmsg() to send the message header, then a write() to send the payload. If sendmsg() fails we should avoid sending the payload, since we were unable to send

Re: [PATCH for-9.1 v2 01/11] libvhost-user: set msg.msg_control to NULL when it is empty

2024-03-26 Thread David Hildenbrand
(VuDev *dev, int conn_fd, VhostUserMsg *vmsg) memcpy(CMSG_DATA(cmsg), vmsg->fds, fdsize); } else { msg.msg_controllen = 0; +msg.msg_control = NULL; } do { Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v1] qapi: document parameters of query-cpu-model-* QAPI commands

2024-03-25 Thread David Hildenbrand
# # Usually, a CPU model is compared against the maximum possible CPU # model of a certain configuration (e.g. the "host" model for KVM). @@ -154,7 +155,14 @@ # Some architectures may not support comparing CPU models. s390x # supports comparing CPU models. # -# Returns: a

[PATCH v1] qapi: document parameters of query-cpu-model-* QAPI commands

2024-03-25 Thread David Hildenbrand
arkus Armbruster Cc: Eric Blake Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: "Philippe Mathieu-Daudé" Cc: Yanan Wang Signed-off-by: David Hildenbrand --- qapi/machine-target.json | 46 +++- qapi/pragma.json | 3 --- 2 files changed,

Re: Let's close member documentation gaps

2024-03-25 Thread David Hildenbrand
On 25.03.24 15:13, David Hildenbrand wrote: On 25.03.24 10:36, Markus Armbruster wrote: If you're cc'ed, I have a bit of doc work for you. Search for your name to find it. The QAPI generator forces you to document your stuff. Except for commands, events, enum and object types listed

Re: Let's close member documentation gaps

2024-03-25 Thread David Hildenbrand
On 25.03.24 10:36, Markus Armbruster wrote: If you're cc'ed, I have a bit of doc work for you. Search for your name to find it. The QAPI generator forces you to document your stuff. Except for commands, events, enum and object types listed in pragma documentation-exceptions, the generator

Re: [PATCH v3 11/49] physmem: Introduce ram_block_discard_guest_memfd_range()

2024-03-20 Thread David Hildenbrand
On 20.03.24 18:38, Michael Roth wrote: On Wed, Mar 20, 2024 at 10:37:14AM +0100, David Hildenbrand wrote: On 20.03.24 09:39, Michael Roth wrote: From: Xiaoyao Li When memory page is converted from private to shared, the original private memory is back'ed by guest_memfd. Introduce

Re: [PATCH 2/4] hw/s390x/virtio-ccw: Always deliver NMI to first CPU

2024-03-20 Thread David Hildenbrand
first VCPU (all VCPUS on x86) (since 2.4) While we can select a particular CPU on HMP, the guest behavior is expected to be the same if using CPU #N or CPU #0. Since always using CPU#0 simplifies API maintainance, update s390_nmi() to deliver NMI to the first CPU. Signed-off-by: Philippe Mathieu-D

Re: [PATCH v3 11/49] physmem: Introduce ram_block_discard_guest_memfd_range()

2024-03-20 Thread David Hildenbrand
On 20.03.24 13:43, Xiaoyao Li wrote: On 3/20/2024 5:37 PM, David Hildenbrand wrote: On 20.03.24 09:39, Michael Roth wrote: From: Xiaoyao Li When memory page is converted from private to shared, the original private memory is back'ed by guest_memfd. Introduce

Re: [PATCH v3 11/49] physmem: Introduce ram_block_discard_guest_memfd_range()

2024-03-20 Thread David Hildenbrand
Codeveloped-by: Xiaoyao Li "Co-developed-by" Signed-off-by: Xiaoyao Li Reviewed-by: David Hildenbrand Your SOB should go here. --- Changes in v5: - Collect Reviewed-by from David; Changes in in v4: - Drop ram_block_convert_range() and open code its implementation in the next Patch.

Re: 答复: [PATCH v1 1/2] system/cpus: Fix pause_all_vcpus() under concurrent environment

2024-03-19 Thread David Hildenbrand
On 19.03.24 15:23, Peter Maydell wrote: On Tue, 19 Mar 2024 at 09:24, David Hildenbrand wrote: I spotted new pause_all_vcpus() / resume_all_vcpus() calls in hw/intc/arm_gicv3_kvm.c and thought they would be the problematic bit. Yeah, that's going to be problematic. Further note that a lot

Re: 答复: [PATCH v1 1/2] system/cpus: Fix pause_all_vcpus() under concurrent environment

2024-03-19 Thread David Hildenbrand
On 19.03.24 10:24, David Hildenbrand wrote: On 19.03.24 06:06, zhukeqian wrote: Hi David, Thanks for reviewing. On 17.03.24 09:37, Keqian Zhu via wrote: Both main loop thread and vCPU thread are allowed to call pause_all_vcpus(), and in general resume_all_vcpus() is called after it. Two

Re: 答复: [PATCH v1 2/2] system/cpus: Fix resume_all_vcpus() under vCPU hotplug condition

2024-03-19 Thread David Hildenbrand
On 19.03.24 06:11, zhukeqian wrote: Hi David, On 17.03.24 09:37, Keqian Zhu via wrote: For vCPU being hotplugged, qemu_init_vcpu() is called. In this function, we set vcpu state as stopped, and then wait vcpu thread to be created. As the vcpu state is stopped, it will inform us it has been

Re: 答复: [PATCH v1 1/2] system/cpus: Fix pause_all_vcpus() under concurrent environment

2024-03-19 Thread David Hildenbrand
:) Finding ways to avoid pause_all_vcpus() on the ARM reset code would be preferable. I guess you simply want to do something similar to what KVM does to avoid messing with pause_all_vcpus(): inhibiting certain IOCTLs. commit f39b7d2b96e3e73c01bb678cd096f7baf0b9ab39 Author: David Hildenbrand

Re: [PATCH v2 1/2] target/s390x: Use mutable temporary value for op_ts

2024-03-18 Thread David Hildenbrand
) Reviewed-by: Ilya Leoshkevich Reviewed-by: Richard Henderson [iii: Adjust a newline and capitalization, add tags] Signed-off-by: Ido Plat Signed-off-by: Ilya Leoshkevich --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v1 2/2] system/cpus: Fix resume_all_vcpus() under vCPU hotplug condition

2024-03-18 Thread David Hildenbrand
On 17.03.24 09:37, Keqian Zhu via wrote: For vCPU being hotplugged, qemu_init_vcpu() is called. In this function, we set vcpu state as stopped, and then wait vcpu thread to be created. As the vcpu state is stopped, it will inform us it has been created and then wait on halt_cond. After we has

Re: [PATCH v1 1/2] system/cpus: Fix pause_all_vcpus() under concurrent environment

2024-03-18 Thread David Hildenbrand
On 17.03.24 09:37, Keqian Zhu via wrote: Both main loop thread and vCPU thread are allowed to call pause_all_vcpus(), and in general resume_all_vcpus() is called after it. Two issues live in pause_all_vcpus(): In general, calling pause_all_vcpus() from VCPU threads is quite dangerous. Do we

Re: [PATCH v2 00/14] libvhost-user: support more memslots and cleanup memslot handling code

2024-03-12 Thread David Hildenbrand
On 11.03.24 21:03, Mario Casquero wrote: This series has been successfully tested by QE. Start the qemu-storage-daemon in the background with a rhel 9.5 image and vhost-user-blk. After that, boot up a VM with virtio-mem and vhost-user-blk-pci. Check with the HMP command 'info mtree' that

Re: [PATCH v2 0/4] physmem: Fix MemoryRegion for second access to cached MMIO Address Space

2024-03-08 Thread David Hildenbrand
On 08.03.24 08:36, Peter Xu wrote: On Thu, Mar 07, 2024 at 03:37:06PM +, Jonathan Cameron wrote: v2: (Thanks to Peter Xu for reviewing!) - New patch 1 to rename addr1 to mr_addr in the interests of meaningful naming. - Take advantage of a cached address space only allow for a single MR to

Re: [PATCH v2 4/4] physmem: Fix wrong address in large address_space_read/write_cached_slow()

2024-03-08 Thread David Hildenbrand
at least the level of confusion this creates is consistent with the other code. Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v2 3/4] physmem: Factor out body of flatview_read/write_continue() loop

2024-03-07 Thread David Hildenbrand
unused addr parameter. - Carry through new mr_addr parameter name. - RB not picked up as not sure what Peter will think wrt to resulting parameter ordering. --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v2 2/4] physmem: Reduce local variable scope in flatview_read/write_continue()

2024-03-07 Thread David Hildenbrand
On 07.03.24 16:37, Jonathan Cameron wrote: Precursor to factoring out the inner loops for reuse. Reviewed-by: Peter Xu Signed-off-by: Jonathan Cameron --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v2 1/4] physmem: Rename addr1 to more informative mr_addr in flatview_read/write() and similar

2024-03-07 Thread David Hildenbrand
by flatview_translate(). Similarly rename the parameter in address_space_read/write_cached_slow() Suggested-by: Peter Xu Signed-off-by: Jonathan Cameron Much cleaner indeed! Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH] qapi: Fix format of the memory-backend-file's @rom property doc comment

2024-02-29 Thread David Hildenbrand
e, we need writable RAM instead of +# ROM, and want to set this property to 'off'. (default: auto, +# since 8.2) # # Since: 2.1 ## Ideally, we'd have a format checker that complains like checkpatch usually would. Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH 9/9] hostmem-file: support POSIX shm_open()

2024-02-28 Thread David Hildenbrand
On 28.02.24 12:47, Stefano Garzarella wrote: Add a new `shm` bool option for `-object memory-backend-file`. When this option is set to true, the POSIX shm_open(3) is used instead of open(2). So a file will not be created in the filesystem, but a "POSIX shared memory object" will be

Re: [PATCH v4 33/66] i386/tdx: Make memory type private by default

2024-02-20 Thread David Hildenbrand
On 29.01.24 03:18, Xiaoyao Li wrote: On 1/26/2024 10:58 PM, David Hildenbrand wrote: On 25.01.24 04:22, Xiaoyao Li wrote: By default (due to the recent UPM change), restricted memory attribute is shared.  Convert the memory region from shared to private at the memory slot creation time. add

Re: [PATCH] system/physmem: remove redundant arg reassignment

2024-02-15 Thread David Hildenbrand
ock; if (*size == 0) { return NULL; } base-commit: 5767815218efd3cbfd409505ed824d5f356044ae Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

[PATCH v2 06/14] libvhost-user: No need to check for NULL when unmapping

2024-02-14 Thread David Hildenbrand
We never add a memory region if mmap() failed. Therefore, no need to check for NULL. Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff

[PATCH v2 04/14] libvhost-user: Merge vu_set_mem_table_exec_postcopy() into vu_set_mem_table_exec()

2024-02-14 Thread David Hildenbrand
Let's reduce some code duplication and prepare for further changes. Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.c | 119 +++--- 1 file changed, 39 insertions(+), 80 deletions(-) diff

[PATCH v2 09/14] libvhost-user: Factor out search for memory region by GPA and simplify

2024-02-14 Thread David Hildenbrand
GPA can belong to at most one memory region, and everything else doesn't make sense. Let's factor out our search to prepare for further changes. Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.c | 79 +

[PATCH v2 07/14] libvhost-user: Don't zero out memory for memory regions

2024-02-14 Thread David Hildenbrand
dev->nregions always covers only valid entries. Stop zeroing out other array elements that are unused. Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.c | 7 +-- 1 file changed, 1 insertion(+)

[PATCH v2 01/14] libvhost-user: Dynamically allocate memory for memory slots

2024-02-14 Thread David Hildenbrand
ano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.c | 11 +++ subprojects/libvhost-user/libvhost-user.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-u

[PATCH v2 10/14] libvhost-user: Speedup gpa_to_mem_region() and vu_gpa_to_va()

2024-02-14 Thread David Hildenbrand
ave many memslots. Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.c | 49 +-- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/subprojects/libvhost-user/libvhost-user.c

[PATCH v2 13/14] libvhost-user: Dynamically remap rings after (temporarily?) removing memory regions

2024-02-14 Thread David Hildenbrand
the ring again when required. Acked-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.c | 107 -- 1 file changed, 78 insertions(+), 29 deletions(-) diff --git a/subprojects/libvhost-user/libvhost

[PATCH v2 05/14] libvhost-user: Factor out adding a memory region

2024-02-14 Thread David Hildenbrand
dev->nregions if anything went wrong. Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.c | 168 -- 1 file changed, 60 insertions(+), 108 deletions(-) diff --git a/subprojects/libvhost-user/li

[PATCH v2 08/14] libvhost-user: Don't search for duplicates when removing memory regions

2024-02-14 Thread David Hildenbrand
We cannot have duplicate memory regions, something would be deeply flawed elsewhere. Let's just stop the search once we found an entry. We'll add more sanity checks when adding memory regions later. Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand

[PATCH v2 02/14] libvhost-user: Bump up VHOST_USER_MAX_RAM_SLOTS to 509

2024-02-14 Thread David Hildenbrand
/ Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.h | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvhost-user/libvhost

[PATCH v2 00/14] libvhost-user: support more memslots and cleanup memslot handling code

2024-02-14 Thread David Hildenbrand
an vary depending on the architecture. "unsigned int" is sufficient here. -> Updated patch description * Added RBs+ACKs * Did a Gitlab CI run, seems to be happy reagrding libvhost-user Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Stefan Hajnoczi Cc: Stefano Garzarella Cc: Germano

[PATCH v2 12/14] libvhost-user: Factor out vq usability check

2024-02-14 Thread David Hildenbrand
Let's factor it out to prepare for further changes. Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.c | 24 +++ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git

[PATCH v2 14/14] libvhost-user: Mark mmap'ed region memory as MADV_DONTDUMP

2024-02-14 Thread David Hildenbrand
. If ever required for debugging purposes, we could mark only the mapped rings MADV_DODUMP. Ignore errors during madvise() for now. Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.c | 6 ++ 1 file changed

[PATCH v2 11/14] libvhost-user: Use most of mmap_offset as fd_offset

2024-02-14 Thread David Hildenbrand
space_addr: 0x7fb77bffe000 old mmap_offset: 0xc000 fd_offset: 0xc000 new mmap_offset: 0x mmap_addr: 0x7f028400 Successfully added new region Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David H

[PATCH v2 03/14] libvhost-user: Factor out removing all mem regions

2024-02-14 Thread David Hildenbrand
Let's factor it out. Note that the check for MAP_FAILED was wrong as we never set mmap_addr if mmap() failed. We'll remove the NULL check separately. Reviewed-by: Raphael Norwitz Acked-by: Stefano Garzarella Signed-off-by: David Hildenbrand --- subprojects/libvhost-user/libvhost-user.c | 34

Re: [PATCH v1 00/15] libvhost-user: support more memslots and cleanup memslot handling code

2024-02-14 Thread David Hildenbrand
On 13.02.24 19:55, Michael S. Tsirkin wrote: On Tue, Feb 13, 2024 at 07:27:44PM +0100, David Hildenbrand wrote: On 13.02.24 18:33, Michael S. Tsirkin wrote: On Fri, Feb 02, 2024 at 10:53:17PM +0100, David Hildenbrand wrote: This series adds support for more memslots (509) to libvhost-user

Re: [PATCH v1 00/15] libvhost-user: support more memslots and cleanup memslot handling code

2024-02-13 Thread David Hildenbrand
On 13.02.24 18:33, Michael S. Tsirkin wrote: On Fri, Feb 02, 2024 at 10:53:17PM +0100, David Hildenbrand wrote: This series adds support for more memslots (509) to libvhost-user, to make it fully compatible with virtio-mem that uses up to 256 memslots accross all memory devices in "dy

Re: [PATCH v1 01/15] libvhost-user: Fix msg_region->userspace_addr computation

2024-02-13 Thread David Hildenbrand
On 13.02.24 18:32, Michael S. Tsirkin wrote: On Fri, Feb 02, 2024 at 10:53:18PM +0100, David Hildenbrand wrote: We barely had mmap_offset set in the past. With virtio-mem and dynamic-memslots that will change. In vu_add_mem_reg() and vu_set_mem_table_exec_postcopy(), we are performing pointer

Re: [PATCH V3 09/13] migration: notifier error checking

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:54, Steve Sistare wrote: Check the status returned by migration notifiers and report errors. If notifiers fail, call the notifiers again so they can clean up. IIUC, if any of the notifiers will actually start to fail, say, during MIG_EVENT_PRECOPY_SETUP, you will call

Re: [PATCH V3 08/13] migration: refactor migrate_fd_connect failures

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:54, Steve Sistare wrote: Move common code for the error path in migrate_fd_connect to a shared fail label. No functional change. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH V3 07/13] migration: per-mode notifiers

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:54, Steve Sistare wrote: Keep a separate list of migration notifiers for each migration mode. Suggested-by: Peter Xu Signed-off-by: Steve Sistare --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH V3 06/13] migration: MigrationNotifyFunc

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:53, Steve Sistare wrote: Define MigrationNotifyFunc to improve type safety and simplify migration notifiers. Signed-off-by: Steve Sistare --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH V3 04/13] migration: MigrationEvent for notifiers

2024-02-12 Thread David Hildenbrand
. Suggested-by: Peter Xu Signed-off-by: Steve Sistare --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH V3 03/13] migration: convert to NotifierWithReturn

2024-02-12 Thread David Hildenbrand
Xu --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH V3 02/13] migration: remove error from notifier data

2024-02-12 Thread David Hildenbrand
On 08.02.24 19:53, Steve Sistare wrote: Remove the error object from opaque data passed to notifiers. Use the new error parameter passed to the notifier instead. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- Would have squashed #1 and #2. Reviewed-by: David Hildenbrand -- Cheers

Re: [PATCH V3 01/13] notify: pass error to notifier with return

2024-02-12 Thread David Hildenbrand
: Peter Xu --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH v1 00/15] libvhost-user: support more memslots and cleanup memslot handling code

2024-02-09 Thread David Hildenbrand
On 07.02.24 12:40, Stefano Garzarella wrote: On Fri, Feb 02, 2024 at 10:53:17PM +0100, David Hildenbrand wrote: This series adds support for more memslots (509) to libvhost-user, to make it fully compatible with virtio-mem that uses up to 256 memslots accross all memory devices in "dy

  1   2   3   4   5   6   7   8   9   10   >