On 3/3/25 21:36, Phil Dennis-Jordan wrote:

On Mon, 3 Mar 2025 at 19:20, Philippe Mathieu-Daudé <phi...@linaro.org <mailto:phi...@linaro.org>> wrote:
    On 12/1/25 22:00, Phil Dennis-Jordan wrote:
     > From: Alexander Graf <g...@amazon.com <mailto:g...@amazon.com>>
     >
     > Apple defines a new "vmapple" machine type as part of its proprietary
     > macOS Virtualization.Framework vmm. This machine type is similar
    to the
     > virt one, but with subtle differences in base devices, a few special
     > vmapple device additions and a vastly different boot chain.
     >
     > This patch reimplements this machine type in QEMU. To use it, you
     > have to have a readily installed version of macOS for VMApple,
     > run on macOS with -accel hvf, pass the Virtualization.Framework
     > boot rom (AVPBooter) in via -bios, pass the aux and root volume
    as pflash
     > and pass aux and root volume as virtio drives. In addition, you also
     > need to find the machine UUID and pass that as -M vmapple,uuid=
    parameter:
     >
     > $ qemu-system-aarch64 -accel hvf -M vmapple,uuid=0x1234 -m 4G \
     >      -bios /System/Library/Frameworks/Virtualization.framework/
    Versions/A/Resources/AVPBooter.vmapple2.bin
     >      -drive file=aux,if=pflash,format=raw \
     >      -drive file=root,if=pflash,format=raw \
     >      -drive file=aux,if=none,id=aux,format=raw \
     >      -device vmapple-virtio-blk-pci,variant=aux,drive=aux \
     >      -drive file=root,if=none,id=root,format=raw \
     >      -device vmapple-virtio-blk-pci,variant=root,drive=root
     >
     > With all these in place, you should be able to see macOS booting
     > successfully.
     >
     > Known issues:
     >   - Currently only macOS 12 guests are supported. The boot
    process for
     >     13+ will need further investigation and adjustment.
     >
     > Signed-off-by: Alexander Graf <g...@amazon.com
    <mailto:g...@amazon.com>>
     > Co-authored-by: Phil Dennis-Jordan <p...@philjordan.eu
    <mailto:p...@philjordan.eu>>
     > Signed-off-by: Phil Dennis-Jordan <p...@philjordan.eu
    <mailto:p...@philjordan.eu>>
     > Reviewed-by: Akihiko Odaki <akihiko.od...@daynix.com
    <mailto:akihiko.od...@daynix.com>>
     > ---


     >   MAINTAINERS                 |   1 +
     >   contrib/vmapple/uuid.sh     |   9 +
     >   docs/system/arm/vmapple.rst |  63 ++++
     >   docs/system/target-arm.rst  |   1 +
     >   hw/vmapple/Kconfig          |  20 ++
     >   hw/vmapple/meson.build      |   1 +
     >   hw/vmapple/vmapple.c        | 618 +++++++++++++++++++++++++++++
    +++++++
     >   7 files changed, 713 insertions(+)
     >   create mode 100755 contrib/vmapple/uuid.sh
     >   create mode 100644 docs/system/arm/vmapple.rst
     >   create mode 100644 hw/vmapple/vmapple.c
     >
     > diff --git a/MAINTAINERS b/MAINTAINERS
     > index e220744abf..3a3d9e19f4 100644
     > --- a/MAINTAINERS
     > +++ b/MAINTAINERS
     > @@ -2791,6 +2791,7 @@ M: Phil Dennis-Jordan <p...@philjordan.eu
    <mailto:p...@philjordan.eu>>
     >   S: Maintained
     >   F: hw/vmapple/*
     >   F: include/hw/vmapple/*
     > +F: docs/system/arm/vmapple.rst
     >
     >   Subsystems
     >   ----------
     > diff --git a/contrib/vmapple/uuid.sh b/contrib/vmapple/uuid.sh
     > new file mode 100755
     > index 0000000000..956e8c3afe
     > --- /dev/null
     > +++ b/contrib/vmapple/uuid.sh
     > @@ -0,0 +1,9 @@
     > +#!/bin/sh
     > +# Used for converting a guest provisioned using
    Virtualization.framework
     > +# for use with the QEMU 'vmapple' aarch64 machine type.
     > +#
     > +# Extracts the Machine UUID from Virtualization.framework VM
    JSON file.
     > +# (as produced by 'macosvm', passed as command line argument)
     > +
     > +plutil -extract machineId raw "$1" | base64 -d | plutil -extract
    ECID raw -
     > +
     > diff --git a/docs/system/arm/vmapple.rst b/docs/system/arm/
    vmapple.rst
     > new file mode 100644
     > index 0000000000..5090a8997c
     > --- /dev/null
     > +++ b/docs/system/arm/vmapple.rst
     > @@ -0,0 +1,63 @@

    Alex, Phil, we now mandate a SPDX tag. Due to the license used in
    vmapple.c in this patch, are you OK with me squashing here:


Sorry about that, I forgot all about the SPDX tags in scripts and docs - yes, please add that SPDX on uuid.sh. The vmapple.rst is Alex's creation (I think I tweaked a few lines max) - but if that's the usual license we use for documentation as well then it seems a reasonable assumption to use GPL2+ there too if we don't hear from him.
TBH IDK and IANAL :) "GPL-2.0-or-later" is about *program*, is it
relevant for documentation? This is the single license used with SPDX
in docs/:

$ git grep SPDX docs
docs/system/devices/igb.rst:1:.. SPDX-License-Identifier: GPL-2.0-or-later
docs/system/devices/virtio-gpu.rst:2: SPDX-License-Identifier: GPL-2.0-or-later
Note we also use the FreeBSD-DOC in bitmaps.rst (not as SPDX tag):

docs/interop/bitmaps.rst:5: This file is licensed via The FreeBSD Documentation License, the full
Per commit 2b96c1a4931 ("scripts: validate SPDX license choices"):

+    my $prefer = "GPL-2.0-or-later";
+    my @valid = qw(
+       GPL-2.0-only
+       LGPL-2.1-only
+       LGPL-2.1-or-later
+       BSD-2-Clause
+       BSD-3-Clause
+       MIT
+       );

GPL: "program"
LGPL: "library"
BSD/MIT: "software"

In doubt I'll stick with $prefer except if someone has a better clue /
suggestion.

Thanks for the doc syntax fix as well.

    -- >8 --
    diff --git a/docs/system/arm/vmapple.rst b/docs/system/arm/vmapple.rst
    index 5090a8997c3..c5b1bcf45ea 100644
    --- a/docs/system/arm/vmapple.rst
    +++ b/docs/system/arm/vmapple.rst
    @@ -0,0 +1,2 @@
    +.. SPDX-License-Identifier: GPL-2.0-or-later
    +
    diff --git a/contrib/vmapple/uuid.sh b/contrib/vmapple/uuid.sh
    index 956e8c3afed..f5637221d23 100755
    --- a/contrib/vmapple/uuid.sh
    +++ b/contrib/vmapple/uuid.sh
    @@ -1,0 +2 @@
    +#
    @@ -6,0 +8,2 @@
    +#
    +# SPDX-License-Identifier: GPL-2.0-or-later
    ---

    ?

Reply via email to