[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian, Qemu, KVM and Raspberry Pi



On 17/11/16 17:30, Lennart Sorensen wrote:
On Thu, Nov 17, 2016 at 08:21:13AM +0000, Mark Morgan Lloyd wrote:
I'm obviously watching these ongoing threads with a lot of interest :-)

If I can ask two questions so that there's a summary in a single place ready
for me to get back onto this:

*  Assuming a host kernel that has apparently been built with KVM etc.,
what's the best way to test that it exposes the required functionality?

*  What's the recommended Debian guest, and am I correct in assuming that
the only indication of whether it's using KVM etc. is its speed of
execution?

I'm interested in embedding a low-traffic DMZ in a firewall, I think Qemu is
adequate for this but wouldn't trust weaker containerisation.

KVM on arm requires:

CPUs booted in HYP mode (so boot loader has to be done right).

That's been in the Raspbian loader for at least a few months.

Kernel built with VGIC support (or in the case of the RPi 2 and 3
with emulated VGIC since it doesn't have the normal VGIC that most arm
chips have).

Think I've done that OK, at least for am RPi2.

Either a 64 bit kernel or an lpae kernel.

Probably safest ATM to stick to an RPi2, which means LPAE... I'll check.

New enough qemu to have support for kvm on arm (not usually a problem
anymore).  RPi2/3 requires a patched one since the emulated VGIC
apparently requires qemu to be tied to specific cores so that the first
core can stay responsible for the VGIC emulation and not confuse qemu.

I believe that can be forced without a patch.

Really the RPi2/3 is just too weird to really support KVM due to the
lack of standard expected arm cpu features.  I don't expect it to ever
have mainline kernel and qemu support due to those hardware deficiensies.

OTOH it's cheap and fairly popular.

If you have an arm system that boots with the cpu in HYP mode and have
a kernel with KVM support enabled.  I see the armhf lpae kernel has KVM
support enabled in debian.  I don't see it in the arm64 kernel config,
so it is not enabled there yet.  Probably should be.

If you have that, then you should be able to run qemu with the -enable-kvm
flag and it should work.

I'll check, but won't be for a few days due to other pressures.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]


Reply to: