Mailing List Archive

PvGRUB2 on Arm64?
Hi,



Pygrub is insufficient for my use case (it also seems to have quite a major bug traversing GPT partition tables – in my case it identifies 128 partitions all at offset 0 for a 2-partition image), therefore I wish to use paravirtualized GRUB2. However, it doesn’t seem as though Xen is a supported platform for PvGRUB2 like it is for x86_64 and i386. Is this really the case? Is there a way I can use PvGRUB2 on Arm64? If not, is there investigation/development ongoing?



Kind regards,

Ben
Re: PvGRUB2 on Arm64? [ In reply to ]
On 07.10.22 11:04, Benjamin Mordaunt wrote:
> Hi,
>
> Pygrub is insufficient for my use case (it also seems to have quite a major bug
> traversing GPT partition tables – in my case it identifies 128 partitions all at
> offset 0 for a 2-partition image), therefore I wish to use paravirtualized
> GRUB2. However, it doesn’t seem as though Xen is a supported platform for
> PvGRUB2 like it is for x86_64 and i386. Is this really the case? Is there a way
> I can use PvGRUB2 on Arm64? If not, is there investigation/development ongoing?

So you are basically looking for grub2 with Xen PV drivers.

That should be doable, but it requires at least some work. The best way forward
would be to have grub2 modules for that purpose.

The code is there already, it "only" needs to be made generally available and
be activated. A good blueprint for that is the i386-xen_pvh variant of grub2.

Unfortunately I don't have time now to work on that.


Juergen
Re: PvGRUB2 on Arm64? [ In reply to ]
Yes in effect, that is what I want.

There seems to be a GRUB2 module which works in the opposite direction
(
https://github.com/rhboot/grub2/blob/fedora-38/grub-core/loader/arm64/xen_boot.c
),
which allows launching the Xen hypervisor from GRUB, but I want to launch
GRUB2
with PV drivers as the bootloader for a DomU (Ubuntu in my case). Looks
like we need
an equivalent arm64 relocator.S as provided for x86 in
https://github.com/rhboot/grub2/blob/fedora-38/grub-core/lib/x86_64/xen/relocator.S
.


Ben

On Fri, Oct 7, 2022 at 10:51 AM Juergen Gross <jgross@suse.com> wrote:

