Xen on RP4
I finally have U-Boot -> GRUB -> Xen sort-of operational as an alternative to Tianocore -> GRUB -> Xen on a Raspberry PI 4B.
Stefano Stabellini, how much of the Raspberry PI 4B hardware have you observed being operational under Linux on Xen? In particular, have you ever observed operational graphical output from a Raspberry Pi 4B running Xen?
Presently I'm using a 5.8 kernel with your patches and haven't seen graphical output under Xen with either boot stack. I've confirmed fully operational graphics without Xen on Tianocore, I've confirmed operational virtual terminals with U-Boot and not Xen.
I had been planning to wait a bit before moving to 5.9, but if that is the crucial ingredient I'll move early.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 2 lines · Elliott Mitchell
I finally have U-Boot -> GRUB -> Xen sort-of operational as an
Yup -- same as what we're using in EVE -- we're now on the same page ;-)
Quoted 6 lines
alternative to Tianocore -> GRUB -> Xen on a Raspberry PI 4B.
Stefano Stabellini, how much of the Raspberry PI 4B hardware have you observed being operational under Linux on Xen? In particular, have you ever observed operational graphical output from a Raspberry Pi 4B running Xen?
Pretty much everything is fully operational including graphics (but not native one -- the default LK one)
Quoted 7 lines
Presently I'm using a 5.8 kernel with your patches and haven't seen graphical output under Xen with either boot stack. I've confirmed fully operational graphics without Xen on Tianocore, I've confirmed operational virtual terminals with U-Boot and not Xen.
I had been planning to wait a bit before moving to 5.9, but if that is the crucial ingredient I'll move early.
We're still using 5.4 -- but it seems that the next LTS 5.10 is also functional.
I can bet $10 whatever it is -- it is DT related ;-)
Thanks,
Roman.
Quoted 6 lines · Roman Shaposhnik
Quoted 5 lines · Elliott Mitchell
Presently I'm using a 5.8 kernel with your patches and haven't seen graphical output under Xen with either boot stack. I've confirmed fully operational graphics without Xen on Tianocore, I've confirmed operational virtual terminals with U-Boot and not Xen.
Quoted 6 lines
Quoted 2 lines
I had been planning to wait a bit before moving to 5.9, but if that is the crucial ingredient I'll move early.
We're still using 5.4 -- but it seems that the next LTS 5.10 is also functional.
I can bet $10 whatever it is -- it is DT related ;-)
Given how many of the pieces I'm assembling are alpha or beta level, I estimate a 50:50 chance on that. Good odds it is device-tree, but good odds I grabbed a bad version of $something.
I mostly wanted to know whether I was in completely uncharted territory and needed to wait for others to catch up, versus merely working in a situation where support is funky and I'm at an unknown location in charted territory.
I'll be keeping the Tianocore setup available since Xen on ARM really /should/ allow ACPI...
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 19 lines · Elliott Mitchell
Quoted 6 lines · Roman Shaposhnik
Quoted 5 lines · Elliott Mitchell
Presently I'm using a 5.8 kernel with your patches and haven't seen graphical output under Xen with either boot stack. I've confirmed fully operational graphics without Xen on Tianocore, I've confirmed operational virtual terminals with U-Boot and not Xen.
Quoted 6 lines
Quoted 2 lines
I had been planning to wait a bit before moving to 5.9, but if that is the crucial ingredient I'll move early.
We're still using 5.4 -- but it seems that the next LTS 5.10 is also functional.
I can bet $10 whatever it is -- it is DT related ;-)
Given how many of the pieces I'm assembling are alpha or beta level, I estimate a 50:50 chance on that. Good odds it is device-tree, but good odds I grabbed a bad version of $something.
Quoted 7 lines
I mostly wanted to know whether I was in completely uncharted territory and needed to wait for others to catch up, versus merely working in a situation where support is funky and I'm at an unknown location in charted territory.
I'll be keeping the Tianocore setup available since Xen on ARM really /should/ allow ACPI...
I don't think you're in the uncharted -- so perhaps a bit of debugging left.
And, of course, alway feel free to compare what we do -- the image is docker pull away.
Thanks,
Roman.
Quoted 25 lines · Roman Shaposhnik
Quoted 24 lines · Elliott Mitchell
Quoted 6 lines · Roman Shaposhnik
Quoted 5 lines · Elliott Mitchell
Presently I'm using a 5.8 kernel with your patches and haven't seen graphical output under Xen with either boot stack. I've confirmed fully operational graphics without Xen on Tianocore, I've confirmed operational virtual terminals with U-Boot and not Xen.
Quoted 6 lines
Quoted 2 lines
I had been planning to wait a bit before moving to 5.9, but if that is the crucial ingredient I'll move early.
We're still using 5.4 -- but it seems that the next LTS 5.10 is also functional.
I can bet $10 whatever it is -- it is DT related ;-)
Given how many of the pieces I'm assembling are alpha or beta level, I estimate a 50:50 chance on that. Good odds it is device-tree, but good odds I grabbed a bad version of $something.
I mostly wanted to know whether I was in completely uncharted territory and needed to wait for others to catch up, versus merely working in a situation where support is funky and I'm at an unknown location in charted territory.
Quoted 7 lines
Quoted 2 lines
I'll be keeping the Tianocore setup available since Xen on ARM really /should/ allow ACPI...
I don't think you're in the uncharted -- so perhaps a bit of debugging left.
And, of course, alway feel free to compare what we do -- the image is docker pull away.
Actually, since device-tree is very much on my list of concerns, what is your Xen boot process setup like?
Presently as previously mentioned I'm trying for
U-Boot -> GRUB/EFI -> Xen. According to the information I currently have the device-trees are often tied pretty closely to the kernel. I'm also using GRUB 2.04 since that has proper support for loading Xen on ARM.
The section of grub.cfg for Linux is roughly:
linux /boot/vmlinuz-5.8.10-2rp4-6.1.7 root=UUID=01234567-dead-beef-d13d-456789abcdef ro
devicetree /boot/dtb-5.8.10-2rp4-6.1.7
initrd /boot/initrd.img-5.8.10-2rp4-6.1.7My testing section for Xen is:
xen_hypervisor /boot/xen-4.14-arm64.efi
xen_module /boot/vmlinuz-5.8.10-2rp4-6.1.7 root=UUID=01234567-dead-beef-d13d-456789abcdef ro
devicetree /boot/dtb-5.8.10-2rp4-6.1.7
xen_module --nounzip /boot/initrd.img-5.8.10-2rp4-6.1.7I've frankly got no idea how to ensure the correct device-tree is passed to Xen. Is GRUB's devicetree command correct when loading Xen? Is a device-tree matched to the Linux kernel appropriate for Xen?
(I'm guessing the second is "yes", but the first I don't have a clue)
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 53 lines · Elliott Mitchell
Quoted 25 lines · Roman Shaposhnik
Quoted 24 lines · Elliott Mitchell
Quoted 6 lines · Roman Shaposhnik
Quoted 5 lines · Elliott Mitchell
Presently I'm using a 5.8 kernel with your patches and haven't seen graphical output under Xen with either boot stack. I've confirmed fully operational graphics without Xen on Tianocore, I've confirmed operational virtual terminals with U-Boot and not Xen.
Quoted 6 lines
Quoted 2 lines
I had been planning to wait a bit before moving to 5.9, but if that is the crucial ingredient I'll move early.
We're still using 5.4 -- but it seems that the next LTS 5.10 is also functional.
I can bet $10 whatever it is -- it is DT related ;-)
Given how many of the pieces I'm assembling are alpha or beta level, I estimate a 50:50 chance on that. Good odds it is device-tree, but good odds I grabbed a bad version of $something.
I mostly wanted to know whether I was in completely uncharted territory and needed to wait for others to catch up, versus merely working in a situation where support is funky and I'm at an unknown location in charted territory.
Quoted 7 lines
Quoted 2 lines
I'll be keeping the Tianocore setup available since Xen on ARM really /should/ allow ACPI...
I don't think you're in the uncharted -- so perhaps a bit of debugging left.
And, of course, alway feel free to compare what we do -- the image is docker pull away.
Actually, since device-tree is very much on my list of concerns, what is your Xen boot process setup like?
Presently as previously mentioned I'm trying for
U-Boot -> GRUB/EFI -> Xen. According to the information I currently have the device-trees are often tied pretty closely to the kernel. I'm also using GRUB 2.04 since that has proper support for loading Xen on ARM.The section of grub.cfg for Linux is roughly:
linux /boot/vmlinuz-5.8.10-2rp4-6.1.7 root=UUID=01234567-dead-beef-d13d-456789abcdef ro devicetree /boot/dtb-5.8.10-2rp4-6.1.7 initrd /boot/initrd.img-5.8.10-2rp4-6.1.7My testing section for Xen is:
xen_hypervisor /boot/xen-4.14-arm64.efi xen_module /boot/vmlinuz-5.8.10-2rp4-6.1.7 root=UUID=01234567-dead-beef-d13d-456789abcdef ro devicetree /boot/dtb-5.8.10-2rp4-6.1.7 xen_module --nounzip /boot/initrd.img-5.8.10-2rp4-6.1.7
Quoted 5 lines
I've frankly got no idea how to ensure the correct device-tree is passed to Xen. Is GRUB's
devicetreecommand correct when loading Xen? Is a device-tree matched to the Linux kernel appropriate for Xen?(I'm guessing the second is "yes", but the first I don't have a clue)
Yes, devicetree is correct. I have not used the graphical output, so I cannot help you there but yes the best bet is to use the devicetree that comes with the kernel.
One thing I noticed is that you are missing some of the command line arguments for Xen and Linux in your grub config. For instance on the Xen line you want to have something like:
dom0_mem=1024M console=dtuart sync_console
And on the Linux line you might want to have:
console=tty0 console=hvc0
Quoted 32 lines · Elliott Mitchell
Quoted 30 lines · Roman Shaposhnik
Quoted 19 lines · Elliott Mitchell
Quoted 6 lines · Roman Shaposhnik
Quoted 5 lines · Elliott Mitchell
Presently I'm using a 5.8 kernel with your patches and haven't seen graphical output under Xen with either boot stack. I've confirmed fully operational graphics without Xen on Tianocore, I've confirmed operational virtual terminals with U-Boot and not Xen.
Quoted 6 lines
Quoted 2 lines
I had been planning to wait a bit before moving to 5.9, but if that is the crucial ingredient I'll move early.
We're still using 5.4 -- but it seems that the next LTS 5.10 is also functional.
I can bet $10 whatever it is -- it is DT related ;-)
Given how many of the pieces I'm assembling are alpha or beta level, I estimate a 50:50 chance on that. Good odds it is device-tree, but good odds I grabbed a bad version of $something.
Quoted 7 lines
I mostly wanted to know whether I was in completely uncharted territory and needed to wait for others to catch up, versus merely working in a situation where support is funky and I'm at an unknown location in charted territory.
I'll be keeping the Tianocore setup available since Xen on ARM really /should/ allow ACPI...
I don't think you're in the uncharted -- so perhaps a bit of debugging left.
Quoted 8 lines
Quoted 2 lines
And, of course, alway feel free to compare what we do -- the image is docker pull away.
Actually, since device-tree is very much on my list of concerns, what is your Xen boot process setup like?
Presently as previously mentioned I'm trying for
U-Boot -> GRUB/EFI -> Xen.
Exactly the same. Here's what we put on a vfat partition:
https://github.com/lf-edge/eve/tree/master/pkg/u-boot/rpi
and here's how u-boot is built:
https://github.com/lf-edge/eve/blob/master/pkg/u-boot/Dockerfile
Quoted 3 lines
According to the information I currently have
the device-trees are often tied pretty closely to the kernel. I'm also using GRUB 2.04 since that has proper support for loading Xen on ARM.
Yes. Our DT here:
https://github.com/lf-edge/eve/blob/master/pkg/u-boot/rpi/bcm2711-rpi-4-b.dtb
came from an honest build of our kernel (our build is still in flux -- hence a quick hack of keeping a blob):
https://github.com/lf-edge/eve/blob/master/pkg/kernel/Dockerfile#L154
Quoted 10 lines
The section of grub.cfg for Linux is roughly:
linux /boot/vmlinuz-5.8.10-2rp4-6.1.7 root=UUID=01234567-dead-beef-d13d-456789abcdef ro devicetree /boot/dtb-5.8.10-2rp4-6.1.7 initrd /boot/initrd.img-5.8.10-2rp4-6.1.7My testing section for Xen is:
xen_hypervisor /boot/xen-4.14-arm64.efi xen_module /boot/vmlinuz-5.8.10-2rp4-6.1.7 root=UUID=01234567-dead-beef-d13d-456789abcdef ro devicetree /boot/dtb-5.8.10-2rp4-6.1.7 xen_module --nounzip /boot/initrd.img-5.8.10-2rp4-6.1.7
Roughly the same -- but see Stefano's comment. More here:
https://github.com/lf-edge/eve/blob/master/pkg/grub/rootfs.cfg
Quoted 5 lines
I've frankly got no idea how to ensure the correct device-tree is passed to Xen. Is GRUB's
devicetreecommand correct when loading Xen? Is a device-tree matched to the Linux kernel appropriate for Xen?(I'm guessing the second is "yes", but the first I don't have a clue)
While you can use devicetree in GRUB. E.g.:
https://github.com/lf-edge/eve/blob/master/pkg/grub/rootfs.cfg#L207
on EVE side we've only ever used it as an emergency override.
The happy path boot sequence preserves the DT that RPi bootloader makes available to u-boot and it gets passed down the chain without anybody doing anything.
Hope this helps.
Thanks,
Roman.
Quoted 11 lines · Stefano Stabellini
Quoted 10 lines · Elliott Mitchell
My testing section for Xen is:
xen_hypervisor /boot/xen-4.14-arm64.efi xen_module /boot/vmlinuz-5.8.10-2rp4-6.1.7 root=UUID=01234567-dead-beef-d13d-456789abcdef ro devicetree /boot/dtb-5.8.10-2rp4-6.1.7 xen_module --nounzip /boot/initrd.img-5.8.10-2rp4-6.1.7I've frankly got no idea how to ensure the correct device-tree is passed to Xen. Is GRUB's
devicetreecommand correct when loading Xen? Is a device-tree matched to the Linux kernel appropriate for Xen?
Quoted 5 lines
Quoted 1 line
(I'm guessing the second is "yes", but the first I don't have a clue)
Yes, devicetree is correct. I have not used the graphical output, so I cannot help you there but yes the best bet is to use the devicetree that comes with the kernel.
Well, I've now got everything together for a "proper" Debian Raspberry PI installation. Apparently since 5.2 (perhaps earlier, but 5.2 is confirmed), Debian's kernel source packages have had their Raspberry PI device-trees garbled. I do have full untouched Linux kernel source handy, but I tend to stick with the distribution until that proves untenable.
Quoted 9 lines
One thing I noticed is that you are missing some of the command line arguments for Xen and Linux in your grub config. For instance on the Xen line you want to have something like:
dom0_mem=1024M console=dtuart
sync_consoleAnd on the Linux line you might want to have:
console=tty0 console=hvc0
This plus adding the devicetree setting now turns into a report elsewhere...
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 15 lines · Stefano Stabellini
Quoted 5 lines · Elliott Mitchell
I've frankly got no idea how to ensure the correct device-tree is passed to Xen. Is GRUB's
devicetreecommand correct when loading Xen? Is a device-tree matched to the Linux kernel appropriate for Xen?(I'm guessing the second is "yes", but the first I don't have a clue)
Yes, devicetree is correct. I have not used the graphical output, so I cannot help you there but yes the best bet is to use the devicetree that comes with the kernel.
One thing I noticed is that you are missing some of the command line arguments for Xen and Linux in your grub config. For instance on the Xen line you want to have something like:
Quoted 5 lines
dom0_mem=1024M console=dtuart
sync_consoleAnd on the Linux line you might want to have:
console=tty0 console=hvc0
I was sending the bare minimum. Some of the known bits were filtered out. After having spent several hours pounding on this and building multiple kernels, I'm headed towards odd theories...
I'm wondering how Debian's kernel source trees have managed to remain broken for the Raspberry PIs for over a year:
https://bugs.debian.org/939633
Right now that feels like conspiracy theory territory, but my mind is
wandering in odd directions... Is someone at Intel trying to sabotage
device-trees so everyone moves to UEFI?
Could simply be Debian's kernel maintainers are very busy and the original reporter of the bug failed to draw enough attention to a large problem. If that odd suspicion is true though, getting EFI to supported status on ARM might be a major concern.
Alternatively I've been exploring an incorrect path, I should simply stick with the device-trees which come from the Raspberry PI Foundation, and not try to follow the Linux kernel's device-trees.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 19 lines · Elliott Mitchell
Quoted 11 lines · Stefano Stabellini
Quoted 10 lines · Elliott Mitchell
My testing section for Xen is:
xen_hypervisor /boot/xen-4.14-arm64.efi xen_module /boot/vmlinuz-5.8.10-2rp4-6.1.7 root=UUID=01234567-dead-beef-d13d-456789abcdef ro devicetree /boot/dtb-5.8.10-2rp4-6.1.7 xen_module --nounzip /boot/initrd.img-5.8.10-2rp4-6.1.7I've frankly got no idea how to ensure the correct device-tree is passed to Xen. Is GRUB's
devicetreecommand correct when loading Xen? Is a device-tree matched to the Linux kernel appropriate for Xen?Quoted 5 lines
Quoted 1 line
(I'm guessing the second is "yes", but the first I don't have a clue)
Yes, devicetree is correct. I have not used the graphical output, so I cannot help you there but yes the best bet is to use the devicetree that comes with the kernel.
Quoted 6 lines
Well, I've now got everything together for a "proper" Debian Raspberry PI installation. Apparently since 5.2 (perhaps earlier, but 5.2 is confirmed), Debian's kernel source packages have had their Raspberry PI device-trees garbled. I do have full untouched Linux kernel source handy, but I tend to stick with the distribution until that proves untenable.
Yup. Same here. I started with upstream kernel, wasted a lot of time, threw in the towel
and imported all of the RPi Foundation patches wholesale :-(
Thanks,
Roman.
Quoted 11 lines · Roman Shaposhnik
Quoted 6 lines · Elliott Mitchell
Well, I've now got everything together for a "proper" Debian Raspberry PI installation. Apparently since 5.2 (perhaps earlier, but 5.2 is confirmed), Debian's kernel source packages have had their Raspberry PI device-trees garbled. I do have full untouched Linux kernel source handy, but I tend to stick with the distribution until that proves untenable.
Yup. Same here. I started with upstream kernel, wasted a lot of time, threw in the towel
and imported all of the RPi Foundation patches wholesale :-(
Any chance you could send e-mail to [email protected] and state you have also observed corrupt device-trees with Debian's kernel somewhere in the >=5.2 range?
I'm a half step away from marking that bug "critical" (breaks most/all Raspberry PI variants, this breaks Debian's Xen build). I just tend to be reluctant...
I can almost believe Intel/Tianocore are trying to create a FUD situation for device-trees in order to push UEFI. Debian has been cited by the Tianocore folks as an example of a Linux distribution which can readily install without modification. Just a small push to kill device-trees.
Presently I have no evidence of this, just a niggling suspicion.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445