public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input
@ 2023-08-18 18:17 Oliver Smith-Denny
  2023-08-18 21:05 ` Ard Biesheuvel
  2023-08-19 19:39 ` Marcin Juszkiewicz
  0 siblings, 2 replies; 8+ messages in thread
From: Oliver Smith-Denny @ 2023-08-18 18:17 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Sami Mujawar, Gerd Hoffmann

Currently, unlike OVMF, ArmVirtQemu does not display any graphics,
only the QEMU monitor. Graphics are helpful to confirm booting into
an OS is successful, interacting with the EFI shell while getting
separate logging messages, etc.

This patch adds the QEMU parameters to launch a graphical window
and add a USB keyboard and mouse, which is modeled as a tablet as
it tracks better in QEMU than a generic mouse. virtio-gpu-pci is
chosen as the graphics device as it is recommended by QEMU for the
ARM virtual platform.

The graphics and USB input devices will only be added to QEMU when
QEMU_HEADLESS == FALSE, so CI builds will not attempt to use the
graphics and if a user does not want graphics, they can add
QEMU_HEADLESS=TRUE to the build cmdline.

GitHub PR: https://github.com/tianocore/edk2/pull/4750

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
---
 ArmVirtPkg/PlatformCI/PlatformBuildLib.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ArmVirtPkg/PlatformCI/PlatformBuildLib.py b/ArmVirtPkg/PlatformCI/PlatformBuildLib.py
index 405817cae785..0ddaccf9c21f 100644
--- a/ArmVirtPkg/PlatformCI/PlatformBuildLib.py
+++ b/ArmVirtPkg/PlatformCI/PlatformBuildLib.py
@@ -244,6 +244,11 @@ class PlatformBuilder(UefiBuilder, BuildSettingsManager):
         # Conditional Args
         if (self.env.GetValue("QEMU_HEADLESS").upper() == "TRUE"):
             args += " -display none"  # no graphics
