Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPi4: Patch to get KVM working #3035

Open
jan-kiszka opened this issue Jun 30, 2019 · 12 comments
Open

RPi4: Patch to get KVM working #3035

jan-kiszka opened this issue Jun 30, 2019 · 12 comments

Comments

@jan-kiszka
Copy link
Contributor

So far only informative:
As the RPi4 is moving closer to common ARM SoC designs, proper virtualization is finally in reach. I got KVM working, though we currently need a patch for the 32-bit variant, see https://marc.info/?l=kvm&m=156190795627075&w=2. Once that has been reviewed and approved upstream, this kernel can pick it up as well. The patch was tested successfully with the 4.19-rpi branch.

@popcornmix
Copy link
Collaborator

Let us know when it merges.
If upstream patches have been tested and seen to be useful we're usually happy to cherry-pick them.

@macromorgan
Copy link
Contributor

Is there a way to enable KVM for the default config for 64bit while we wait for the 32bit to get merged, if it does?

@jan-kiszka
Copy link
Contributor Author

32-bit KVM is considered dead on ARM by the maintainer, and there are also complications with the patch I sent. So 64-bit is the better way forward.

@macromorgan
Copy link
Contributor

Just want to raise the issue again, especially since the 64 bit kernel seems to be pretty stable for me on Raspbian. Is there a way we can get KVM enabled in the default configs? Sadly it'll have to be a point of differentiation from the 32 bit builds from what I see above, but it would help me and probably others who like to dabble with KVM on their Raspberry Pis by not having to build their own kernels. Thank you.

@macromorgan
Copy link
Contributor

Sorry about the dupe, wasn't sure if I was doing the feature request correctly (since this one is tagged for a patch that looks like is no longer maintained and won't/shouldn't be added to the 32 bit kernel).

@pelwell
Copy link
Contributor

pelwell commented Jan 21, 2020

I take your point - it's not clear cut either way.

You could further the cause by telling us (on the other thread) a few reasons why more than a handful of Pi users might want KVM.

@pelwell
Copy link
Contributor

pelwell commented Jan 21, 2020

Sorry, post here - this is the other thread.

@macromorgan
Copy link
Contributor

KVM would allow users to virtualize operating systems more quickly on the Raspberry Pi (4). While this technically would work on the Pi 2 2nd revision, Pi 3, and Pi 4 all with the 64 bit kernel, it is on the Pi 4 where memory constraints are such that it is feasible.

When running Debian/Raspbian Linux in QEMU on a Pi 4, even with the same architecture (armhf or aarch64), it's far too slow to be usable unless KVM is enabled. With KVM enabled I can easily run Raspbian Desktop within a VM on my Raspberry Pi 4.

The assumption (on my part) is that by enabling this you will enable others to experiment with KVM more easily, and that by doing this only for the 64 bit kernel (which is the only kernel that supports it anyway as far as I know) it will not have widespread impact on the greater community in the event of any issues.

@jan-kiszka
Copy link
Contributor Author

I think we are only a few kernel releases away from proper upstream support for the RPi 4. Then major distro kernels will start to work as well, and distros do not ask why you want KVM. They carry this as default feature for full system virtualization, container isolation, etc.

@pelwell
Copy link
Contributor

pelwell commented Feb 6, 2020

#3456 is a first attempt at a KVM configuration for a 64-bit Pi 4 kernel.

@pelwell
Copy link
Contributor

pelwell commented Feb 27, 2020

Did anybody get round to trying my patch (#3456) to enable KVM in the Pi 4 64-bit kernel?

pelwell added a commit that referenced this issue Mar 3, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
pelwell added a commit that referenced this issue Mar 3, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
pelwell added a commit that referenced this issue Mar 3, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
pelwell added a commit that referenced this issue Mar 3, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
@pelwell
Copy link
Contributor

pelwell commented Mar 3, 2020

The patch is now merged to the current and upcoming kernel branches, but remember that this only affects 64-bit Pi 4 kernel builds.

pelwell added a commit that referenced this issue Mar 6, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 6, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix added a commit to raspberrypi/firmware that referenced this issue Mar 6, 2020
kernel: Add support for merus-amp soundcard and ma120x0p codec
See: raspberrypi/linux#3483

kernel: gpio-ir-overlay: add parameter to configure signal polarity
See: raspberrypi/linux#3490

kernel: overlays: sc16ic750-i2c: Fix xtal parameter
See: raspberrypi/linux#3156

kernel: configs: Add KVM support to arm64 bcm2711_defconfig
See: raspberrypi/linux#3035

firmware: Support Isp stats and params

firmware: arm_loader: Make EMMC2 dma-ranges patch more tolerant

firmware: bootromfs: Delete unwanted assert

firmware: usb_eth: Increase timeouts for TFTP requests and retransmit ACK
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Mar 6, 2020
kernel: Add support for merus-amp soundcard and ma120x0p codec
See: raspberrypi/linux#3483

kernel: gpio-ir-overlay: add parameter to configure signal polarity
See: raspberrypi/linux#3490

kernel: overlays: sc16ic750-i2c: Fix xtal parameter
See: raspberrypi/linux#3156

kernel: configs: Add KVM support to arm64 bcm2711_defconfig
See: raspberrypi/linux#3035

firmware: Support Isp stats and params

firmware: arm_loader: Make EMMC2 dma-ranges patch more tolerant

firmware: bootromfs: Delete unwanted assert

firmware: usb_eth: Increase timeouts for TFTP requests and retransmit ACK
popcornmix pushed a commit that referenced this issue Mar 10, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 10, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 23, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 23, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 23, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 23, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 27, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 27, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 1, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 1, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 1, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 7, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 7, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 16, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 16, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 16, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 27, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 27, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 4, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 4, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 11, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 20, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 20, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 20, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jun 3, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jun 3, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
jpuhlman pushed a commit to MontaVista-OpenSourceTechnology/linux-mvista that referenced this issue Jun 8, 2020
Source: kernel.org
MR: 103889
Type: Enhancement
Disposition: Merged from https://github.com/raspberrypi/linux.git rpi-5.4.y
ChangeID: 53dacca34d7396c11f9ff8ee269dafcf5a333518
Description:

See: raspberrypi/linux#3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
popcornmix pushed a commit that referenced this issue Jun 10, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jun 10, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jun 17, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jun 17, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jun 26, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jul 1, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jul 13, 2020
See: #3035

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants