qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] meson: Display summary of Darwin libraries detected
@ 2025-02-12 11:29 Philippe Mathieu-Daudé
  2025-02-17 14:02 ` Daniel P. Berrangé
  2025-02-17 18:37 ` Paolo Bonzini
  0 siblings, 2 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-02-12 11:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Philippe Mathieu-Daudé

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 meson.build | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meson.build b/meson.build
index 18cf9e2913b..10f4c9fd30d 100644
--- a/meson.build
+++ b/meson.build
@@ -4826,6 +4826,13 @@ summary_info += {'libdw':             libdw}
 if host_os == 'freebsd'
   summary_info += {'libinotify-kqueue': inotify}
 endif
+if host_os == 'darwin'
+  summary_info += {'Hypervisor support': hvf}
+  summary_info += {'CoreFoundation support': coref}
+  summary_info += {'IOKit support': iokit}
+  summary_info += {'ParavirtualizedGraphics support': pvg}
+  summary_info += {'Metal support': metal}
+endif
 summary(summary_info, bool_yn: true, section: 'Dependencies')
 
 if host_arch == 'unknown'
-- 
2.47.1



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

* Re: [PATCH] meson: Display summary of Darwin libraries detected
  2025-02-12 11:29 [PATCH] meson: Display summary of Darwin libraries detected Philippe Mathieu-Daudé
@ 2025-02-17 14:02 ` Daniel P. Berrangé
  2025-02-17 18:37 ` Paolo Bonzini
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel P. Berrangé @ 2025-02-17 14:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: qemu-devel, Paolo Bonzini

On Wed, Feb 12, 2025 at 12:29:58PM +0100, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  meson.build | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index 18cf9e2913b..10f4c9fd30d 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -4826,6 +4826,13 @@ summary_info += {'libdw':             libdw}
>  if host_os == 'freebsd'
>    summary_info += {'libinotify-kqueue': inotify}
>  endif
> +if host_os == 'darwin'
> +  summary_info += {'Hypervisor support': hvf}
> +  summary_info += {'CoreFoundation support': coref}
> +  summary_info += {'IOKit support': iokit}
> +  summary_info += {'ParavirtualizedGraphics support': pvg}
> +  summary_info += {'Metal support': metal}

These last 4 make sense, but I believe we already report HVF earlier
in the accelerators block:

  summary_info += {'KVM support':       config_all_accel.has_key('CONFIG_KVM')}
  summary_info += {'HVF support':       config_all_accel.has_key('CONFIG_HVF')}
  summary_info += {'WHPX support':      config_all_accel.has_key('CONFIG_WHPX')}
  summary_info += {'NVMM support':      config_all_accel.has_key('CONFIG_NVMM')}
  summary_info += {'Xen support':       xen.found()}

IIUC CONFIG_HVF is present if 'hvf.found()'



With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: [PATCH] meson: Display summary of Darwin libraries detected
  2025-02-12 11:29 [PATCH] meson: Display summary of Darwin libraries detected Philippe Mathieu-Daudé
  2025-02-17 14:02 ` Daniel P. Berrangé
@ 2025-02-17 18:37 ` Paolo Bonzini
  2025-02-18 14:55   ` Phil Dennis-Jordan
  1 sibling, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2025-02-17 18:37 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel, Phil Dennis-Jordan

On 2/12/25 12:29, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   meson.build | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index 18cf9e2913b..10f4c9fd30d 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -4826,6 +4826,13 @@ summary_info += {'libdw':             libdw}
>   if host_os == 'freebsd'
>     summary_info += {'libinotify-kqueue': inotify}
>   endif
> +if host_os == 'darwin'
> +  summary_info += {'Hypervisor support': hvf}
> +  summary_info += {'CoreFoundation support': coref}
> +  summary_info += {'IOKit support': iokit}
> +  summary_info += {'ParavirtualizedGraphics support': pvg}
> +  summary_info += {'Metal support': metal}
> +endif
I think all of these are going to be present anyway, because they're 
mandatory (except IOKit which _is_ going to be there, and HVF which is 
present elsewhere) and there's no version indication for Apple frameworks.

However, adding pvg and metal here makes sense if:

- "config PVG" is added to Kconfig.host with the corresponding 
assignment to host_kconfig

- "depends on PVG" is added to "config MAC_PVG"

- after which, host_os = "darwin" is not needed anymore in 
hw/display/meson.build

Also, it's not clear to me if PVG can also work with TCG, and therefore 
the MMIO version can be used on x86 Macs?  If so the 'if cpu = 
"aarch64"' in hw/display/meson.build seems wrong.

Either way, the Kconfig file does not need "depends on AARCH64" and it 
should have just

     depends on MAC_PVG

with an "imply" somewhere in hw/arm/Kconfig.

Paolo



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

* Re: [PATCH] meson: Display summary of Darwin libraries detected
  2025-02-17 18:37 ` Paolo Bonzini
@ 2025-02-18 14:55   ` Phil Dennis-Jordan
  2025-02-19 10:28     ` Paolo Bonzini
  0 siblings, 1 reply; 8+ messages in thread
From: Phil Dennis-Jordan @ 2025-02-18 14:55 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Philippe Mathieu-Daudé, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 3009 bytes --]

On Mon, 17 Feb 2025 at 19:37, Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 2/12/25 12:29, Philippe Mathieu-Daudé wrote:
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > ---
> >   meson.build | 7 +++++++
> >   1 file changed, 7 insertions(+)
> >
> > diff --git a/meson.build b/meson.build
> > index 18cf9e2913b..10f4c9fd30d 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -4826,6 +4826,13 @@ summary_info += {'libdw':             libdw}
> >   if host_os == 'freebsd'
> >     summary_info += {'libinotify-kqueue': inotify}
> >   endif
> > +if host_os == 'darwin'
> > +  summary_info += {'Hypervisor support': hvf}
> > +  summary_info += {'CoreFoundation support': coref}
> > +  summary_info += {'IOKit support': iokit}
> > +  summary_info += {'ParavirtualizedGraphics support': pvg}
> > +  summary_info += {'Metal support': metal}
> > +endif
> I think all of these are going to be present anyway, because they're
> mandatory (except IOKit which _is_ going to be there, and HVF which is
> present elsewhere) and there's no version indication for Apple frameworks.


Realistically, all of these are always present on supported Darwin versions.


> However, adding pvg and metal here makes sense if:
>
> - "config PVG" is added to Kconfig.host with the corresponding
> assignment to host_kconfig
>
> - "depends on PVG" is added to "config MAC_PVG"
>
> - after which, host_os = "darwin" is not needed anymore in
> hw/display/meson.build
>
> Also, it's not clear to me if PVG can also work with TCG, and therefore
> the MMIO version can be used on x86 Macs?  If so the 'if cpu =
> "aarch64"' in hw/display/meson.build seems wrong.


This bit I can answer.
PVG is not in any way tied to HVF and so can be used with TCG.
HOWEVER
It is not cross-architecture. So, the PVG guest drivers with x86-64 macOS
don't give useful results with the aarch64 macOS host PVG framework. (I
suspect a mismatch in texture memory layout and perhaps some other data
format issues - Apple's GPUs use a "swizzled" memory layout, whereas
Intel/AMD/NVIDIA's do not.)

Additionally, the MMIO variant in particular uses the IOSurfaceMapper APIs
(PGIOSurfaceHostDevice, PGIOSurfaceHostDeviceDescriptor,
usingIOSurfaceMapper) which are only present in the aarch64 version of the
host ParavirtualizedGraphics.framework.

In summary, hw/display/apple-gfx-mmio.m has a hard dependency on aarch64
*host* systems, and both apple-gfx device variants only make sense when
host arch matches guest arch. (Unless you're a developer attempting to find
a workaround to the incompatibility.)

I'm very much not a Meson expert, so this was my best attempt at encoding
these facts in the build system. (And nobody suggested anything better
during review.)


> Either way, the Kconfig file does not need "depends on AARCH64" and it
> should have just
>
>      depends on MAC_PVG
>
> with an "imply" somewhere in hw/arm/Kconfig.
>
> Paolo
>
>
Phil

[-- Attachment #2: Type: text/html, Size: 4211 bytes --]

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

* Re: [PATCH] meson: Display summary of Darwin libraries detected
  2025-02-18 14:55   ` Phil Dennis-Jordan
@ 2025-02-19 10:28     ` Paolo Bonzini
  2025-02-19 10:36       ` Phil Dennis-Jordan
  0 siblings, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2025-02-19 10:28 UTC (permalink / raw)
  To: Phil Dennis-Jordan; +Cc: Philippe Mathieu-Daudé, qemu-devel

On Tue, Feb 18, 2025 at 3:55 PM Phil Dennis-Jordan <phil@philjordan.eu> wrote:
> It is not cross-architecture. So, the PVG guest drivers with x86-64 macOS don't
> give useful results with the aarch64 macOS host PVG framework. (I suspect a
> mismatch in texture memory layout and perhaps some other data format issues
> Apple's GPUs use a "swizzled" memory layout, whereas Intel/AMD/NVIDIA's do not.)

Thanks, that helps.

> In summary, hw/display/apple-gfx-mmio.m has a hard dependency on aarch64 *host*
> systems, and both apple-gfx device variants only make sense when host arch matches
> guest arch. (Unless you're a developer attempting to find a workaround to the
> incompatibility.)  I'm very much not a Meson expert, so this was my best attempt at
> encoding these facts in the build system. (And nobody suggested anything better during
> review.)

I'll find a way to do that, thanks. I also would prefer to add
--enable/--disable-pvg; I
can take care of that, but I just need to know...

>> Either way, the Kconfig file does not need "depends on AARCH64" and it
>> should have just
>>
>>      depends on MAC_PVG
>>
>> with an "imply" somewhere in hw/arm/Kconfig.

... which boards should enable MAC_PVG_MMIO? Is it only VIRT, or something
else?

Paolo



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

* Re: [PATCH] meson: Display summary of Darwin libraries detected
  2025-02-19 10:28     ` Paolo Bonzini
@ 2025-02-19 10:36       ` Phil Dennis-Jordan
  2025-02-19 10:38         ` Paolo Bonzini
  0 siblings, 1 reply; 8+ messages in thread
From: Phil Dennis-Jordan @ 2025-02-19 10:36 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Philippe Mathieu-Daudé, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2180 bytes --]

On Wed, 19 Feb 2025 at 11:28, Paolo Bonzini <pbonzini@redhat.com> wrote:

> On Tue, Feb 18, 2025 at 3:55 PM Phil Dennis-Jordan <phil@philjordan.eu>
> wrote:
> > It is not cross-architecture. So, the PVG guest drivers with x86-64
> macOS don't
> > give useful results with the aarch64 macOS host PVG framework. (I
> suspect a
> > mismatch in texture memory layout and perhaps some other data format
> issues
> > Apple's GPUs use a "swizzled" memory layout, whereas Intel/AMD/NVIDIA's
> do not.)
>
> Thanks, that helps.
>
> > In summary, hw/display/apple-gfx-mmio.m has a hard dependency on aarch64
> *host*
> > systems, and both apple-gfx device variants only make sense when host
> arch matches
> > guest arch. (Unless you're a developer attempting to find a workaround
> to the
> > incompatibility.)  I'm very much not a Meson expert, so this was my best
> attempt at
> > encoding these facts in the build system. (And nobody suggested anything
> better during
> > review.)
>
> I'll find a way to do that, thanks. I also would prefer to add
> --enable/--disable-pvg; I
> can take care of that, but I just need to know...


>> Either way, the Kconfig file does not need "depends on AARCH64" and it
> >> should have just
> >>
> >>      depends on MAC_PVG
> >>
> >> with an "imply" somewhere in hw/arm/Kconfig.
>
> ... which boards should enable MAC_PVG_MMIO? Is it only VIRT, or something
> else?


I doubt anyone will be able to use it productively with virt, but I am
regularly surprised by people's creativity.