+        else:
+            args += " -device virtio-gpu-pci"                         # add recommended QEMU graphics device
+            args += " -device qemu-xhci,id=usb"                       # add USB support for below devices
+            args += " -device usb-tablet,id=input0,bus=usb.0,port=1"  # add a usb mouse
+            args += " -device usb-kbd,id=input1,bus=usb.0,port=2"     # add a usb keyboard
 
         if (self.env.GetValue("MAKE_STARTUP_NSH").upper() == "TRUE"):
             f = open(os.path.join(VirtualDrive, "startup.nsh"), "w")
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107853): https://edk2.groups.io/g/devel/message/107853
Mute This Topic: https://groups.io/mt/100826022/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input
  2023-08-18 18:17 [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input Oliver Smith-Denny
@ 2023-08-18 21:05 ` Ard Biesheuvel
  2023-09-05 16:05   ` Oliver Smith-Denny
  2023-08-19 19:39 ` Marcin Juszkiewicz
  1 sibling, 1 reply; 8+ messages in thread
From: Ard Biesheuvel @ 2023-08-18 21:05 UTC (permalink / raw)
  To: Oliver Smith-Denny; +Cc: devel, Leif Lindholm, Sami Mujawar, Gerd Hoffmann

On Fri, 18 Aug 2023 at 20:17, Oliver Smith-Denny
<osde@linux.microsoft.com> wrote:
>
> Currently, unlike OVMF, ArmVirtQemu does not display any graphics,
> only the QEMU monitor. Graphics are helpful to confirm booting into
> an OS is successful, interacting with the EFI shell while getting
> separate logging messages, etc.
>
> This patch adds the QEMU parameters to launch a graphical window
> and add a USB keyboard and mouse, which is modeled as a tablet as
> it tracks better in QEMU than a generic mouse. virtio-gpu-pci is
> chosen as the graphics device as it is recommended by QEMU for the
> ARM virtual platform.
>
> The graphics and USB input devices will only be added to QEMU when
> QEMU_HEADLESS == FALSE, so CI builds will not attempt to use the
> graphics and if a user does not want graphics, they can add
> QEMU_HEADLESS=TRUE to the build cmdline.
>
> GitHub PR: https://github.com/tianocore/edk2/pull/4750
>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
>
> Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

Feel free to remind me to queue this up after the stable tag release.


> ---
>  ArmVirtPkg/PlatformCI/PlatformBuildLib.py | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/ArmVirtPkg/PlatformCI/PlatformBuildLib.py b/ArmVirtPkg/PlatformCI/PlatformBuildLib.py
> index 405817cae785..0ddaccf9c21f 100644
> --- a/ArmVirtPkg/PlatformCI/PlatformBuildLib.py
> +++ b/ArmVirtPkg/PlatformCI/PlatformBuildLib.py
> @@ -244,6 +244,11 @@ class PlatformBuilder(UefiBuilder, BuildSettingsManager):
>          # Conditional Args
>          if (self.env.GetValue("QEMU_HEADLESS").upper() == "TRUE"):
>              args += " -display none"  # no graphics
> +        else:
> +            args += " -device virtio-gpu-pci"                         # add recommended QEMU graphics device
> +            args += " -device qemu-xhci,id=usb"                       # add USB support for below devices
> +            args += " -device usb-tablet,id=input0,bus=usb.0,port=1"  # add a usb mouse
> +            args += " -device usb-kbd,id=input1,bus=usb.0,port=2"     # add a usb keyboard
>
>          if (self.env.GetValue("MAKE_STARTUP_NSH").upper() == "TRUE"):
>              f = open(os.path.join(VirtualDrive, "startup.nsh"), "w")
> --
> 2.40.1
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107854): https://edk2.groups.io/g/devel/message/107854
Mute This Topic: https://groups.io/mt/100826022/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input
  2023-08-18 18:17 [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input Oliver Smith-Denny
  2023-08-18 21:05 ` Ard Biesheuvel
@ 2023-08-19 19:39 ` Marcin Juszkiewicz
  2023-08-19 22:10   ` Pedro Falcato
  1 sibling, 1 reply; 8+ messages in thread
From: Marcin Juszkiewicz @ 2023-08-19 19:39 UTC (permalink / raw)
  To: devel, osde; +Cc: Leif Lindholm, Ard Biesheuvel, Sami Mujawar, Gerd Hoffmann

W dniu 18.08.2023 o 20:17, Oliver Smith-Denny pisze:
> Currently, unlike OVMF, ArmVirtQemu does not display any graphics, only 
> the QEMU monitor. Graphics are helpful to confirm booting into an OS is 
> successful, interacting with the EFI shell while getting separate 
> logging messages, etc.

Ah, that "but on x86 it is different" again ;D

I asked QEMU (and libvirt) devs in past why AArch64/virt lacks USB while 
both x86/pc and x86/q35 have it. The answer was something like "it was a 
mistake we do not plan to repeat". And hint that whatever uses either 
QEMU or libvirt should take care of adding hardware they expect.

Took me a while to convince OpenStack Nova people that it is not 
QEMU/libvirt fault ;D


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107894): https://edk2.groups.io/g/devel/message/107894
Mute This Topic: https://groups.io/mt/100826022/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input
  2023-08-19 19:39 ` Marcin Juszkiewicz
@ 2023-08-19 22:10   ` Pedro Falcato
  2023-08-21 14:38     ` Gerd Hoffmann
  2023-08-21 14:51     ` Leif Lindholm
  0 siblings, 2 replies; 8+ messages in thread
From: Pedro Falcato @ 2023-08-19 22:10 UTC (permalink / raw)
  To: devel, marcin.juszkiewicz
  Cc: osde, Leif Lindholm, Ard Biesheuvel, Sami Mujawar, Gerd Hoffmann

On Sat, Aug 19, 2023 at 8:39 PM Marcin Juszkiewicz
<marcin.juszkiewicz@linaro.org> wrote:
>
> W dniu 18.08.2023 o 20:17, Oliver Smith-Denny pisze:
> > Currently, unlike OVMF, ArmVirtQemu does not display any graphics, only
> > the QEMU monitor. Graphics are helpful to confirm booting into an OS is
> > successful, interacting with the EFI shell while getting separate
> > logging messages, etc.
>
> Ah, that "but on x86 it is different" again ;D
>
> I asked QEMU (and libvirt) devs in past why AArch64/virt lacks USB while
> both x86/pc and x86/q35 have it. The answer was something like "it was a
> mistake we do not plan to repeat". And hint that whatever uses either
> QEMU or libvirt should take care of adding hardware they expect.

I don't think x86 having USB was a mistake. PIIX4 (the "pc" machine)
already had USB 1.0, Q35 (ICH9) had USB 2.0 too. Not emulating those
automatically would be a mistake from the faithfulness PoV. If they
wanted to have a bare board, the option of just adding a virt board
variant with the bare minimum (PCIe and ACPI, like arm64 and riscv64
do) is a fine idea.

(the same thing applies to other x86-but-not-the-others things like
VGA, etc. worse for VGA, it's more or less required to be there for a
PC-compatible board).

