[PATCH v4 0/7] hw/hyperv: remove duplication compilation units

Pierrick Bouvier posted 7 patches 3 weeks, 3 days ago
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(-)
[PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Pierrick Bouvier 3 weeks, 3 days ago
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
Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Pierrick Bouvier 1 week, 4 days ago
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.
Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Philippe Mathieu-Daudé 3 weeks, 3 days ago
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.
Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Maciej S. Szmigiero 3 weeks, 3 days ago
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


Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Pierrick Bouvier 3 weeks, 1 day ago
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
> 

Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Maciej S. Szmigiero 3 weeks ago
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



Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Philippe Mathieu-Daudé 3 weeks, 1 day ago
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.

Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Maciej S. Szmigiero 3 weeks ago
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


Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Pierrick Bouvier 3 weeks, 1 day ago
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.
Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Philippe Mathieu-Daudé 3 weeks, 3 days ago
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 :)

Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Philippe Mathieu-Daudé 3 weeks, 3 days ago
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.
Re: [PATCH v4 0/7] hw/hyperv: remove duplication compilation units
Posted by Pierrick Bouvier 3 weeks, 3 days ago
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.
>