The intended target machine is vmapple, which is the only known way to run
aarch64 macOS guests. The PVG patches were part of that series, the PCI
variant is useful independently of it though; Philippe said at one point
early Jan/late Dec he was going to merge the rest of the patch series
containing that machine type, but there were some question marks about the
software GICv3 dependency and HVF I believe. I'll try to rebase that series
and re-post it in the next few days - I've been too busy with another
project to stay on top of chasing that down, but I'd really like to get it
done for 10.0.

Phil

[-- Attachment #2: Type: text/html, Size: 2922 bytes --]

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

* Re: [PATCH] meson: Display summary of Darwin libraries detected
  2025-02-19 10:36       ` Phil Dennis-Jordan
@ 2025-02-19 10:38         ` Paolo Bonzini
  2025-02-19 13:41           ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2025-02-19 10:38 UTC (permalink / raw)
  To: Phil Dennis-Jordan; +Cc: Philippe Mathieu-Daudé, qemu-devel

On Wed, Feb 19, 2025 at 11:36 AM Phil Dennis-Jordan <phil@philjordan.eu> wrote:
>> ... which boards should enable MAC_PVG_MMIO? Is it only VIRT, or something
>> else?
>
> I doubt anyone will be able to use it productively with virt, but I am regularly surprised by people's creativity.

Ah okay, so for now it's effectively dead code.

> The intended target machine is vmapple, which is the only known way
> to run aarch64 macOS guests. [...]
> I'll try to rebase that series and re-post it in the next few days

Thanks, I'll keep an eye on that.

Paolo



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

* Re: [PATCH] meson: Display summary of Darwin libraries detected
  2025-02-19 10:38         ` Paolo Bonzini
@ 2025-02-19 13:41           ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-02-19 13:41 UTC (permalink / raw)
  To: Paolo Bonzini, Phil Dennis-Jordan; +Cc: qemu-devel, qemu-arm

On 19/2/25 11:38, Paolo Bonzini wrote:
> On Wed, Feb 19, 2025 at 11:36 AM Phil Dennis-Jordan <phil@philjordan.eu> wrote:
>>> ... which boards should enable MAC_PVG_MMIO? Is it only VIRT, or something
>>> else?
>>
>> I doubt anyone will be able to use it productively with virt, but I am regularly surprised by people's creativity.
> 
> Ah okay, so for now it's effectively dead code.

Correct (still tested before merging). I have Phil's vmapple series
queued but it fails the '--disable-hvf' build config so I had to drop
it before sending the PR. I kept the PVG device to save Phil from
respining again and again the same patches, hoping for a quick fix
to merge the rest, waiting for an update on whether Phil's suggestion
to fix the GIC dependency was OK or not, but no update so far, see:

https://lore.kernel.org/qemu-devel/CAAibmn0puNwDvHcU8xYi1EJ=dnAEhasoTKCk0kmF4DiQfR7dHQ@mail.gmail.com/

and my proposal:

https://lore.kernel.org/qemu-devel/20241227202435.48055-1-philmd@linaro.org/

And now I see Phil's reply which I missed ...:
https://lore.kernel.org/qemu-devel/CAAibmn1g6+btdRX99ZUvbaBm7hP_AnAGNfDHz4Wgi3fPn=waOw@mail.gmail.com/

> 
>> The intended target machine is vmapple, which is the only known way
>> to run aarch64 macOS guests. [...]
>> I'll try to rebase that series and re-post it in the next few days
> 
> Thanks, I'll keep an eye on that.
> 
> Paolo
> 



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

end of thread, other threads:[~2025-02-19 13:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12 11:29 [PATCH] meson: Display summary of Darwin libraries detected Philippe Mathieu-Daudé
2025-02-17 14:02 ` Daniel P. Berrangé
2025-02-17 18:37 ` Paolo Bonzini
2025-02-18 14:55   ` Phil Dennis-Jordan
2025-02-19 10:28     ` Paolo Bonzini
2025-02-19 10:36       ` Phil Dennis-Jordan
2025-02-19 10:38         ` Paolo Bonzini
2025-02-19 13:41           ` Philippe Mathieu-Daudé

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).