mbox series

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

Message ID 20250307215623.524987-1-pierrick.bouvier@linaro.org (mailing list archive)
Headers show
Series hw/hyperv: remove duplication compilation units | expand

Message

Pierrick Bouvier March 7, 2025, 9:56 p.m. UTC
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(-)

Comments

Philippe Mathieu-Daudé March 7, 2025, 10:06 p.m. UTC | #1
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.
Philippe Mathieu-Daudé March 7, 2025, 10:25 p.m. UTC | #2
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.
Maciej S. Szmigiero March 7, 2025, 10:31 p.m. UTC | #3
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
Philippe Mathieu-Daudé March 7, 2025, 10:37 p.m. UTC | #4
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 :)
Pierrick Bouvier March 7, 2025, 10:38 p.m. UTC | #5
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.
>
Pierrick Bouvier March 9, 2025, 11:33 p.m. UTC | #6
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
>
Philippe Mathieu-Daudé March 10, 2025, 12:14 a.m. UTC | #7
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.
Pierrick Bouvier March 10, 2025, 2:10 a.m. UTC | #8
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.