--
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107895): https://edk2.groups.io/g/devel/message/107895
Mute This Topic: https://groups.io/mt/100826022/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input
  2023-08-19 22:10   ` Pedro Falcato
@ 2023-08-21 14:38     ` Gerd Hoffmann
  2023-08-21 14:51     ` Leif Lindholm
  1 sibling, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2023-08-21 14:38 UTC (permalink / raw)
  To: Pedro Falcato
  Cc: devel, marcin.juszkiewicz, osde, Leif Lindholm, Ard Biesheuvel,
	Sami Mujawar

On Sat, Aug 19, 2023 at 11:10:07PM +0100, Pedro Falcato wrote:
> On Sat, Aug 19, 2023 at 8:39 PM Marcin Juszkiewicz
> <marcin.juszkiewicz@linaro.org> wrote:
> >
> > W dniu 18.08.2023 o 20:17, Oliver Smith-Denny pisze:
> > > Currently, unlike OVMF, ArmVirtQemu does not display any graphics, only
> > > the QEMU monitor. Graphics are helpful to confirm booting into an OS is
> > > successful, interacting with the EFI shell while getting separate
> > > logging messages, etc.
> >
> > Ah, that "but on x86 it is different" again ;D
> >
> > I asked QEMU (and libvirt) devs in past why AArch64/virt lacks USB while
> > both x86/pc and x86/q35 have it. The answer was something like "it was a
> > mistake we do not plan to repeat". And hint that whatever uses either
> > QEMU or libvirt should take care of adding hardware they expect.
> 
> I don't think x86 having USB was a mistake. PIIX4 (the "pc" machine)
> already had USB 1.0, Q35 (ICH9) had USB 2.0 too. Not emulating those
> automatically would be a mistake from the faithfulness PoV. If they
> wanted to have a bare board, the option of just adding a virt board
> variant with the bare minimum (PCIe and ACPI, like arm64 and riscv64
> do) is a fine idea.

x86 microvm is very close to arm virt.
There is even a ovmf variant for it ;)

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107920): https://edk2.groups.io/g/devel/message/107920
Mute This Topic: https://groups.io/mt/100826022/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input
  2023-08-19 22:10   ` Pedro Falcato
  2023-08-21 14:38     ` Gerd Hoffmann
@ 2023-08-21 14:51     ` Leif Lindholm
  1 sibling, 0 replies; 8+ messages in thread
From: Leif Lindholm @ 2023-08-21 14:51 UTC (permalink / raw)
  To: Pedro Falcato, devel, marcin.juszkiewicz
  Cc: osde, Ard Biesheuvel, Sami Mujawar, Gerd Hoffmann

On 2023-08-19 23:10, Pedro Falcato wrote:
>> W dniu 18.08.2023 o 20:17, Oliver Smith-Denny pisze:
>>> Currently, unlike OVMF, ArmVirtQemu does not display any graphics, only
>>> the QEMU monitor. Graphics are helpful to confirm booting into an OS is
>>> successful, interacting with the EFI shell while getting separate
>>> logging messages, etc.
>>
>> Ah, that "but on x86 it is different" again ;D
>>
>> I asked QEMU (and libvirt) devs in past why AArch64/virt lacks USB while
>> both x86/pc and x86/q35 have it. The answer was something like "it was a
>> mistake we do not plan to repeat". And hint that whatever uses either
>> QEMU or libvirt should take care of adding hardware they expect.
> 
> I don't think x86 having USB was a mistake. PIIX4 (the "pc" machine)
> already had USB 1.0, Q35 (ICH9) had USB 2.0 too. Not emulating those
> automatically would be a mistake from the faithfulness PoV. If they
> wanted to have a bare board, the option of just adding a virt board
> variant with the bare minimum (PCIe and ACPI, like arm64 and riscv64
> do) is a fine idea.
> 
> (the same thing applies to other x86-but-not-the-others things like
> VGA, etc. worse for VGA, it's more or less required to be there for a
> PC-compatible board).

Yes. The problem is that this attitude results in non-trivial cognitive 
load for enabling existing workflows on !x86 platforms, making it harder 
to get random projects out there to verify things properly on them.