> On 07.10.22 11:04, Benjamin Mordaunt wrote:
> > Hi,
> >
> > Pygrub is insufficient for my use case (it also seems to have quite a
> major bug
> > traversing GPT partition tables – in my case it identifies 128
> partitions all at
> > offset 0 for a 2-partition image), therefore I wish to use
> paravirtualized
> > GRUB2. However, it doesn’t seem as though Xen is a supported platform
> for
> > PvGRUB2 like it is for x86_64 and i386. Is this really the case? Is
> there a way
> > I can use PvGRUB2 on Arm64? If not, is there investigation/development
> ongoing?
>
> So you are basically looking for grub2 with Xen PV drivers.
>
> That should be doable, but it requires at least some work. The best way
> forward
> would be to have grub2 modules for that purpose.
>
> The code is there already, it "only" needs to be made generally available
> and
> be activated. A good blueprint for that is the i386-xen_pvh variant of
> grub2.
>
> Unfortunately I don't have time now to work on that.
>
>
> Juergen
>
Re: PvGRUB2 on Arm64? [ In reply to ]
On 07.10.22 12:13, Benjamin Mordaunt wrote:
> Yes in effect, that is what I want.
>
> There seems to be a GRUB2 module which works in the opposite direction
> (https://github.com/rhboot/grub2/blob/fedora-38/grub-core/loader/arm64/xen_boot.c <https://github.com/rhboot/grub2/blob/fedora-38/grub-core/loader/arm64/xen_boot.c>),
> which allows launching the Xen hypervisor from GRUB, but I want to launch GRUB2
> with PV drivers as the bootloader for a DomU (Ubuntu in my case). Looks like we need
> an equivalent arm64 relocator.S as provided for x86 in
> https://github.com/rhboot/grub2/blob/fedora-38/grub-core/lib/x86_64/xen/relocator.S <https://github.com/rhboot/grub2/blob/fedora-38/grub-core/lib/x86_64/xen/relocator.S>.

No, this is really for guests running in PV mode (this is a x86-only special
variant for guests not needing any hardware virtualization support).

PV device support is completely unrelated to that.

This is why I mentioned the i386-xen_pvh variant of grub, as the x86 PVH
guests are very similar to the Xen guests on Arm[64].


Juergen

>
>
> Ben
>
> On Fri, Oct 7, 2022 at 10:51 AM Juergen Gross <jgross@suse.com
> <mailto:jgross@suse.com>> wrote:
>
> On 07.10.22 11:04, Benjamin Mordaunt wrote:
> > Hi,
> >
> > Pygrub is insufficient for my use case (it also seems to have quite a
> major bug
> > traversing GPT partition tables – in my case it identifies 128 partitions
> all at
> > offset 0 for a 2-partition image), therefore I wish to use paravirtualized
> > GRUB2. However, it doesn’t seem as though Xen is a supported platform for
> > PvGRUB2 like it is for x86_64 and i386. Is this really the case? Is there
> a way
> > I can use PvGRUB2 on Arm64? If not, is there investigation/development
> ongoing?
>
> So you are basically looking for grub2 with Xen PV drivers.
>
> That should be doable, but it requires at least some work. The best way forward
> would be to have grub2 modules for that purpose.
>
> The code is there already, it "only" needs to be made generally available and
> be activated. A good blueprint for that is the i386-xen_pvh variant of grub2.
>
> Unfortunately I don't have time now to work on that.
>
>
> Juergen
>
Re: PvGRUB2 on Arm64? [ In reply to ]
Hello,

On 07/10/2022 11:13, Benjamin Mordaunt wrote:
> Yes in effect, that is what I want.
>
> There seems to be a GRUB2 module which works in the opposite direction
> (
> https://github.com/rhboot/grub2/blob/fedora-38/grub-core/loader/arm64/xen_boot.c
> ),
> which allows launching the Xen hypervisor from GRUB, but I want to launch
> GRUB2
> with PV drivers as the bootloader for a DomU (Ubuntu in my case). Looks
> like we need
> an equivalent arm64 relocator.S as provided for x86 in
> https://github.com/rhboot/grub2/blob/fedora-38/grub-core/lib/x86_64/xen/relocator.S
> .

We have support for UEFI/U-boot in the guest. With that you should be
able to launch a normal GRUB. Would that work for you?

Cheers,

--
Julien Grall
RE: PvGRUB2 on Arm64? [ In reply to ]
On 07/10/2022 11:42, Julien Grall wrote:

> We have support for UEFI/U-boot in the guest. With that you should be

> able to launch a normal GRUB. Would that work for you?



I’m struggling to interpret Xen’s documentation around EFI Guest support on arm64.

You claim that it exists, and sure enough I can find resources for EFI Xen Host, but in

terms of DomU, I see OVMF for x86, but don’t see anything for Arm.

Can you give any pointers?



--

Ben Mordaunt



From: Julien Grall
Sent: 07 October 2022 11:42
To: Benjamin Mordaunt; Juergen Gross
Cc: xen-users@lists.xenproject.org
Subject: Re: PvGRUB2 on Arm64?



Hello,



On 07/10/2022 11:13, Benjamin Mordaunt wrote:

> Yes in effect, that is what I want.

>

> There seems to be a GRUB2 module which works in the opposite direction

> (

> https://github.com/rhboot/grub2/blob/fedora-38/grub-core/loader/arm64/xen_boot.c

> ),

> which allows launching the Xen hypervisor from GRUB, but I want to launch

> GRUB2

> with PV drivers as the bootloader for a DomU (Ubuntu in my case). Looks

> like we need

> an equivalent arm64 relocator.S as provided for x86 in

> https://github.com/rhboot/grub2/blob/fedora-38/grub-core/lib/x86_64/xen/relocator.S

> .



We have support for UEFI/U-boot in the guest. With that you should be

able to launch a normal GRUB. Would that work for you?



Cheers,



--

Julien Grall
Re: PvGRUB2 on Arm64? [ In reply to ]
Hi Benjamin,

On 07/10/2022 16:38, Benjamin Mordaunt wrote:
> On 07/10/2022 11:42, Julien Grall wrote:
>
>> We have support for UEFI/U-boot in the guest. With that you should be
>
> > able to launch a normal GRUB. Would that work for you?
>
> I’m struggling to interpret Xen’s documentation around EFI Guest support on arm64.
>
> You claim that it exists, and sure enough I can find resources for EFI Xen Host,
> but in
>
> terms of DomU, I see OVMF for x86, but don’t see anything for Arm.
>
> Can you give any pointers?

The EDK2 platform is ArmVirtPkg/ArmVirtXen.dsc. Unfortunately, I don't
have the instructions at hand.

To build the EFI firmware, you should be able to use instructions in [1]
and then use "Xen" rather than QEMU. The blob provided could be used by
replacing adding as the kernel in the xl configuration file.

Note that I haven't used EDK2 recently. So I can't guarantee this work.
Although, I should be able to help if there are any issues.

Cheers,

[1] https://www.kraxel.org/blog/2022/05/edk2-virt-quickstart/

--
Julien Grall
Re: PvGRUB2 on Arm64? [ In reply to ]
On Fri Oct 7, 2022 at 4:53 PM BST, Julien Grall wrote:
> Hi Benjamin,
>
> On 07/10/2022 16:38, Benjamin Mordaunt wrote:
> > On 07/10/2022 11:42, Julien Grall wrote:
> >
> >> We have support for UEFI/U-boot in the guest. With that you should be
> >
> > > able to launch a normal GRUB. Would that work for you?
> >
> > I’m struggling to interpret Xen’s documentation around EFI Guest support on arm64.
> >
> > You claim that it exists, and sure enough I can find resources for EFI Xen Host,
> > but in
> >
> > terms of DomU, I see OVMF for x86, but don’t see anything for Arm.
> >
> > Can you give any pointers?
>
> The EDK2 platform is ArmVirtPkg/ArmVirtXen.dsc. Unfortunately, I don't
> have the instructions at hand.
>
> To build the EFI firmware, you should be able to use instructions in [1]
> and then use "Xen" rather than QEMU. The blob provided could be used by
> replacing adding as the kernel in the xl configuration file.
>
> Note that I haven't used EDK2 recently. So I can't guarantee this work.
> Although, I should be able to help if there are any issues.
>
> Cheers,
>
> [1] https://www.kraxel.org/blog/2022/05/edk2-virt-quickstart/
>
> --
> Julien Grall

Hi Julien, apologies I haven't expressed my requirements properly. I
have a system which boots via U-Boot (in theory, it could boot through
EFI, but that would involve changing a lot of configuration).

What I really wanted was the following flow:

U-Boot -> Xen -> EFI (for guest) -> GRUB -> Ubuntu

Is this possible, or do we need to use EFI at the top level?

--
Ben
Re: PvGRUB2 on Arm64? [ In reply to ]
Hi Benjamin,

On 07/10/2022 21:33, Benjamin Mordaunt wrote:
> On Fri Oct 7, 2022 at 4:53 PM BST, Julien Grall wrote:
>> Hi Benjamin,
>>
>> On 07/10/2022 16:38, Benjamin Mordaunt wrote:
>>> On 07/10/2022 11:42, Julien Grall wrote:
>>>
>>>> We have support for UEFI/U-boot in the guest. With that you should be
>>>
>>> > able to launch a normal GRUB. Would that work for you?
>>>
>>> I’m struggling to interpret Xen’s documentation around EFI Guest support on arm64.
>>>
>>> You claim that it exists, and sure enough I can find resources for EFI Xen Host,
>>> but in
>>>
>>> terms of DomU, I see OVMF for x86, but don’t see anything for Arm.
>>>
>>> Can you give any pointers?
>>
>> The EDK2 platform is ArmVirtPkg/ArmVirtXen.dsc. Unfortunately, I don't
>> have the instructions at hand.
>>
>> To build the EFI firmware, you should be able to use instructions in [1]
>> and then use "Xen" rather than QEMU. The blob provided could be used by
>> replacing adding as the kernel in the xl configuration file.
>>
>> Note that I haven't used EDK2 recently. So I can't guarantee this work.
>> Although, I should be able to help if there are any issues.
>>
>> Cheers,
>>
>> [1] https://www.kraxel.org/blog/2022/05/edk2-virt-quickstart/
>>
>> --
>> Julien Grall
>
> Hi Julien, apologies I haven't expressed my requirements properly. I
> have a system which boots via U-Boot (in theory, it could boot through
> EFI, but that would involve changing a lot of configuration).
>
> What I really wanted was the following flow:
>
> U-Boot -> Xen -> EFI (for guest) -> GRUB -> Ubuntu
>
> Is this possible, or do we need to use EFI at the top level?

Yes this is possible. The guest firmware doesn't depened on the host
firmware.

Cheers,

--
Julien Grall