[PATCH v7 14/15] hw/block/virtio-blk: Replaces request free function with g_free

2024-11-05 Thread Phil Dennis-Jordan
The virtio_blk_free_request() function has been a 1-liner forwarding to g_free() for a while now. We may as well call g_free on the request pointer directly. Signed-off-by: Phil Dennis-Jordan Reviewed-by: Akihiko Odaki --- hw/block/virtio-blk.c | 43 +++---

[PATCH v7 06/15] hw: Add vmapple subdir

2024-11-05 Thread Phil Dennis-Jordan
From: Alexander Graf We will introduce a number of devices that are specific to the vmapple target machine. To keep them all tidily together, let's put them into a single target directory. Signed-off-by: Alexander Graf Signed-off-by: Phil Dennis-Jordan Reviewed-by: Akihiko Odaki --- MAINTAIN

[PATCH v7 07/15] hw/misc/pvpanic: Add MMIO interface

2024-11-05 Thread Phil Dennis-Jordan
From: Alexander Graf In addition to the ISA and PCI variants of pvpanic, let's add an MMIO platform device that we can use in embedded arm environments. Signed-off-by: Alexander Graf Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Phil Dennis-Jordan Revie

[PATCH v7 11/15] hw/vmapple/bdif: Introduce vmapple backdoor interface

2024-11-05 Thread Phil Dennis-Jordan
From: Alexander Graf The VMApple machine exposes AUX and ROOT block devices (as well as USB OTG emulation) via virtio-pci as well as a special, simple backdoor platform device. This patch implements this backdoor platform device to the best of my understanding. I left out any USB OTG parts; they

[PATCH v7 12/15] hw/vmapple/cfg: Introduce vmapple cfg region

2024-11-05 Thread Phil Dennis-Jordan
From: Alexander Graf Instead of device tree or other more standardized means, VMApple passes platform configuration to the first stage boot loader in a binary encoded format that resides at a dedicated RAM region in physical address space. This patch models this configuration space as a qdev dev

[PATCH v7 01/15] ui & main loop: Redesign of system-specific main thread event handling

2024-11-05 Thread Phil Dennis-Jordan
macOS's Cocoa event handling must be done on the initial (main) thread of the process. Furthermore, if library or application code uses libdispatch, the main dispatch queue must be handling events on the main thread as well. So far, this has affected Qemu in both the Cocoa and SDL UIs, although in

[PATCH v7 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-05 Thread Phil Dennis-Jordan
MacOS provides a framework (library) that allows any vmm to implement a paravirtualized 3d graphics passthrough to the host metal stack called ParavirtualizedGraphics.Framework (PVG). The library abstracts away almost every aspect of the paravirtualized device model and only provides and receives c

[PATCH v7 15/15] hw/vmapple/vmapple: Add vmapple machine type

2024-11-05 Thread Phil Dennis-Jordan
From: Alexander Graf 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 v7 10/15] hw/vmapple/aes: Introduce aes engine

2024-11-05 Thread Phil Dennis-Jordan
From: Alexander Graf VMApple contains an "aes" engine device that it uses to encrypt and decrypt its nvram. It has trivial hard coded keys it uses for that purpose. Add device emulation for this device model. Signed-off-by: Alexander Graf Signed-off-by: Phil Dennis-Jordan --- v3: * Rebased

[PATCH v7 13/15] hw/vmapple/virtio-blk: Add support for apple virtio-blk

2024-11-05 Thread Phil Dennis-Jordan
From: Alexander Graf Apple has its own virtio-blk PCI device ID where it deviates from the official virtio-pci spec slightly: It puts a new "apple type" field at a static offset in config space and introduces a new barrier command. This patch first creates a mechanism for virtio-blk downstream c

[PATCH v7 09/15] gpex: Allow more than 4 legacy IRQs

2024-11-05 Thread Phil Dennis-Jordan
From: Alexander Graf Some boards such as vmapple don't do real legacy PCI IRQ swizzling. Instead, they just keep allocating more board IRQ lines for each new legacy IRQ. Let's support that mode by giving instantiators a new "nr_irqs" property they can use to support more than 4 legacy IRQ lines.