/
     Leif



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107922): https://edk2.groups.io/g/devel/message/107922
Mute This Topic: https://groups.io/mt/100826022/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input
  2023-08-18 21:05 ` Ard Biesheuvel
@ 2023-09-05 16:05   ` Oliver Smith-Denny
  2023-09-06  9:15     ` Ard Biesheuvel
  0 siblings, 1 reply; 8+ messages in thread
From: Oliver Smith-Denny @ 2023-09-05 16:05 UTC (permalink / raw)
  To: devel, ardb; +Cc: Leif Lindholm, Sami Mujawar, Gerd Hoffmann

Gentle reminder on this now that the stable tag has passed.

Thanks,
Oliver

On 8/18/2023 2:05 PM, Ard Biesheuvel wrote:
> On Fri, 18 Aug 2023 at 20:17, Oliver Smith-Denny
> <osde@linux.microsoft.com> wrote:
>>
>> Currently, unlike OVMF, ArmVirtQemu does not display any graphics,
>> only the QEMU monitor. Graphics are helpful to confirm booting into
>> an OS is successful, interacting with the EFI shell while getting
>> separate logging messages, etc.
>>
>> This patch adds the QEMU parameters to launch a graphical window
>> and add a USB keyboard and mouse, which is modeled as a tablet as
>> it tracks better in QEMU than a generic mouse. virtio-gpu-pci is
>> chosen as the graphics device as it is recommended by QEMU for the
>> ARM virtual platform.
>>
>> The graphics and USB input devices will only be added to QEMU when
>> QEMU_HEADLESS == FALSE, so CI builds will not attempt to use the
>> graphics and if a user does not want graphics, they can add
>> QEMU_HEADLESS=TRUE to the build cmdline.
>>
>> GitHub PR: https://github.com/tianocore/edk2/pull/4750
>>
>> Cc: Leif Lindholm <quic_llindhol@quicinc.com>
>> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
>> Cc: Sami Mujawar <sami.mujawar@arm.com>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>>
>> Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
> 
> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
> 
> Feel free to remind me to queue this up after the stable tag release.
> 
> 
>> ---
>>   ArmVirtPkg/PlatformCI/PlatformBuildLib.py | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/ArmVirtPkg/PlatformCI/PlatformBuildLib.py b/ArmVirtPkg/PlatformCI/PlatformBuildLib.py
>> index 405817cae785..0ddaccf9c21f 100644
>> --- a/ArmVirtPkg/PlatformCI/PlatformBuildLib.py
>> +++ b/ArmVirtPkg/PlatformCI/PlatformBuildLib.py
>> @@ -244,6 +244,11 @@ class PlatformBuilder(UefiBuilder, BuildSettingsManager):
>>           # Conditional Args
>>           if (self.env.GetValue("QEMU_HEADLESS").upper() == "TRUE"):
>>               args += " -display none"  # no graphics
>> +        else:
>> +            args += " -device virtio-gpu-pci"                         # add recommended QEMU graphics device
>> +            args += " -device qemu-xhci,id=usb"                       # add USB support for below devices
>> +            args += " -device usb-tablet,id=input0,bus=usb.0,port=1"  # add a usb mouse
>> +            args += " -device usb-kbd,id=input1,bus=usb.0,port=2"     # add a usb keyboard
>>
>>           if (self.env.GetValue("MAKE_STARTUP_NSH").upper() == "TRUE"):
>>               f = open(os.path.join(VirtualDrive, "startup.nsh"), "w")
>> --
>> 2.40.1
>>
> 
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108291): https://edk2.groups.io/g/devel/message/108291
Mute This Topic: https://groups.io/mt/100826022/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input
  2023-09-05 16:05   ` Oliver Smith-Denny
@ 2023-09-06  9:15     ` Ard Biesheuvel
  0 siblings, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2023-09-06  9:15 UTC (permalink / raw)
  To: devel, osde; +Cc: Leif Lindholm, Sami Mujawar, Gerd Hoffmann

On Tue, 5 Sept 2023 at 18:05, Oliver Smith-Denny
<osde@linux.microsoft.com> wrote:
>
> Gentle reminder on this now that the stable tag has passed.
>

Thanks for the reminder.

Merging as #4790


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108318): https://edk2.groups.io/g/devel/message/108318
Mute This Topic: https://groups.io/mt/100826022/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

end of thread, other threads:[~2023-09-06  9:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-18 18:17 [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input Oliver Smith-Denny
2023-08-18 21:05 ` Ard Biesheuvel
2023-09-05 16:05   ` Oliver Smith-Denny
2023-09-06  9:15     ` Ard Biesheuvel
2023-08-19 19:39 ` Marcin Juszkiewicz
2023-08-19 22:10   ` Pedro Falcato
2023-08-21 14:38     ` Gerd Hoffmann
2023-08-21 14:51     ` Leif Lindholm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox