mbox series

[v3,0/3] nubus: add nubus-virtio-mmio device

Message ID 20240111102954.449462-1-mark.cave-ayland@ilande.co.uk
Headers show
Series nubus: add nubus-virtio-mmio device | expand

Message

Mark Cave-Ayland Jan. 11, 2024, 10:29 a.m. UTC
This series introduces a new nubus-virtio-mmio device which can be plugged into
the q800 machine to enable a 68k Classic MacOS guest to access virtio devices
such as virtio-9p-device (host filesharing), virtio-gpu (extended framebuffer
support) and virtio-tablet-device (absolute positioning).

Once the nubus-virtio-mmio device has been plugged into the q800 machine, virtio
devices can be accessed by a Classic MacOS guest using the drivers from the
classicvirtio project at https://github.com/elliotnunn/classicvirtio.

The nubus-virtio-mmio device is purposefully designed to be similar to the
virtio-mmio interface used by the existing 68k virt machine, making use of a
similar memory layout and the goldfish PIC for simple interrupt management. The
main difference is that only a single goldfish PIC is used, however that still
allows up to 32 virtio devices to be connected using a single nubus card.

Patch 1 fixes an alignment bug in the existing nubus-device Declaration ROM code
whereby some ROM images could trigger an assert() in QEMU, patch 2 increases the
maximum Declaration ROM size (to aid development), whilst patch 3 adds the
nubus-virtio-mmio device itself.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

[Patches still needing review: 2, 3]

v3:
- Rebase onto master
- Update patch 1 alignment calculation to use intermediatery uint8_t rom_ptr
  variable, add Phil's R-B tag
- Add patch 2 to increase maximum Declaration ROM size to 1MB

v2:
- Rebase onto master
- Adjust comment in patch 1 as suggested by Phil


Mark Cave-Ayland (3):
  nubus-device: round Declaration ROM memory region address to
    qemu_target_page_size()
  nubus.h: increase maximum Declaration ROM size from 128k to 1Mb
  nubus: add nubus-virtio-mmio device

 hw/nubus/meson.build                 |   1 +
 hw/nubus/nubus-device.c              |  18 +++--
 hw/nubus/nubus-virtio-mmio.c         | 102 +++++++++++++++++++++++++++
 include/hw/nubus/nubus-virtio-mmio.h |  36 ++++++++++
 include/hw/nubus/nubus.h             |   2 +-
 5 files changed, 154 insertions(+), 5 deletions(-)
 create mode 100644 hw/nubus/nubus-virtio-mmio.c
 create mode 100644 include/hw/nubus/nubus-virtio-mmio.h

Comments

Mark Cave-Ayland Jan. 21, 2024, 12:29 p.m. UTC | #1
On 11/01/2024 10:29, Mark Cave-Ayland wrote:

> This series introduces a new nubus-virtio-mmio device which can be plugged into
> the q800 machine to enable a 68k Classic MacOS guest to access virtio devices
> such as virtio-9p-device (host filesharing), virtio-gpu (extended framebuffer
> support) and virtio-tablet-device (absolute positioning).
> 
> Once the nubus-virtio-mmio device has been plugged into the q800 machine, virtio
> devices can be accessed by a Classic MacOS guest using the drivers from the
> classicvirtio project at https://github.com/elliotnunn/classicvirtio.
> 
> The nubus-virtio-mmio device is purposefully designed to be similar to the
> virtio-mmio interface used by the existing 68k virt machine, making use of a
> similar memory layout and the goldfish PIC for simple interrupt management. The
> main difference is that only a single goldfish PIC is used, however that still
> allows up to 32 virtio devices to be connected using a single nubus card.
> 
> Patch 1 fixes an alignment bug in the existing nubus-device Declaration ROM code
> whereby some ROM images could trigger an assert() in QEMU, patch 2 increases the
> maximum Declaration ROM size (to aid development), whilst patch 3 adds the
> nubus-virtio-mmio device itself.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> [Patches still needing review: 2, 3]
> 
> v3:
> - Rebase onto master
> - Update patch 1 alignment calculation to use intermediatery uint8_t rom_ptr
>    variable, add Phil's R-B tag
> - Add patch 2 to increase maximum Declaration ROM size to 1MB
> 
> v2:
> - Rebase onto master
> - Adjust comment in patch 1 as suggested by Phil
> 
> 
> Mark Cave-Ayland (3):
>    nubus-device: round Declaration ROM memory region address to
>      qemu_target_page_size()
>    nubus.h: increase maximum Declaration ROM size from 128k to 1Mb
>    nubus: add nubus-virtio-mmio device
> 
>   hw/nubus/meson.build                 |   1 +
>   hw/nubus/nubus-device.c              |  18 +++--
>   hw/nubus/nubus-virtio-mmio.c         | 102 +++++++++++++++++++++++++++
>   include/hw/nubus/nubus-virtio-mmio.h |  36 ++++++++++
>   include/hw/nubus/nubus.h             |   2 +-
>   5 files changed, 154 insertions(+), 5 deletions(-)
>   create mode 100644 hw/nubus/nubus-virtio-mmio.c
>   create mode 100644 include/hw/nubus/nubus-virtio-mmio.h

