qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
@ 2025-03-07 21:56 Pierrick Bouvier
  2025-03-07 21:56 ` [PATCH v4 1/7] hw/hyperv/hv-balloon-stub: common compilation unit Pierrick Bouvier
                   ` (9 more replies)
  0 siblings, 10 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 21:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: philmd, Paolo Bonzini, pierrick.bouvier, kvm, alex.bennee,
	Marcelo Tosatti, Maciej S. Szmigiero, richard.henderson,
	manos.pitsidianakis

Work towards having a single binary, by removing duplicated object files.

hw/hyperv/hyperv.c was excluded at this time, because it depends on target
dependent symbols:
- from system/kvm.h
    - kvm_check_extension
    - kvm_vm_ioctl
- from exec/cpu-all.h | memory_ldst_phys.h.inc
    - ldq_phys

v2
- remove osdep from header
- use hardcoded buffer size for syndbg, assuming page size is always 4Kb.

v3
- fix assert for page size.

v4
- use KiB unit

Pierrick Bouvier (7):
  hw/hyperv/hv-balloon-stub: common compilation unit
  hw/hyperv/hyperv.h: header cleanup
  hw/hyperv/vmbus: common compilation unit
  hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386
  hw/hyperv/syndbg: common compilation unit
  hw/hyperv/balloon: common balloon compilation units
  hw/hyperv/hyperv_testdev: common compilation unit

 include/hw/hyperv/hyperv-proto.h | 12 ++++++++
 include/hw/hyperv/hyperv.h       |  3 +-
 target/i386/kvm/hyperv-proto.h   | 12 --------
 hw/hyperv/syndbg.c               | 11 +++++--
 hw/hyperv/vmbus.c                | 50 ++++++++++++++++----------------
 hw/hyperv/meson.build            |  9 +++---
 6 files changed, 52 insertions(+), 45 deletions(-)

