gilius2k15 wrote: ↑Fri Jul 26, 2019 10:35 pm
sakaki, "This will hopefully be addressed upstream shortly" sounds a bit vague; I'm not being funny, but any ideas why Raspbian has 4 GB of RAM but everything else only has 1 GB at the current time? Sounds like a conspiracy theory, so who can provide the most explicit answer?
The core reason is the architecture of kernel being used. Currently, stock 32-bit userland Raspbian (when booted on a Pi4) uses a
32-bit kernel, with
LPAE enabled. The platform-specific drivers on this variant kernel currently work correctly with the microSD card, USB interface, etc. on systems up to the full 4GiB Pi4.
However, to enable use of (native) 64-bit userlands on ARMv8-A systems (such as the Pi4 and Pi3), booting under a
64-bit kernel is required*. The 64-bit (aarch64) kernel is quite a different beast from the 32-bit LPAE variant (and further, the configuration for the 64-bit Pi4 build - bcm2711_defconfig - is also quite different from the now relatively mature 64-bit Pi3 configuration - bcmrpi3_defconfig).
Unfortunately, a number of the platform-specific kernel drivers for the Pi4 have issues working on the extended address space provided by the 2GiB and 4GiB RPi4 models in the 64-bit kernel (although not if limited to 1GiB) - whereas, as mentioned, these same drivers work fine in the 32-bit LPAE kernel.
As such, these issues didn't impact the core 32-bit kernel / 32-bit Raspbian userland release that was a necessary precondition to shipping the Pi4, so understandably RPF haven't yet fully addressed them. However, work to fix these issues is now ongoing, and as wren points out above, you can follow the progress at
https://github.com/raspberrypi/linux/issues.
See e.g.:
https://github.com/raspberrypi/linux/issues/3032
https://github.com/raspberrypi/linux/co ... efe6ea6617 (mitigating, but not yet a silver bullet; see comments to commit)
Ultimately, while I'm confident these issues will be fixed shortly (and the 1GiB memory clamp released for 64-bit bcm2711_defconfig kernels), I'm not personally working on them (nor do I work for the RPF/RPT!) so as wren suggests, any such points should be addressed / followed upstream (per links above). My weekly
bcm2711_defconfig autobuilds will pick up any such fixes once released, so others downstream can use them without cross-compilation etc. should they desire.
Hope that all makes sense ^-^
gilius2k15 wrote: ↑Fri Jul 26, 2019 10:35 pm
Incidentally, how comes these kernel releases are based around a 32-bit userland instead of a matching 64-bit userland? How much more difficult would it be to adapt for 64-bit all round? And if it's not currently possible then why? BTW, don't take me the wrong way - I'm not trying to sound rude or anything - straight answers is something I die for!
To clarify slightly: the weekly autobuild 64-bit bcm2711_defconfig kernel releases described in this thread stand alone - they are not
based around a 32-bit userland, but rather can be
used with a 64-bit
or 32-bit userland as desired. For illustration purposes above (since you do need a userland to actually
boot a Pi4 ^-^) I have chosen to use a 32-bit Raspbian host OS userland (with 64-bit guest userland OS).
However, I am currently working on adapting my own 64-bit (kernel + userland) Gentoo image to work with both the Pi4 as well as the Pi3 (indeed that's the main reason for me creating the 64-bit kernel autobuilds, although hopefully they will be useful to others). This should be available in the next month or so (but I just do this stuff in my spare time, so my bandwidth is limited). As I describe in
this thread, you can actually co-opt the existing gentoo-on-rpi3-64bit userland to run on the Pi4, since both share the same ARMv8-A architecture (should you want to try out a 64-bit Gentoo userland more quickly - the new release will have cortex-a72 tuning however). Other 64-bit OSes will no doubt be along shortly for the Pi4, and some will probably be earlier to release than mine. So providing a 64-bit userland can certainly be done.
Now Raspbian, for reasons well-rehearsed ^-^ elsewhere in this forum and as mentioned above, currently ships as a 32-bit kernel, 32-bit userland system, with no immediate plans to modify the
userland to 64-bits. However Eben
has been quoted as saying:
ebenupton wrote:So 64-bit Raspbian would actually just be AArch64 Debian. It is probably feasible to build a work-alike version of our standard release against the AArch64 repos (we already do this for PCs and Macs with the i386 repos), but we're currently unpersuaded that there's a benefit.
Much more likely is that we move in due course to a 64-bit kernel with the 32-bit Raspbian userland on top of it. There's work to be done, but this would bring some performance improvements in some areas by reducing page-table maintenance cost versus our current 32-bit LPAE kernel.
and
jamesh wrote: ↑Mon Jul 08, 2019 10:15 am
...
32 bit userland 64 bit kernel will probably be the first milestone. The work required to get a 64 bit userland working, with vchiq and things like the camera, is considerable. Since this work cannot be done unless you have access to the firmware codebase, third party efforts will certainly have issues with some of the stuff that need to talk to the GPU.
That (i.e., 32-bit Raspbian userland under a 64-bit kernel) is what this thread attempts to sketch a first attempt at, for the Pi4, from a third-party perspective (much as my
raspbian-nspawn-64 image did, in a rather more "automagical" fashion ^-^, for the RPi3).
The advantages of such a setup being:
- most people will be familiar with the 32-bit Raspbian userland;
- once you have a 64-bit kernel, you are free to bring up - in addition to the 32-bit host userland Raspbian OS - one or more 64-bit guest OSes (in native mode), whether via chroot (as above) or systemd-nspawn from within it; and
- such (64-bit guest) OSes can leverage e.g. the vc4-accelerated X11 server provided by the Raspbian host (and e.g. its pulseaudio server, should you install that) without having to have all the platform-specific drivers themselves. That's what allows (e.g.) the use of a 'vanilla' Debian Buster aarch64 (64-bit) guest OS, from which 64-bit firefox-esr is launched, in the above example.
ShiftPlusOne has kindly
provided Raspbian packaging for my autobuilds of the 64-bit RPi3 kernel in the past; hopefully (when bandwidth permits) he will provide a similar wrapper for my weekly 64-bit bcm2711_defconfig kernel autobuilds for the RPi4 (introduced in the
first post of this thread). (Or alternatively, RPF may launch their own "official" 64-bit binary kernel package at some point, given e.g. jamesh's comments above)
Incidentally, once the Pi4 compatible version of Gentoo
is out, I plan to update my
raspbian-nspawn-64 image to use a Raspbian Buster host OS; such a system will hopefully address the needs of users who need to run one or more 64-bit apps on their RPi3 or 4, but want to retain the familiarity (and userland driver support) of Raspbian.
gilius2k15 wrote: ↑Fri Jul 26, 2019 10:35 pm
Lastly, sakaki, if I attempt to follow your guide for adding a KVM-enabled kernel to Ubuntu would you be willing to me help if I get stuck - providing I do my very best of course and post all the steps I've taken together with any error messages, etc?
Of course, I'll try my best to help if I can, modulo real-world NMIs ^-^
Best,
sakaki
* OK, technically a 64-bit hypervisor could be used, with 64-bit and 32-bit kernels running under that ^-^