Ping?


ATB,

Mark.
Laurent Vivier Feb. 23, 2024, 2:47 p.m. UTC | #2
Le 11/01/2024 à 11:29, Mark Cave-Ayland a écrit :
> This series introduces a new nubus-virtio-mmio device which can be plugged into
> the q800 machine to enable a 68k Classic MacOS guest to access virtio devices
> such as virtio-9p-device (host filesharing), virtio-gpu (extended framebuffer
> support) and virtio-tablet-device (absolute positioning).
> 
> Once the nubus-virtio-mmio device has been plugged into the q800 machine, virtio
> devices can be accessed by a Classic MacOS guest using the drivers from the
> classicvirtio project at https://github.com/elliotnunn/classicvirtio.
> 
> The nubus-virtio-mmio device is purposefully designed to be similar to the
> virtio-mmio interface used by the existing 68k virt machine, making use of a
> similar memory layout and the goldfish PIC for simple interrupt management. The
> main difference is that only a single goldfish PIC is used, however that still
> allows up to 32 virtio devices to be connected using a single nubus card.
> 
> Patch 1 fixes an alignment bug in the existing nubus-device Declaration ROM code
> whereby some ROM images could trigger an assert() in QEMU, patch 2 increases the
> maximum Declaration ROM size (to aid development), whilst patch 3 adds the
> nubus-virtio-mmio device itself.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> [Patches still needing review: 2, 3]
> 
> v3:
> - Rebase onto master
> - Update patch 1 alignment calculation to use intermediatery uint8_t rom_ptr
>    variable, add Phil's R-B tag
> - Add patch 2 to increase maximum Declaration ROM size to 1MB
> 
> v2:
> - Rebase onto master
> - Adjust comment in patch 1 as suggested by Phil
> 
> 
> Mark Cave-Ayland (3):
>    nubus-device: round Declaration ROM memory region address to
>      qemu_target_page_size()
>    nubus.h: increase maximum Declaration ROM size from 128k to 1Mb
>    nubus: add nubus-virtio-mmio device
> 
>   hw/nubus/meson.build                 |   1 +
>   hw/nubus/nubus-device.c              |  18 +++--
>   hw/nubus/nubus-virtio-mmio.c         | 102 +++++++++++++++++++++++++++
>   include/hw/nubus/nubus-virtio-mmio.h |  36 ++++++++++
>   include/hw/nubus/nubus.h             |   2 +-
>   5 files changed, 154 insertions(+), 5 deletions(-)
>   create mode 100644 hw/nubus/nubus-virtio-mmio.c
>   create mode 100644 include/hw/nubus/nubus-virtio-mmio.h
> 

Series Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Philippe Mathieu-Daudé Feb. 23, 2024, 5:44 p.m. UTC | #3
On 11/1/24 11:29, Mark Cave-Ayland wrote:

> Mark Cave-Ayland (3):
>    nubus-device: round Declaration ROM memory region address to
>      qemu_target_page_size()
>    nubus.h: increase maximum Declaration ROM size from 128k to 1Mb
>    nubus: add nubus-virtio-mmio device

Thanks, series queued.
Philippe Mathieu-Daudé Feb. 23, 2024, 5:46 p.m. UTC | #4
On 23/2/24 15:47, Laurent Vivier wrote:
> Le 11/01/2024 à 11:29, Mark Cave-Ayland a écrit :


>> Mark Cave-Ayland (3):
>>    nubus-device: round Declaration ROM memory region address to
>>      qemu_target_page_size()
>>    nubus.h: increase maximum Declaration ROM size from 128k to 1Mb
>>    nubus: add nubus-virtio-mmio device
>>
>>   hw/nubus/meson.build                 |   1 +
>>   hw/nubus/nubus-device.c              |  18 +++--
>>   hw/nubus/nubus-virtio-mmio.c         | 102 +++++++++++++++++++++++++++
>>   include/hw/nubus/nubus-virtio-mmio.h |  36 ++++++++++
>>   include/hw/nubus/nubus.h             |   2 +-
>>   5 files changed, 154 insertions(+), 5 deletions(-)
>>   create mode 100644 hw/nubus/nubus-virtio-mmio.c
>>   create mode 100644 include/hw/nubus/nubus-virtio-mmio.h
>>
> 
> Series Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Since patch tools didn't processed your tag:
Reviewed-by: Laurent Vivier <laurent@vivier.eu>