[PATCH v7 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-05 Thread Phil Dennis-Jordan
This change wires up the PCI variant of the paravirtualised graphics device, mainly useful for x86-64 macOS guests, implemented by macOS's ParavirtualizedGraphics.framework. It builds on code shared with the vmapple/mmio variant of the PVG device. Signed-off-by: Phil Dennis-Jordan --- v4: * Th

[PATCH v7 05/15] MAINTAINERS: Add myself as maintainer for apple-gfx, reviewer for HVF

2024-11-05 Thread Phil Dennis-Jordan
I'm happy to take responsibility for the macOS PV graphics code. As HVF patches don't seem to get much attention at the moment, I'm also adding myself as designated reviewer for HVF and x86 HVF to try and improve that. I anticipate that the resulting workload should be covered by the funding I'm r

[PATCH v7 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-05 Thread Phil Dennis-Jordan
This change adds a property 'display_modes' on the graphics device which permits specifying a list of display modes. (screen resolution and refresh rate) The property is an array of a custom type to make the syntax slightly less awkward to use, for example: -device '{"driver":"apple-gfx-pci", "di

[PATCH v7 00/15] macOS PV Graphics and new vmapple machine type

2024-11-05 Thread Phil Dennis-Jordan
This patch set introduces a new ARM and macOS HVF specific machine type called "vmapple", as well as a family of display devices based on the ParavirtualizedGraphics.framework in macOS. One of the display adapter variants, apple-gfx-mmio, is required for the new machine type, while apple-gfx-pci ca

Re: [PATCH v6 12/15] hw/vmapple/cfg: Introduce vmapple cfg region

2024-11-05 Thread Akihiko Odaki
On 2024/11/04 0:00, Phil Dennis-Jordan wrote: From: Alexander Graf Instead of device tree or other more standardized means, VMApple passes platform configuration to the first stage boot loader in a binary encoded format that resides at a dedicated RAM region in physical address space. This pat

Re: [PATCH v6 13/15] hw/vmapple/virtio-blk: Add support for apple virtio-blk

2024-11-05 Thread Akihiko Odaki
On 2024/11/04 0:00, Phil Dennis-Jordan wrote: From: Alexander Graf Apple has its own virtio-blk PCI device ID where it deviates from the official virtio-pci spec slightly: It puts a new "apple type" field at a static offset in config space and introduces a new barrier command. This patch first

Re: [PATCH v6 15/15] hw/vmapple/vmapple: Add vmapple machine type

2024-11-05 Thread Akihiko Odaki
On 2024/11/04 0:00, Phil Dennis-Jordan wrote: From: Alexander Graf 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 ad

Re: [PATCH v6 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-05 Thread Akihiko Odaki
On 2024/11/04 0:00, Phil Dennis-Jordan wrote: This change adds a property 'display_modes' on the graphics device which permits specifying a list of display modes. (screen resolution and refresh rate) The property is an array of a custom type to make the syntax slightly less awkward to use, for e

Re: [PATCH v6 10/15] hw/vmapple/aes: Introduce aes engine

2024-11-05 Thread Akihiko Odaki
On 2024/11/04 0:00, Phil Dennis-Jordan wrote: From: Alexander Graf VMApple contains an "aes" engine device that it uses to encrypt and decrypt its nvram. It has trivial hard coded keys it uses for that purpose. Add device emulation for this device model. Signed-off-by: Alexander Graf Signed-

Re: [PATCH v6 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-05 Thread Phil Dennis-Jordan
On Tue, 5 Nov 2024 at 09:22, Akihiko Odaki wrote: > On 2024/11/04 0:00, Phil Dennis-Jordan wrote: > > MacOS provides a framework (library) that allows any vmm to implement a > > paravirtualized 3d graphics passthrough to the host metal stack called > > ParavirtualizedGraphics.Framework (PVG). The

[PATCH v7 08/15] hvf: arm: Ignore writes to CNTP_CTL_EL0

2024-11-05 Thread Phil Dennis-Jordan
From: Alexander Graf MacOS unconditionally disables interrupts of the physical timer on boot and then continues to use the virtual one. We don't really want to support a full physical timer emulation, so let's just ignore those writes. Signed-off-by: Alexander Graf Signed-off-by: Phil Dennis-Jo

Re: [PATCH] hw/sd/sdcard: Fix calculation of size when using eMMC boot partitions

2024-11-05 Thread Cédric Le Goater
On 11/5/24 17:13, Michael Tokarev wrote: 28.10.2024 19:23, Jan Luebbe wrote: The sd_bootpart_offset() function calculates the *runtime* offset which changes as the guest switches between accessing the main user data area and the boot partitions by writing to the EXT_CSD_PART_CONFIG_ACC_MASK bits

Re: [PATCH] hw/sd/sdcard: Fix calculation of size when using eMMC boot partitions

2024-11-05 Thread Michael Tokarev
28.10.2024 19:23, Jan Luebbe wrote: The sd_bootpart_offset() function calculates the *runtime* offset which changes as the guest switches between accessing the main user data area and the boot partitions by writing to the EXT_CSD_PART_CONFIG_ACC_MASK bits, so it shouldn't be used to calculate the

Re: [PATCH v4 05/15] MAINTAINERS: Add myself as maintainer for apple-gfx, reviewer for HVF

2024-11-05 Thread Roman Bolshakov
On Thu, Oct 24, 2024 at 12:28:03PM +0200, Phil Dennis-Jordan wrote: > I'm happy to take responsibility for the macOS PV graphics code. As > HVF patches don't seem to get much attention at the moment, I'm also > adding myself as designated reviewer for HVF and x86 HVF to try and > improve that. > >

Re: [PATCH v6 01/15] ui & main loop: Redesign of system-specific main thread event handling

2024-11-05 Thread Akihiko Odaki
On 2024/11/04 0:00, Phil Dennis-Jordan wrote: macOS's Cocoa event handling must be done on the initial (main) thread of the process. Furthermore, if library or application code uses libdispatch, the main dispatch queue must be handling events on the main thread as well. So far, this has affected

Re: [PATCH v6 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-05 Thread Akihiko Odaki
On 2024/11/04 0:00, Phil Dennis-Jordan wrote: MacOS provides a framework (library) that allows any vmm to implement a paravirtualized 3d graphics passthrough to the host metal stack called ParavirtualizedGraphics.Framework (PVG). The library abstracts away almost every aspect of the paravirtualiz

Re: [PATCH v6 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-05 Thread Akihiko Odaki
On 2024/11/04 0:00, Phil Dennis-Jordan wrote: This change wires up the PCI variant of the paravirtualised graphics device, mainly useful for x86-64 macOS guests, implemented by macOS's ParavirtualizedGraphics.framework. It builds on code shared with the vmapple/mmio variant of the PVG device. Si

Re: [PULL 23/65] qapi: introduce device-sync-config

2024-11-05 Thread Daniel P . Berrangé
On Mon, Nov 04, 2024 at 04:07:00PM -0500, Michael S. Tsirkin wrote: > From: Vladimir Sementsov-Ogievskiy > > Add command to sync config from vhost-user backend to the device. It > may be helpful when VHOST_USER_SLAVE_CONFIG_CHANGE_MSG failed or not > triggered interrupt to the guest or just not a

Re: [PATCH 05/27] qemu-img: create: refresh options/--help

2024-11-05 Thread Kevin Wolf
Am 27.09.2024 um 08:10 hat Michael Tokarev geschrieben: > Create helper function cmd_help() to display command-specific > help text, and use it to print --help for 'create' subcommand. > > Add missing long options (eg --format) in img_create(). > > Remove usage of missing_argument()/unrecognized_

Re: [PATCH 04/27] qemu-img: pass current cmd info into command handlers

2024-11-05 Thread Kevin Wolf
Am 27.09.2024 um 08:10 hat Michael Tokarev geschrieben: > This info will be used to generate --help output. > > Signed-off-by: Michael Tokarev > Reviewed-by: Daniel P. Berrangé Reviewed-by: Kevin Wolf

Re: [PATCH 02/27] qemu-img: create: convert img_size to signed, simplify handling

2024-11-05 Thread Kevin Wolf
Am 27.09.2024 um 08:10 hat Michael Tokarev geschrieben: > Initializing an unsigned as -1, or using temporary > sval for conversion is awkward. Since we don't allow > other "negative" values anyway, use signed value and > pass it to bdrv_img_create() (where it is properly > converted to unsigned),

Re: [PATCH 01/27] qemu-img: measure: convert img_size to signed, simplify handling

2024-11-05 Thread Kevin Wolf
Am 27.09.2024 um 08:10 hat Michael Tokarev geschrieben: > qemu_opt_set_number() expects signed int64_t. > > Use int64_t instead of uint64_t for img_size, use -1 as "unset" > value instead of UINT64_MAX, and do not require temporary sval > for conversion from string. > > Signed-off-by: Michael Tok

Re: [PATCH 03/27] qemu-img: global option processing and error printing

2024-11-05 Thread Kevin Wolf
Am 27.09.2024 um 08:10 hat Michael Tokarev geschrieben: > In order to correctly print executable name in various > error messages, pass argv[0] to error_exit() function. > This way, error messages will refer to actual executable > name, which may be different from 'qemu-img'. > > For subcommands,

Re: [PATCH v4 00/26] E500 Cleanup

2024-11-05 Thread Philippe Mathieu-Daudé
Hi Bernhard, On 3/11/24 14:33, Bernhard Beschow wrote: This series is part of a bigger series exploring data-driven machine creation using device tree blobs on top of the e500 machines [1]. It contains patches to make this exploration easier which are also expected to provide value in themselves

Re: [PATCH v7 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-05 Thread Akihiko Odaki
On 2024/11/06 0:30, Phil Dennis-Jordan wrote: This change adds a property 'display_modes' on the graphics device which permits specifying a list of display modes. (screen resolution and refresh rate) The property is an array of a custom type to make the syntax slightly less awkward to use, for e

Re: [PATCH v7 12/15] hw/vmapple/cfg: Introduce vmapple cfg region

2024-11-05 Thread Akihiko Odaki
On 2024/11/06 0:30, Phil Dennis-Jordan wrote: From: Alexander Graf Instead of device tree or other more standardized means, VMApple passes platform configuration to the first stage boot loader in a binary encoded format that resides at a dedicated RAM region in physical address space. This pat

Re: [PATCH v7 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-05 Thread Akihiko Odaki
On 2024/11/06 0:30, Phil Dennis-Jordan wrote: MacOS provides a framework (library) that allows any vmm to implement a paravirtualized 3d graphics passthrough to the host metal stack called ParavirtualizedGraphics.Framework (PVG). The library abstracts away almost every aspect of the paravirtualiz

Re: [PATCH v7 11/15] hw/vmapple/bdif: Introduce vmapple backdoor interface

2024-11-05 Thread Akihiko Odaki
On 2024/11/06 0:30, Phil Dennis-Jordan wrote: From: Alexander Graf The VMApple machine exposes AUX and ROOT block devices (as well as USB OTG emulation) via virtio-pci as well as a special, simple backdoor platform device. This patch implements this backdoor platform device to the best of my u

Re: [PATCH v6 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-11-05 Thread Akihiko Odaki
On 2024/11/05 23:24, Phil Dennis-Jordan wrote: On Tue, 5 Nov 2024 at 09:22, Akihiko Odaki > wrote: On 2024/11/04 0:00, Phil Dennis-Jordan wrote: > MacOS provides a framework (library) that allows any vmm to implement a > paravirtualized 3d gr

Re: [PULL 23/65] qapi: introduce device-sync-config

2024-11-05 Thread Michael S. Tsirkin
On Tue, Nov 05, 2024 at 09:10:07AM +, Daniel P. Berrangé wrote: > On Mon, Nov 04, 2024 at 04:07:00PM -0500, Michael S. Tsirkin wrote: > > From: Vladimir Sementsov-Ogievskiy > > > > Add command to sync config from vhost-user backend to the device. It > > may be helpful when VHOST_USER_SLAVE_CO

Re: [PATCH v7 10/15] hw/vmapple/aes: Introduce aes engine

2024-11-05 Thread Akihiko Odaki
On 2024/11/06 0:30, Phil Dennis-Jordan wrote: From: Alexander Graf VMApple contains an "aes" engine device that it uses to encrypt and decrypt its nvram. It has trivial hard coded keys it uses for that purpose. Add device emulation for this device model. Signed-off-by: Alexander Graf Signed-

Re: [PATCH v7 15/15] hw/vmapple/vmapple: Add vmapple machine type

2024-11-05 Thread Akihiko Odaki
On 2024/11/06 0:30, Phil Dennis-Jordan wrote: From: Alexander Graf 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 ad