Mailing List Archive

Load Xen domU (guest) kernel over TFTP
I have a Xen dom0 instance that has its kernel and DTB loaded over TFTP (via a U-Boot script), and its root FS loaded over NFS. I would like any domU (guest) instances to behave the same, but I'm struggling to find out how to load over TFTP - for example:

kernel = "my_kernel"
device_tree = "my_dt.dtb"
name = "guest1"
memory = 1024
vcpus = 2
extra = "rw nfsroot=192.168.0.1:/guest1,tcp,v3 earlyprintk=xenboot console=hvc0 ip=:::::eth0:dhcp"
nfs_root = "/guest1"
nfs_server = "10.32.209.10"
root = "/dev/nfs"
dhcp = 'dhcp'
nics = 1
vif = [ 'mac=aa:00:00:00:00:01' ]
vfb = [ 'type=vnc,vncdisplay=1' ]

Having the guest kernel and DTB loaded from dom0's filesystem works, but attempting to change the relevant paths to TFTP (xenpvnetboot style):

kernel = "tftp://192.168.0/1/my_kernel"
device_tree = "tftp://192.168.0.1/my_dt.dtb"

This doesn't work. I can't use xenpvnetboot as it requires a ramdisk image, which I don't use.

Any ideas how I can load a kernel and DTB into a domU instance over TFTP?
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Load Xen domU (guest) kernel over TFTP [ In reply to ]
Just a workaround, mbootpack allows you to compact both kernels into one. It was used a while ago to deal with bootloaders without Multiboot. Not super flexible solution, but a workaround


> On 31 Jan 2020, at 12:18, Camden Mannett <Camden.Mannett@arm.com> wrote:
>
> I have a Xen dom0 instance that has its kernel and DTB loaded over TFTP (via a U-Boot script), and its root FS loaded over NFS. I would like any domU (guest) instances to behave the same, but I'm struggling to find out how to load over TFTP - for example:
>
> kernel = "my_kernel"
> device_tree = "my_dt.dtb"
> name = "guest1"
> memory = 1024
> vcpus = 2
> extra = "rw nfsroot=192.168.0.1:/guest1,tcp,v3 earlyprintk=xenboot console=hvc0 ip=:::::eth0:dhcp"
> nfs_root = "/guest1"
> nfs_server = "10.32.209.10"
> root = "/dev/nfs"
> dhcp = 'dhcp'
> nics = 1
> vif = [ 'mac=aa:00:00:00:00:01' ]
> vfb = [ 'type=vnc,vncdisplay=1' ]
>
> Having the guest kernel and DTB loaded from dom0's filesystem works, but attempting to change the relevant paths to TFTP (xenpvnetboot style):
>
> kernel = "tftp://192.168.0/1/my_kernel"
> device_tree = "tftp://192.168.0.1/my_dt.dtb"
>
> This doesn't work. I can't use xenpvnetboot as it requires a ramdisk image, which I don't use.
>
> Any ideas how I can load a kernel and DTB into a domU instance over TFTP?
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-users


_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Load Xen domU (guest) kernel over TFTP [ In reply to ]
Hello,

On 31/01/2020 09:18, Camden Mannett wrote:
> I have a Xen dom0 instance that has its kernel and DTB loaded over TFTP (via a U-Boot script), and its root FS loaded over NFS. I would like any domU (guest) instances to behave the same, but I'm struggling to find out how to load over TFTP - for example:
>
> kernel = "my_kernel"
> device_tree = "my_dt.dtb"

For what is worth, this option is only necessary if you are going to
passthrough a device to your guest. This is also a partial device-tree
to provide information about the device you are about to passthrough.
The rest of the device-tree is created by the toolstack.

> name = "guest1"
> memory = 1024
> vcpus = 2
> extra = "rw nfsroot=192.168.0.1:/guest1,tcp,v3 earlyprintk=xenboot console=hvc0 ip=:::::eth0:dhcp"
> nfs_root = "/guest1"
> nfs_server = "10.32.209.10"
> root = "/dev/nfs"
> dhcp = 'dhcp'
> nics = 1
> vif = [ 'mac=aa:00:00:00:00:01' ]
> vfb = [ 'type=vnc,vncdisplay=1' ]
>
> Having the guest kernel and DTB loaded from dom0's filesystem works, but attempting to change the relevant paths to TFTP (xenpvnetboot style):
>
> kernel = "tftp://192.168.0/1/my_kernel"
> device_tree = "tftp://192.168.0.1/my_dt.dtb"
>
> This doesn't work. I can't use xenpvnetboot as it requires a ramdisk image, which I don't use.
Could you expand what you mean by this does not work? From my testing,
xenpvnetboot does not require a ramdisk.

However, the script will not be able to deal with the device-tree. But I
am not entirely why you are trying to load a device-tree here given your
options doesn't show an device passthrough.

>
> Any ideas how I can load a kernel and DTB into a domU instance over TFTP?
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Please avoid sending e-mail with disclaimer on public mailing list.

Best regards,

--
Julien Grall

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Load Xen domU (guest) kernel over TFTP [ In reply to ]
On 31/01/2020 12:30, Pierre-Philipp Braun wrote:
> Just a workaround, mbootpack allows you to compact both kernels into one. It was used a while ago to deal with bootloaders without Multiboot. Not super flexible solution, but a workaround

Is it going to work on Arm as well?

Cheers,

--
Julien Grall

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Load Xen domU (guest) kernel over TFTP [ In reply to ]
> On 31/01/2020 12:30, Pierre-Philipp Braun wrote:
>> Just a workaround, mbootpack allows you to compact both kernels into
>> one. It was used a while ago to deal with bootloaders without
>> Multiboot. Not super flexible solution, but a workaround
>
> Is it going to work on Arm as well?

Hmm. What method is actually used to boot xen and dom0 kernels on ARM
(without considering PXE)?

In case we have Multiboot kernels and modules for ARM, it might still be
worth a try, as U-Boot probably knows how to handle a standard Linux
kernel file format, which Mbootpack delivers.

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Load Xen domU (guest) kernel over TFTP [ In reply to ]
On 01/02/2020 04:54, pierre-philipp braun wrote:
>> On 31/01/2020 12:30, Pierre-Philipp Braun wrote:
>>> Just a workaround, mbootpack allows you to compact both kernels into
>>> one. It was used a while ago to deal with bootloaders without
>>> Multiboot. Not super flexible solution, but a workaround
>>
>> Is it going to work on Arm as well?
>
> Hmm. What method is actually used to boot xen and dom0 kernels on ARM
> (without considering PXE)?

It is a custom protocol for Xen based on Device-Tree [1]. While we also
call it multiboot, this is not the same as the x86 version.

>
> In case we have Multiboot kernels and modules for ARM, it might still be
> worth a try, as U-Boot probably knows how to handle a standard Linux
> kernel file format, which Mbootpack delivers.
I am assuming you are refererring to [2]. Looking at the code, it would
need to be adapt for Arm (there is some assembly and Image/zImage format
is not supported).

However, I am not entirely sure how this would solve the problem here.
Even if you manage to pack the two kernels, how do you pass it to the guest?

Cheers,

[1] https://xenbits.xen.org/docs/unstable/misc/arm/device-tree/booting.txt
[2] https://github.com/timdeegan/mbootpack

>

--
Julien Grall

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Load Xen domU (guest) kernel over TFTP [ In reply to ]
> However, I am not entirely sure how this would solve the problem here.
> Even if you manage to pack the two kernels, how do you pass it to the
> guest?

I am sorry, I misread the original post. I though it was a matter of
loading xen and dom0 through TFTP, while it is about using a network
path for `kernel=`. Ok that seems to be possible with xenpvnetboot.

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Load Xen domU (guest) kernel over TFTP [ In reply to ]
On 01/02/2020 12:04, pierre-philipp braun wrote:
>> However, I am not entirely sure how this would solve the problem here.
>> Even if you manage to pack the two kernels, how do you pass it to the
>> guest?
>
> I am sorry, I misread the original post. I though it was a matter of
> loading xen and dom0 through TFTP,

EFI, GRUB, U-boot, are able to deal with Xen on Arm out-of-the-box with
more or less pain :).

For EFI, this is the same as for x86, i.e you write a configuration file
specifying where all your modules resides.

For GRUB, recent versions are able to deal with the Xen on Arm multiboot
protocol. The commands to load Xen/Linux... are the same as for x86. For
older version, you could chainload Xen and use the same configuration
file as for EFI.

For U-boot, there is no direct support for Xen on Arm mutiboot. But you
could write you own script to load all the modules and generate the
multiboot nodes. This is a bit of a pain, although we provide some
example on the wiki and Stefano Stabellini has been working on a tool to
generate everything for you. More recent version of U-boot are able to
load EFI application. So you could load GRUB as an EFI app making U-boot
nicer to use.

Cheers,

--
Julien Grall

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users