-- 
2.39.5



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v4 1/7] hw/hyperv/hv-balloon-stub: common compilation unit
  2025-03-07 21:56 [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
@ 2025-03-07 21:56 ` Pierrick Bouvier
  2025-03-07 21:56 ` [PATCH v4 2/7] hw/hyperv/hyperv.h: header cleanup Pierrick Bouvier
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 21:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: philmd, Paolo Bonzini, pierrick.bouvier, kvm, alex.bennee,
	Marcelo Tosatti, Maciej S. Szmigiero, richard.henderson,
	manos.pitsidianakis

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 hw/hyperv/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build
index d3d2668c71a..f4aa0a5ada9 100644
--- a/hw/hyperv/meson.build
+++ b/hw/hyperv/meson.build
@@ -2,4 +2,5 @@ specific_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'))
 specific_ss.add(when: 'CONFIG_HYPERV_TESTDEV', if_true: files('hyperv_testdev.c'))
 specific_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c'))
 specific_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c'))
-specific_ss.add(when: 'CONFIG_HV_BALLOON', if_true: files('hv-balloon.c', 'hv-balloon-page_range_tree.c', 'hv-balloon-our_range_memslots.c'), if_false: files('hv-balloon-stub.c'))
+specific_ss.add(when: 'CONFIG_HV_BALLOON', if_true: files('hv-balloon.c', 'hv-balloon-page_range_tree.c', 'hv-balloon-our_range_memslots.c'))
+system_ss.add(when: 'CONFIG_HV_BALLOON', if_false: files('hv-balloon-stub.c'))
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v4 2/7] hw/hyperv/hyperv.h: header cleanup
  2025-03-07 21:56 [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
  2025-03-07 21:56 ` [PATCH v4 1/7] hw/hyperv/hv-balloon-stub: common compilation unit Pierrick Bouvier
@ 2025-03-07 21:56 ` Pierrick Bouvier
  2025-03-11 15:05   ` Philippe Mathieu-Daudé
  2025-03-07 21:56 ` [PATCH v4 3/7] hw/hyperv/vmbus: common compilation unit Pierrick Bouvier
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 21:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: philmd, Paolo Bonzini, pierrick.bouvier, kvm, alex.bennee,
	Marcelo Tosatti, Maciej S. Szmigiero, richard.henderson,
	manos.pitsidianakis

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 include/hw/hyperv/hyperv.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/hw/hyperv/hyperv.h b/include/hw/hyperv/hyperv.h
index d717b4e13d4..63a8b65278f 100644
--- a/include/hw/hyperv/hyperv.h
+++ b/include/hw/hyperv/hyperv.h
@@ -10,7 +10,8 @@
 #ifndef HW_HYPERV_HYPERV_H
 #define HW_HYPERV_HYPERV_H
 
-#include "cpu-qom.h"
+#include "exec/hwaddr.h"
+#include "hw/core/cpu.h"
 #include "hw/hyperv/hyperv-proto.h"
 
 typedef struct HvSintRoute HvSintRoute;
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v4 3/7] hw/hyperv/vmbus: common compilation unit
  2025-03-07 21:56 [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
  2025-03-07 21:56 ` [PATCH v4 1/7] hw/hyperv/hv-balloon-stub: common compilation unit Pierrick Bouvier
  2025-03-07 21:56 ` [PATCH v4 2/7] hw/hyperv/hyperv.h: header cleanup Pierrick Bouvier
@ 2025-03-07 21:56 ` Pierrick Bouvier
  2025-03-07 21:56 ` [PATCH v4 4/7] hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386 Pierrick Bouvier
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 21:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: philmd, Paolo Bonzini, pierrick.bouvier, kvm, alex.bennee,
	Marcelo Tosatti, Maciej S. Szmigiero, richard.henderson,
	manos.pitsidianakis

Replace TARGET_PAGE.* by runtime calls.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 hw/hyperv/vmbus.c     | 50 +++++++++++++++++++++----------------------
 hw/hyperv/meson.build |  2 +-
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
index 12a7dc43128..109ac319caf 100644
--- a/hw/hyperv/vmbus.c
+++ b/hw/hyperv/vmbus.c
@@ -18,7 +18,7 @@
 #include "hw/hyperv/vmbus.h"
 #include "hw/hyperv/vmbus-bridge.h"
 #include "hw/sysbus.h"
-#include "cpu.h"
+#include "exec/target_page.h"
 #include "trace.h"
 
 enum {
@@ -309,7 +309,7 @@ void vmbus_put_gpadl(VMBusGpadl *gpadl)
 
 uint32_t vmbus_gpadl_len(VMBusGpadl *gpadl)
 {
-    return gpadl->num_gfns * TARGET_PAGE_SIZE;
+    return gpadl->num_gfns * qemu_target_page_size();
 }
 
 static void gpadl_iter_init(GpadlIter *iter, VMBusGpadl *gpadl,
@@ -323,14 +323,14 @@ static void gpadl_iter_init(GpadlIter *iter, VMBusGpadl *gpadl,
 
 static inline void gpadl_iter_cache_unmap(GpadlIter *iter)
 {
-    uint32_t map_start_in_page = (uintptr_t)iter->map & ~TARGET_PAGE_MASK;
-    uint32_t io_end_in_page = ((iter->last_off - 1) & ~TARGET_PAGE_MASK) + 1;
+    uint32_t map_start_in_page = (uintptr_t)iter->map & ~qemu_target_page_mask();
+    uint32_t io_end_in_page = ((iter->last_off - 1) & ~qemu_target_page_mask()) + 1;
 
     /* mapping is only done to do non-zero amount of i/o */
     assert(iter->last_off > 0);
     assert(map_start_in_page < io_end_in_page);
 
-    dma_memory_unmap(iter->as, iter->map, TARGET_PAGE_SIZE - map_start_in_page,
+    dma_memory_unmap(iter->as, iter->map, qemu_target_page_size() - map_start_in_page,
                      iter->dir, io_end_in_page - map_start_in_page);
 }
 
@@ -348,17 +348,17 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
     assert(iter->active);
 
     while (len) {
-        uint32_t off_in_page = iter->off & ~TARGET_PAGE_MASK;
-        uint32_t pgleft = TARGET_PAGE_SIZE - off_in_page;
+        uint32_t off_in_page = iter->off & ~qemu_target_page_mask();
+        uint32_t pgleft = qemu_target_page_size() - off_in_page;
         uint32_t cplen = MIN(pgleft, len);
         void *p;
 
         /* try to reuse the cached mapping */
         if (iter->map) {
             uint32_t map_start_in_page =
-                (uintptr_t)iter->map & ~TARGET_PAGE_MASK;
-            uint32_t off_base = iter->off & ~TARGET_PAGE_MASK;
-            uint32_t mapped_base = (iter->last_off - 1) & ~TARGET_PAGE_MASK;
+                (uintptr_t)iter->map & ~qemu_target_page_mask();
+            uint32_t off_base = iter->off & ~qemu_target_page_mask();
+            uint32_t mapped_base = (iter->last_off - 1) & ~qemu_target_page_mask();
             if (off_base != mapped_base || off_in_page < map_start_in_page) {
                 gpadl_iter_cache_unmap(iter);
                 iter->map = NULL;
@@ -368,10 +368,10 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
         if (!iter->map) {
             dma_addr_t maddr;
             dma_addr_t mlen = pgleft;
-            uint32_t idx = iter->off >> TARGET_PAGE_BITS;
+            uint32_t idx = iter->off >> qemu_target_page_bits();
             assert(idx < iter->gpadl->num_gfns);
 
-            maddr = (iter->gpadl->gfns[idx] << TARGET_PAGE_BITS) | off_in_page;
+            maddr = (iter->gpadl->gfns[idx] << qemu_target_page_bits()) | off_in_page;
 
             iter->map = dma_memory_map(iter->as, maddr, &mlen, iter->dir,
                                        MEMTXATTRS_UNSPECIFIED);
@@ -382,7 +382,7 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
             }
         }
 
-        p = (void *)(uintptr_t)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
+        p = (void *)(uintptr_t)(((uintptr_t)iter->map & qemu_target_page_mask()) |
                 off_in_page);
         if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
             memcpy(p, buf, cplen);
@@ -591,9 +591,9 @@ static void ringbuf_init_common(VMBusRingBufCommon *ringbuf, VMBusGpadl *gpadl,
                                 uint32_t begin, uint32_t end)
 {
     ringbuf->as = as;
-    ringbuf->rb_addr = gpadl->gfns[begin] << TARGET_PAGE_BITS;
-    ringbuf->base = (begin + 1) << TARGET_PAGE_BITS;
-    ringbuf->len = (end - begin - 1) << TARGET_PAGE_BITS;
+    ringbuf->rb_addr = gpadl->gfns[begin] << qemu_target_page_bits();
+    ringbuf->base = (begin + 1) << qemu_target_page_bits();
+    ringbuf->len = (end - begin - 1) << qemu_target_page_bits();
     gpadl_iter_init(&ringbuf->iter, gpadl, as, dir);
 }
 
@@ -734,7 +734,7 @@ static int vmbus_channel_notify_guest(VMBusChannel *chan)
     unsigned long *int_map, mask;
     unsigned idx;
     hwaddr addr = chan->vmbus->int_page_gpa;
-    hwaddr len = TARGET_PAGE_SIZE / 2, dirty = 0;
+    hwaddr len = qemu_target_page_size() / 2, dirty = 0;
 
     trace_vmbus_channel_notify_guest(chan->id);
 
@@ -743,7 +743,7 @@ static int vmbus_channel_notify_guest(VMBusChannel *chan)
     }
 
     int_map = cpu_physical_memory_map(addr, &len, 1);
-    if (len != TARGET_PAGE_SIZE / 2) {
+    if (len != qemu_target_page_size() / 2) {
         res = -ENXIO;
         goto unmap;
     }
@@ -1038,14 +1038,14 @@ static int sgl_from_gpa_ranges(QEMUSGList *sgl, VMBusDevice *dev,
         }
         len -= sizeof(range);
 
-        if (range.byte_offset & TARGET_PAGE_MASK) {
+        if (range.byte_offset & qemu_target_page_mask()) {
             goto eio;
         }
 
         for (; range.byte_count; range.byte_offset = 0) {
             uint64_t paddr;
             uint32_t plen = MIN(range.byte_count,
-                                TARGET_PAGE_SIZE - range.byte_offset);
+                                qemu_target_page_size() - range.byte_offset);
 
             if (len < sizeof(uint64_t)) {
                 goto eio;
@@ -1055,7 +1055,7 @@ static int sgl_from_gpa_ranges(QEMUSGList *sgl, VMBusDevice *dev,
                 goto err;
             }
             len -= sizeof(uint64_t);
-            paddr <<= TARGET_PAGE_BITS;
+            paddr <<= qemu_target_page_bits();
             paddr |= range.byte_offset;
             range.byte_count -= plen;
 
@@ -1804,7 +1804,7 @@ static void handle_gpadl_header(VMBus *vmbus, vmbus_message_gpadl_header *msg,
      * anything else and simplify things greatly.
      */
     if (msg->rangecount != 1 || msg->range[0].byte_offset ||
-        (msg->range[0].byte_count != (num_gfns << TARGET_PAGE_BITS))) {
+        (msg->range[0].byte_count != (num_gfns << qemu_target_page_bits()))) {
         return;
     }
 
@@ -2240,10 +2240,10 @@ static void vmbus_signal_event(EventNotifier *e)
         return;
     }
 
-    addr = vmbus->int_page_gpa + TARGET_PAGE_SIZE / 2;
-    len = TARGET_PAGE_SIZE / 2;
+    addr = vmbus->int_page_gpa + qemu_target_page_size() / 2;
+    len = qemu_target_page_size() / 2;
     int_map = cpu_physical_memory_map(addr, &len, 1);
-    if (len != TARGET_PAGE_SIZE / 2) {
+    if (len != qemu_target_page_size() / 2) {
         goto unmap;
     }
 
diff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build
index f4aa0a5ada9..c855fdcf04c 100644
--- a/hw/hyperv/meson.build
+++ b/hw/hyperv/meson.build
@@ -1,6 +1,6 @@
 specific_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'))
 specific_ss.add(when: 'CONFIG_HYPERV_TESTDEV', if_true: files('hyperv_testdev.c'))
-specific_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c'))
+system_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c'))
 specific_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c'))
 specific_ss.add(when: 'CONFIG_HV_BALLOON', if_true: files('hv-balloon.c', 'hv-balloon-page_range_tree.c', 'hv-balloon-our_range_memslots.c'))
 system_ss.add(when: 'CONFIG_HV_BALLOON', if_false: files('hv-balloon-stub.c'))
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v4 4/7] hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386
  2025-03-07 21:56 [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
                   ` (2 preceding siblings ...)
  2025-03-07 21:56 ` [PATCH v4 3/7] hw/hyperv/vmbus: common compilation unit Pierrick Bouvier
@ 2025-03-07 21:56 ` Pierrick Bouvier
  2025-03-07 21:56 ` [PATCH v4 5/7] hw/hyperv/syndbg: common compilation unit Pierrick Bouvier
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 21:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: philmd, Paolo Bonzini, pierrick.bouvier, kvm, alex.bennee,
	Marcelo Tosatti, Maciej S. Szmigiero, richard.henderson,
	manos.pitsidianakis

Allows them to be available for common compilation units.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 include/hw/hyperv/hyperv-proto.h | 12 ++++++++++++
 target/i386/kvm/hyperv-proto.h   | 12 ------------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/hw/hyperv/hyperv-proto.h b/include/hw/hyperv/hyperv-proto.h
index 4a2297307b0..fffc5ce342f 100644
--- a/include/hw/hyperv/hyperv-proto.h
+++ b/include/hw/hyperv/hyperv-proto.h
@@ -61,6 +61,18 @@
 #define HV_MESSAGE_X64_APIC_EOI               0x80010004
 #define HV_MESSAGE_X64_LEGACY_FP_ERROR        0x80010005
 
+/*
+ * Hyper-V Synthetic debug options MSR
+ */
+#define HV_X64_MSR_SYNDBG_CONTROL               0x400000F1
+#define HV_X64_MSR_SYNDBG_STATUS                0x400000F2
+#define HV_X64_MSR_SYNDBG_SEND_BUFFER           0x400000F3
+#define HV_X64_MSR_SYNDBG_RECV_BUFFER           0x400000F4
+#define HV_X64_MSR_SYNDBG_PENDING_BUFFER        0x400000F5
+#define HV_X64_MSR_SYNDBG_OPTIONS               0x400000FF
+
+#define HV_X64_SYNDBG_OPTION_USE_HCALLS         BIT(2)
+
 /*
  * Message flags
  */
diff --git a/target/i386/kvm/hyperv-proto.h b/target/i386/kvm/hyperv-proto.h
index 464fbf09e35..a9f056f2f3e 100644
--- a/target/i386/kvm/hyperv-proto.h
+++ b/target/i386/kvm/hyperv-proto.h
@@ -151,18 +151,6 @@
 #define HV_X64_MSR_STIMER3_CONFIG               0x400000B6
 #define HV_X64_MSR_STIMER3_COUNT                0x400000B7
 
-/*
- * Hyper-V Synthetic debug options MSR
- */
-#define HV_X64_MSR_SYNDBG_CONTROL               0x400000F1
-#define HV_X64_MSR_SYNDBG_STATUS                0x400000F2
-#define HV_X64_MSR_SYNDBG_SEND_BUFFER           0x400000F3
-#define HV_X64_MSR_SYNDBG_RECV_BUFFER           0x400000F4
-#define HV_X64_MSR_SYNDBG_PENDING_BUFFER        0x400000F5
-#define HV_X64_MSR_SYNDBG_OPTIONS               0x400000FF
-
-#define HV_X64_SYNDBG_OPTION_USE_HCALLS         BIT(2)
-
 /*
  * Guest crash notification MSRs
  */
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v4 5/7] hw/hyperv/syndbg: common compilation unit
  2025-03-07 21:56 [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
                   ` (3 preceding siblings ...)
  2025-03-07 21:56 ` [PATCH v4 4/7] hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386 Pierrick Bouvier
@ 2025-03-07 21:56 ` Pierrick Bouvier
  2025-03-07 21:56 ` [PATCH v4 6/7] hw/hyperv/balloon: common balloon compilation units Pierrick Bouvier
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 21:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: philmd, Paolo Bonzini, pierrick.bouvier, kvm, alex.bennee,
	Marcelo Tosatti, Maciej S. Szmigiero, richard.henderson,
	manos.pitsidianakis

Replace TARGET_PAGE.* by runtime calls
We assume that page size is 4KB only, to dimension buffer size for
receiving message.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 hw/hyperv/syndbg.c    | 11 ++++++++---
 hw/hyperv/meson.build |  2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/hw/hyperv/syndbg.c b/hw/hyperv/syndbg.c
index d3e39170772..948829e6d89 100644
--- a/hw/hyperv/syndbg.c
+++ b/hw/hyperv/syndbg.c
@@ -10,11 +10,12 @@
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
 #include "qemu/sockets.h"
+#include "qemu/units.h"
 #include "qapi/error.h"
 #include "migration/vmstate.h"
 #include "hw/qdev-properties.h"
 #include "hw/loader.h"
-#include "cpu.h"
+#include "exec/target_page.h"
 #include "hw/hyperv/hyperv.h"
 #include "hw/hyperv/vmbus-bridge.h"
 #include "hw/hyperv/hyperv-proto.h"
@@ -183,12 +184,14 @@ static bool create_udp_pkt(HvSynDbg *syndbg, void *pkt, uint32_t pkt_len,
     return true;
 }
 
+#define MSG_BUFSZ (4 * KiB)
+
 static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint64_t outgpa,
                                 uint32_t count, bool is_raw, uint32_t options,
                                 uint64_t timeout, uint32_t *retrieved_count)
 {
     uint16_t ret;
-    uint8_t data_buf[TARGET_PAGE_SIZE - UDP_PKT_HEADER_SIZE];
+    uint8_t data_buf[MSG_BUFSZ];
     hwaddr out_len;
     void *out_data;
     ssize_t recv_byte_count;
@@ -201,7 +204,7 @@ static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint64_t outgpa,
         recv_byte_count = 0;
     } else {
         recv_byte_count = recv(syndbg->socket, data_buf,
-                               MIN(sizeof(data_buf), count), MSG_WAITALL);
+                               MIN(MSG_BUFSZ, count), MSG_WAITALL);
         if (recv_byte_count == -1) {
             return HV_STATUS_INVALID_PARAMETER;
         }
@@ -374,6 +377,8 @@ static const Property hv_syndbg_properties[] = {
 
 static void hv_syndbg_class_init(ObjectClass *klass, void *data)
 {
+    g_assert(MSG_BUFSZ >= qemu_target_page_size());
+
     DeviceClass *dc = DEVICE_CLASS(klass);
 
     device_class_set_props(dc, hv_syndbg_properties);
diff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build
index c855fdcf04c..a9f2045a9af 100644
--- a/hw/hyperv/meson.build
+++ b/hw/hyperv/meson.build
@@ -1,6 +1,6 @@
 specific_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'))
 specific_ss.add(when: 'CONFIG_HYPERV_TESTDEV', if_true: files('hyperv_testdev.c'))
 system_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c'))
-specific_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c'))
+system_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c'))
 specific_ss.add(when: 'CONFIG_HV_BALLOON', if_true: files('hv-balloon.c', 'hv-balloon-page_range_tree.c', 'hv-balloon-our_range_memslots.c'))
 system_ss.add(when: 'CONFIG_HV_BALLOON', if_false: files('hv-balloon-stub.c'))
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v4 6/7] hw/hyperv/balloon: common balloon compilation units
  2025-03-07 21:56 [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
                   ` (4 preceding siblings ...)
  2025-03-07 21:56 ` [PATCH v4 5/7] hw/hyperv/syndbg: common compilation unit Pierrick Bouvier
@ 2025-03-07 21:56 ` Pierrick Bouvier
  2025-03-07 21:56 ` [PATCH v4 7/7] hw/hyperv/hyperv_testdev: common compilation unit Pierrick Bouvier
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 21:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: philmd, Paolo Bonzini, pierrick.bouvier, kvm, alex.bennee,
	Marcelo Tosatti, Maciej S. Szmigiero, richard.henderson,
	manos.pitsidianakis

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 hw/hyperv/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build
index a9f2045a9af..5acd709bdd5 100644
--- a/hw/hyperv/meson.build
+++ b/hw/hyperv/meson.build
@@ -2,5 +2,5 @@ specific_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'))
 specific_ss.add(when: 'CONFIG_HYPERV_TESTDEV', if_true: files('hyperv_testdev.c'))
 system_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c'))
 system_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c'))
-specific_ss.add(when: 'CONFIG_HV_BALLOON', if_true: files('hv-balloon.c', 'hv-balloon-page_range_tree.c', 'hv-balloon-our_range_memslots.c'))
+system_ss.add(when: 'CONFIG_HV_BALLOON', if_true: files('hv-balloon.c', 'hv-balloon-page_range_tree.c', 'hv-balloon-our_range_memslots.c'))
 system_ss.add(when: 'CONFIG_HV_BALLOON', if_false: files('hv-balloon-stub.c'))
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v4 7/7] hw/hyperv/hyperv_testdev: common compilation unit
  2025-03-07 21:56 [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
                   ` (5 preceding siblings ...)
  2025-03-07 21:56 ` [PATCH v4 6/7] hw/hyperv/balloon: common balloon compilation units Pierrick Bouvier
@ 2025-03-07 21:56 ` Pierrick Bouvier
  2025-03-07 22:06 ` [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 21:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: philmd, Paolo Bonzini, pierrick.bouvier, kvm, alex.bennee,
	Marcelo Tosatti, Maciej S. Szmigiero, richard.henderson,
	manos.pitsidianakis

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 hw/hyperv/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build
index 5acd709bdd5..ef5a596c8ab 100644
--- a/hw/hyperv/meson.build
+++ b/hw/hyperv/meson.build
@@ -1,5 +1,5 @@
 specific_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'))
-specific_ss.add(when: 'CONFIG_HYPERV_TESTDEV', if_true: files('hyperv_testdev.c'))
+system_ss.add(when: 'CONFIG_HYPERV_TESTDEV', if_true: files('hyperv_testdev.c'))
 system_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c'))
 system_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c'))
 system_ss.add(when: 'CONFIG_HV_BALLOON', if_true: files('hv-balloon.c', 'hv-balloon-page_range_tree.c', 'hv-balloon-our_range_memslots.c'))
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
  2025-03-07 21:56 [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
                   ` (6 preceding siblings ...)
  2025-03-07 21:56 ` [PATCH v4 7/7] hw/hyperv/hyperv_testdev: common compilation unit Pierrick Bouvier
@ 2025-03-07 22:06 ` Philippe Mathieu-Daudé
  2025-03-07 22:38   ` Pierrick Bouvier
  2025-03-07 22:25 ` Philippe Mathieu-Daudé
  2025-03-20 19:00 ` Pierrick Bouvier
  9 siblings, 1 reply; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 22:06 UTC (permalink / raw)
  To: Pierrick Bouvier, qemu-devel
  Cc: Paolo Bonzini, kvm, alex.bennee, Marcelo Tosatti,
	Maciej S. Szmigiero, richard.henderson, manos.pitsidianakis

On 7/3/25 22:56, Pierrick Bouvier wrote:
> Work towards having a single binary, by removing duplicated object files.
> 
> hw/hyperv/hyperv.c was excluded at this time, because it depends on target
> dependent symbols:
> - from system/kvm.h
>      - kvm_check_extension
>      - kvm_vm_ioctl

Bug, these should be declared outside of COMPILING_PER_TARGET.

> - from exec/cpu-all.h | memory_ldst_phys.h.inc
>      - ldq_phys

Yeah, not an easy one.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
  2025-03-07 21:56 [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
                   ` (7 preceding siblings ...)
  2025-03-07 22:06 ` [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Philippe Mathieu-Daudé
@ 2025-03-07 22:25 ` Philippe Mathieu-Daudé
  2025-03-07 22:31   ` Maciej S. Szmigiero
  2025-03-20 19:00 ` Pierrick Bouvier
  9 siblings, 1 reply; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 22:25 UTC (permalink / raw)
  To: Pierrick Bouvier, qemu-devel
  Cc: Paolo Bonzini, kvm, alex.bennee, Marcelo Tosatti,
	Maciej S. Szmigiero, richard.henderson, manos.pitsidianakis

Hi Maciej,

On 7/3/25 22:56, Pierrick Bouvier wrote:
> Work towards having a single binary, by removing duplicated object files.

> Pierrick Bouvier (7):
>    hw/hyperv/hv-balloon-stub: common compilation unit
>    hw/hyperv/hyperv.h: header cleanup
>    hw/hyperv/vmbus: common compilation unit
>    hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386
>    hw/hyperv/syndbg: common compilation unit
>    hw/hyperv/balloon: common balloon compilation units
>    hw/hyperv/hyperv_testdev: common compilation unit

If you are happy with this series and provide your Ack-by tag,
I can take it in my next hw-misc pull request if that helps.

Regards,

Phil.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
  2025-03-07 22:25 ` Philippe Mathieu-Daudé
@ 2025-03-07 22:31   ` Maciej S. Szmigiero
  2025-03-07 22:37     ` Philippe Mathieu-Daudé
  2025-03-09 23:33     ` Pierrick Bouvier
  0 siblings, 2 replies; 21+ messages in thread
From: Maciej S. Szmigiero @ 2025-03-07 22:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Pierrick Bouvier
  Cc: Paolo Bonzini, kvm, alex.bennee, qemu-devel, Marcelo Tosatti,
	richard.henderson, manos.pitsidianakis

Hi Philippe,

On 7.03.2025 23:25, Philippe Mathieu-Daudé wrote:
> Hi Maciej,
> 
> On 7/3/25 22:56, Pierrick Bouvier wrote:
>> Work towards having a single binary, by removing duplicated object files.
> 
>> Pierrick Bouvier (7):
>>    hw/hyperv/hv-balloon-stub: common compilation unit
>>    hw/hyperv/hyperv.h: header cleanup
>>    hw/hyperv/vmbus: common compilation unit
>>    hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386
>>    hw/hyperv/syndbg: common compilation unit
>>    hw/hyperv/balloon: common balloon compilation units
>>    hw/hyperv/hyperv_testdev: common compilation unit
> 
> If you are happy with this series and provide your Ack-by tag,
> I can take it in my next hw-misc pull request if that helps.

There's nothing obviously wrong in the patch set,
but if we can defer this to Monday then I could do
a runtime check with a Windows VM too.

> Regards,
> 
> Phil.

Thanks,
Maciej



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
  2025-03-07 22:31   ` Maciej S. Szmigiero
@ 2025-03-07 22:37     ` Philippe Mathieu-Daudé
  2025-03-09 23:33     ` Pierrick Bouvier
  1 sibling, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-07 22:37 UTC (permalink / raw)
  To: Maciej S. Szmigiero, Pierrick Bouvier
  Cc: Paolo Bonzini, kvm, alex.bennee, qemu-devel, Marcelo Tosatti,
	richard.henderson, manos.pitsidianakis

On 7/3/25 23:31, Maciej S. Szmigiero wrote:
> Hi Philippe,
> 
> On 7.03.2025 23:25, Philippe Mathieu-Daudé wrote:
>> Hi Maciej,
>>
>> On 7/3/25 22:56, Pierrick Bouvier wrote:
>>> Work towards having a single binary, by removing duplicated object 
>>> files.
>>
>>> Pierrick Bouvier (7):
>>>    hw/hyperv/hv-balloon-stub: common compilation unit
>>>    hw/hyperv/hyperv.h: header cleanup
>>>    hw/hyperv/vmbus: common compilation unit
>>>    hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386
>>>    hw/hyperv/syndbg: common compilation unit
>>>    hw/hyperv/balloon: common balloon compilation units
>>>    hw/hyperv/hyperv_testdev: common compilation unit
>>
>> If you are happy with this series and provide your Ack-by tag,
>> I can take it in my next hw-misc pull request if that helps.
> 
> There's nothing obviously wrong in the patch set,
> but if we can defer this to Monday then I could do
> a runtime check with a Windows VM too.

Thanks, no rush on my side :)


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
  2025-03-07 22:06 ` [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Philippe Mathieu-Daudé
@ 2025-03-07 22:38   ` Pierrick Bouvier
  0 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-07 22:38 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Paolo Bonzini, kvm, alex.bennee, Marcelo Tosatti,
	Maciej S. Szmigiero, richard.henderson, manos.pitsidianakis

On 3/7/25 14:06, Philippe Mathieu-Daudé wrote:
> On 7/3/25 22:56, Pierrick Bouvier wrote:
>> Work towards having a single binary, by removing duplicated object files.
>>
>> hw/hyperv/hyperv.c was excluded at this time, because it depends on target
>> dependent symbols:
>> - from system/kvm.h
>>       - kvm_check_extension
>>       - kvm_vm_ioctl
> 
> Bug, these should be declared outside of COMPILING_PER_TARGET.
>

Yes, I noticed you solved it this way on one of your series.
In the end, since QEMU does not have any specific boundaries between 
subsystems (i.e. no proper libraries with private/public symbols), we 
are mostly free to include any symbol we see in an header as long as it 
does not use a target dependent type which changes the signature.

>> - from exec/cpu-all.h | memory_ldst_phys.h.inc
>>       - ldq_phys
> 
> Yeah, not an easy one.
> 


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
  2025-03-07 22:31   ` Maciej S. Szmigiero
  2025-03-07 22:37     ` Philippe Mathieu-Daudé
@ 2025-03-09 23:33     ` Pierrick Bouvier
  2025-03-10  0:14       ` Philippe Mathieu-Daudé
  2025-03-10 12:28       ` Maciej S. Szmigiero
  1 sibling, 2 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-09 23:33 UTC (permalink / raw)
  To: Maciej S. Szmigiero, Philippe Mathieu-Daudé
  Cc: Paolo Bonzini, kvm, alex.bennee, qemu-devel, Marcelo Tosatti,
	richard.henderson, manos.pitsidianakis

Hi Maciej,

On 3/7/25 14:31, Maciej S. Szmigiero wrote:
> Hi Philippe,
> 
> On 7.03.2025 23:25, Philippe Mathieu-Daudé wrote:
>> Hi Maciej,
>>
>> On 7/3/25 22:56, Pierrick Bouvier wrote:
>>> Work towards having a single binary, by removing duplicated object files.
>>
>>> Pierrick Bouvier (7):
>>>     hw/hyperv/hv-balloon-stub: common compilation unit
>>>     hw/hyperv/hyperv.h: header cleanup
>>>     hw/hyperv/vmbus: common compilation unit
>>>     hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386
>>>     hw/hyperv/syndbg: common compilation unit
>>>     hw/hyperv/balloon: common balloon compilation units
>>>     hw/hyperv/hyperv_testdev: common compilation unit
>>
>> If you are happy with this series and provide your Ack-by tag,
>> I can take it in my next hw-misc pull request if that helps.
> 
> There's nothing obviously wrong in the patch set,
> but if we can defer this to Monday then I could do
> a runtime check with a Windows VM too.
> 

this series needs some fixup after the merge of 58d0053: include/exec: 
Move TARGET_PAGE_{SIZE,MASK,BITS} to target_page.h.

I'll re-spin it later, so don't waste your time trying it.

Thanks,
Pierrick

>> Regards,
>>
>> Phil.
> 
> Thanks,
> Maciej
> 


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
  2025-03-09 23:33     ` Pierrick Bouvier
@ 2025-03-10  0:14       ` Philippe Mathieu-Daudé
  2025-03-10  2:10         ` Pierrick Bouvier
  2025-03-10 12:28         ` Maciej S. Szmigiero
  2025-03-10 12:28       ` Maciej S. Szmigiero
  1 sibling, 2 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-10  0:14 UTC (permalink / raw)
  To: Pierrick Bouvier, Maciej S. Szmigiero
  Cc: Paolo Bonzini, kvm, alex.bennee, qemu-devel, Marcelo Tosatti,
	richard.henderson, manos.pitsidianakis

On 10/3/25 00:33, Pierrick Bouvier wrote:
> Hi Maciej,
> 
> On 3/7/25 14:31, Maciej S. Szmigiero wrote:
>> Hi Philippe,
>>
>> On 7.03.2025 23:25, Philippe Mathieu-Daudé wrote:
>>> Hi Maciej,
>>>
>>> On 7/3/25 22:56, Pierrick Bouvier wrote:
>>>> Work towards having a single binary, by removing duplicated object 
>>>> files.
>>>
>>>> Pierrick Bouvier (7):
>>>>     hw/hyperv/hv-balloon-stub: common compilation unit
>>>>     hw/hyperv/hyperv.h: header cleanup
>>>>     hw/hyperv/vmbus: common compilation unit
>>>>     hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386
>>>>     hw/hyperv/syndbg: common compilation unit
>>>>     hw/hyperv/balloon: common balloon compilation units
>>>>     hw/hyperv/hyperv_testdev: common compilation unit
>>>
>>> If you are happy with this series and provide your Ack-by tag,
>>> I can take it in my next hw-misc pull request if that helps.
>>
>> There's nothing obviously wrong in the patch set,
>> but if we can defer this to Monday then I could do
>> a runtime check with a Windows VM too.
>>
> 
> this series needs some fixup after the merge of 58d0053: include/exec: 
> Move TARGET_PAGE_{SIZE,MASK,BITS} to target_page.h.
> 
> I'll re-spin it later, so don't waste your time trying it.

1, 2 & 4 are not affected. Until someone object, I plan to include them
in my next hw-misc pull request on Tuesday.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
  2025-03-10  0:14       ` Philippe Mathieu-Daudé
@ 2025-03-10  2:10         ` Pierrick Bouvier
  2025-03-10 12:28         ` Maciej S. Szmigiero
  1 sibling, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-10  2:10 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Maciej S. Szmigiero
  Cc: Paolo Bonzini, kvm, alex.bennee, qemu-devel, Marcelo Tosatti,
	richard.henderson, manos.pitsidianakis

On 3/9/25 17:14, Philippe Mathieu-Daudé wrote:
> On 10/3/25 00:33, Pierrick Bouvier wrote:
>> Hi Maciej,
>>
>> On 3/7/25 14:31, Maciej S. Szmigiero wrote:
>>> Hi Philippe,
>>>
>>> On 7.03.2025 23:25, Philippe Mathieu-Daudé wrote:
>>>> Hi Maciej,
>>>>
>>>> On 7/3/25 22:56, Pierrick Bouvier wrote:
>>>>> Work towards having a single binary, by removing duplicated object
>>>>> files.
>>>>
>>>>> Pierrick Bouvier (7):
>>>>>      hw/hyperv/hv-balloon-stub: common compilation unit
>>>>>      hw/hyperv/hyperv.h: header cleanup
>>>>>      hw/hyperv/vmbus: common compilation unit
>>>>>      hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386
>>>>>      hw/hyperv/syndbg: common compilation unit
>>>>>      hw/hyperv/balloon: common balloon compilation units
>>>>>      hw/hyperv/hyperv_testdev: common compilation unit
>>>>
>>>> If you are happy with this series and provide your Ack-by tag,
>>>> I can take it in my next hw-misc pull request if that helps.
>>>
>>> There's nothing obviously wrong in the patch set,
>>> but if we can defer this to Monday then I could do
>>> a runtime check with a Windows VM too.
>>>
>>
>> this series needs some fixup after the merge of 58d0053: include/exec:
>> Move TARGET_PAGE_{SIZE,MASK,BITS} to target_page.h.
>>
>> I'll re-spin it later, so don't waste your time trying it.
> 
> 1, 2 & 4 are not affected. Until someone object, I plan to include them
> in my next hw-misc pull request on Tuesday.

Thanks Phillipe.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
  2025-03-09 23:33     ` Pierrick Bouvier
  2025-03-10  0:14       ` Philippe Mathieu-Daudé
@ 2025-03-10 12:28       ` Maciej S. Szmigiero
  1 sibling, 0 replies; 21+ messages in thread
From: Maciej S. Szmigiero @ 2025-03-10 12:28 UTC (permalink / raw)
  To: Pierrick Bouvier, Philippe Mathieu-Daudé
  Cc: Paolo Bonzini, kvm, alex.bennee, qemu-devel, Marcelo Tosatti,
	richard.henderson, manos.pitsidianakis

On 10.03.2025 00:33, Pierrick Bouvier wrote:
> Hi Maciej,
> 
> On 3/7/25 14:31, Maciej S. Szmigiero wrote:
>> Hi Philippe,
>>
>> On 7.03.2025 23:25, Philippe Mathieu-Daudé wrote:
>>> Hi Maciej,
>>>
>>> On 7/3/25 22:56, Pierrick Bouvier wrote:
>>>> Work towards having a single binary, by removing duplicated object files.
>>>
>>>> Pierrick Bouvier (7):
>>>>     hw/hyperv/hv-balloon-stub: common compilation unit
>>>>     hw/hyperv/hyperv.h: header cleanup
>>>>     hw/hyperv/vmbus: common compilation unit
>>>>     hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386
>>>>     hw/hyperv/syndbg: common compilation unit
>>>>     hw/hyperv/balloon: common balloon compilation units
>>>>     hw/hyperv/hyperv_testdev: common compilation unit
>>>
>>> If you are happy with this series and provide your Ack-by tag,
>>> I can take it in my next hw-misc pull request if that helps.
>>
>> There's nothing obviously wrong in the patch set,
>> but if we can defer this to Monday then I could do
>> a runtime check with a Windows VM too.
>>
> 
> this series needs some fixup after the merge of 58d0053: include/exec: Move TARGET_PAGE_{SIZE,MASK,BITS} to target_page.h.
> 
> I'll re-spin it later, so don't waste your time trying it.

Waiting for updated series then.
  
> Thanks,
> Pierrick
> 

Thanks,
Maciej




^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
  2025-03-10  0:14       ` Philippe Mathieu-Daudé
  2025-03-10  2:10         ` Pierrick Bouvier
@ 2025-03-10 12:28         ` Maciej S. Szmigiero
  1 sibling, 0 replies; 21+ messages in thread
From: Maciej S. Szmigiero @ 2025-03-10 12:28 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Pierrick Bouvier
  Cc: Paolo Bonzini, kvm, alex.bennee, qemu-devel, Marcelo Tosatti,
	richard.henderson, manos.pitsidianakis

On 10.03.2025 01:14, Philippe Mathieu-Daudé wrote:
> On 10/3/25 00:33, Pierrick Bouvier wrote:
>> Hi Maciej,
>>
>> On 3/7/25 14:31, Maciej S. Szmigiero wrote:
>>> Hi Philippe,
>>>
>>> On 7.03.2025 23:25, Philippe Mathieu-Daudé wrote:
>>>> Hi Maciej,
>>>>
>>>> On 7/3/25 22:56, Pierrick Bouvier wrote:
>>>>> Work towards having a single binary, by removing duplicated object files.
>>>>
>>>>> Pierrick Bouvier (7):
>>>>>     hw/hyperv/hv-balloon-stub: common compilation unit
>>>>>     hw/hyperv/hyperv.h: header cleanup
>>>>>     hw/hyperv/vmbus: common compilation unit
>>>>>     hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386
>>>>>     hw/hyperv/syndbg: common compilation unit
>>>>>     hw/hyperv/balloon: common balloon compilation units
>>>>>     hw/hyperv/hyperv_testdev: common compilation unit
>>>>
>>>> If you are happy with this series and provide your Ack-by tag,
>>>> I can take it in my next hw-misc pull request if that helps.
>>>
>>> There's nothing obviously wrong in the patch set,
>>> but if we can defer this to Monday then I could do
>>> a runtime check with a Windows VM too.
>>>
>>
>> this series needs some fixup after the merge of 58d0053: include/exec: Move TARGET_PAGE_{SIZE,MASK,BITS} to target_page.h.
>>
>> I'll re-spin it later, so don't waste your time trying it.
> 
> 1, 2 & 4 are not affected. Until someone object, I plan to include them
> in my next hw-misc pull request on Tuesday.

These patches seem fine and low-risk, no objections here.

Thanks,
Maciej



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 2/7] hw/hyperv/hyperv.h: header cleanup
  2025-03-07 21:56 ` [PATCH v4 2/7] hw/hyperv/hyperv.h: header cleanup Pierrick Bouvier
@ 2025-03-11 15:05   ` Philippe Mathieu-Daudé
  2025-03-11 15:14     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-11 15:05 UTC (permalink / raw)
  To: Pierrick Bouvier, qemu-devel
  Cc: Paolo Bonzini, kvm, alex.bennee, Marcelo Tosatti,
	Maciej S. Szmigiero, richard.henderson, manos.pitsidianakis

On 7/3/25 22:56, Pierrick Bouvier wrote:
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
>   include/hw/hyperv/hyperv.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/hw/hyperv/hyperv.h b/include/hw/hyperv/hyperv.h
> index d717b4e13d4..63a8b65278f 100644
> --- a/include/hw/hyperv/hyperv.h
> +++ b/include/hw/hyperv/hyperv.h
> @@ -10,7 +10,8 @@
>   #ifndef HW_HYPERV_HYPERV_H
>   #define HW_HYPERV_HYPERV_H
>   
> -#include "cpu-qom.h"
> +#include "exec/hwaddr.h"
> +#include "hw/core/cpu.h"

I don't see where "hw/core/cpu.h" is used.

>   #include "hw/hyperv/hyperv-proto.h"
>   
>   typedef struct HvSintRoute HvSintRoute;



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 2/7] hw/hyperv/hyperv.h: header cleanup
  2025-03-11 15:05   ` Philippe Mathieu-Daudé
@ 2025-03-11 15:14     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-11 15:14 UTC (permalink / raw)
  To: Pierrick Bouvier, qemu-devel
  Cc: Paolo Bonzini, kvm, alex.bennee, Marcelo Tosatti,
	Maciej S. Szmigiero, richard.henderson, manos.pitsidianakis

On 11/3/25 16:05, Philippe Mathieu-Daudé wrote:
> On 7/3/25 22:56, Pierrick Bouvier wrote:
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> ---
>>   include/hw/hyperv/hyperv.h | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/hw/hyperv/hyperv.h b/include/hw/hyperv/hyperv.h
>> index d717b4e13d4..63a8b65278f 100644
>> --- a/include/hw/hyperv/hyperv.h
>> +++ b/include/hw/hyperv/hyperv.h
>> @@ -10,7 +10,8 @@
>>   #ifndef HW_HYPERV_HYPERV_H
>>   #define HW_HYPERV_HYPERV_H
>> -#include "cpu-qom.h"
>> +#include "exec/hwaddr.h"
>> +#include "hw/core/cpu.h"
> 
> I don't see where "hw/core/cpu.h" is used.

OK found it:

static inline uint32_t hyperv_vp_index(CPUState *cs)
{
     return cs->cpu_index;
}

First, bringing this huge header for this single use is way overkill,
then I doubt this method deserves to be inlined, third @cpu_index is
an accelerator specific field, often incorrectly used. Maybe in this
case it is OK although, since IIUC we only support HyperV with KVM,
right?


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
  2025-03-07 21:56 [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
                   ` (8 preceding siblings ...)
  2025-03-07 22:25 ` Philippe Mathieu-Daudé
@ 2025-03-20 19:00 ` Pierrick Bouvier
  9 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2025-03-20 19:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: philmd, Paolo Bonzini, kvm, alex.bennee, Marcelo Tosatti,
	Maciej S. Szmigiero, richard.henderson, manos.pitsidianakis

On 3/7/25 13:56, Pierrick Bouvier wrote:
> Work towards having a single binary, by removing duplicated object files.
> 
> hw/hyperv/hyperv.c was excluded at this time, because it depends on target
> dependent symbols:
> - from system/kvm.h
>      - kvm_check_extension
>      - kvm_vm_ioctl
> - from exec/cpu-all.h | memory_ldst_phys.h.inc
>      - ldq_phys
> 
> v2
> - remove osdep from header
> - use hardcoded buffer size for syndbg, assuming page size is always 4Kb.
> 
> v3
> - fix assert for page size.
> 
> v4
> - use KiB unit
> 
> Pierrick Bouvier (7):
>    hw/hyperv/hv-balloon-stub: common compilation unit
>    hw/hyperv/hyperv.h: header cleanup
>    hw/hyperv/vmbus: common compilation unit
>    hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386
>    hw/hyperv/syndbg: common compilation unit
>    hw/hyperv/balloon: common balloon compilation units
>    hw/hyperv/hyperv_testdev: common compilation unit
> 
>   include/hw/hyperv/hyperv-proto.h | 12 ++++++++
>   include/hw/hyperv/hyperv.h       |  3 +-
>   target/i386/kvm/hyperv-proto.h   | 12 --------
>   hw/hyperv/syndbg.c               | 11 +++++--
>   hw/hyperv/vmbus.c                | 50 ++++++++++++++++----------------
>   hw/hyperv/meson.build            |  9 +++---
>   6 files changed, 52 insertions(+), 45 deletions(-)
> 

I've been able to address comments and conver last compilation unit 
missing (hw/hyperv/hyperv.c).

However, another series is needed to make this compile.
Thus, I'll wait for this to be merged before sending the v5 here.


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2025-03-20 19:01 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07 21:56 [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
2025-03-07 21:56 ` [PATCH v4 1/7] hw/hyperv/hv-balloon-stub: common compilation unit Pierrick Bouvier
2025-03-07 21:56 ` [PATCH v4 2/7] hw/hyperv/hyperv.h: header cleanup Pierrick Bouvier
2025-03-11 15:05   ` Philippe Mathieu-Daudé
2025-03-11 15:14     ` Philippe Mathieu-Daudé
2025-03-07 21:56 ` [PATCH v4 3/7] hw/hyperv/vmbus: common compilation unit Pierrick Bouvier
2025-03-07 21:56 ` [PATCH v4 4/7] hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386 Pierrick Bouvier
2025-03-07 21:56 ` [PATCH v4 5/7] hw/hyperv/syndbg: common compilation unit Pierrick Bouvier
2025-03-07 21:56 ` [PATCH v4 6/7] hw/hyperv/balloon: common balloon compilation units Pierrick Bouvier
2025-03-07 21:56 ` [PATCH v4 7/7] hw/hyperv/hyperv_testdev: common compilation unit Pierrick Bouvier
2025-03-07 22:06 ` [PATCH v4 0/7] hw/hyperv: remove duplication compilation units Philippe Mathieu-Daudé
2025-03-07 22:38   ` Pierrick Bouvier
2025-03-07 22:25 ` Philippe Mathieu-Daudé
2025-03-07 22:31   ` Maciej S. Szmigiero
2025-03-07 22:37     ` Philippe Mathieu-Daudé
2025-03-09 23:33     ` Pierrick Bouvier
2025-03-10  0:14       ` Philippe Mathieu-Daudé
2025-03-10  2:10         ` Pierrick Bouvier
2025-03-10 12:28         ` Maciej S. Szmigiero
2025-03-10 12:28       ` Maciej S. Szmigiero
2025-03-20 19:00 ` Pierrick Bouvier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).