Linux Kernel - Software interacting with hardware

mail

KVM

KVM ...

  • stands for Kernel Virtual Machine
  • is a full virtualization solution for Linux on
    • x86
    • x86_64
    • ARM
    containing virtualization extensions
    • Intel VT
    • AMD-V
  • is made of a loadable kernel module kvm.ko, which provides
    • the core virtualization infrastructure
    • and a processor specific module
      • kvm-intel.ko
      • kvm-amd.ko
  • is typically used with tools such as QEMU

setup

Let's check a few things :
  1. the kernel version :
    uname -a
    Linux myPC 6.5.0-45-generic #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 15 16:40:02 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
                  ^^^^^^^^^^^^^^^^                                                                  ^^^^^^
                  kernel version                                                                    arch
  2. what about the loadable kernel module ?
    dpkg -S '*/kvm.ko'
    linux-modules-6.5.0-44-generic: /lib/modules/6.5.0-44-generic/kernel/arch/x86/kvm/kvm.ko
    linux-modules-6.5.0-45-generic: /lib/modules/6.5.0-45-generic/kernel/arch/x86/kvm/kvm.ko
    There are 2 versions installed, 1 matching my kernel version.
  3. does my CPU support virtualization ?
    lscpu | grep -Ei '(vendor|virtualization)'
    Vendor ID:				GenuineIntel
    Virtualization:				VT-x
  4. what about the processor-specific module ?
    dpkg -S kvm-intel.ko
    linux-modules-6.5.0-45-generic: /lib/modules/6.5.0-45-generic/kernel/arch/x86/kvm/kvm-intel.ko
    linux-modules-6.5.0-44-generic: /lib/modules/6.5.0-44-generic/kernel/arch/x86/kvm/kvm-intel.ko
  5. are both modules loaded ?
    lsmod | grep -E '(^Module|kvm)'
    Module                  Size  Used by
    kvm_intel             487424  0
    kvm                  1409024  1 kvm_intel
    irqbypass              12288  1 kvm
Looks like everything is already set up on my machine !!!
mail

Linux namespaces

Namespaces provide kernel-level isolation:
mail

How to deal with the kernel modules ?

This may be obsolete or not completely up-to-date.

Support for specific hardware or functionalities can be : Those modules are not always loaded by default, but can be managed manually :
Command Function
insmod moduleName insert (=load) the module called moduleName
  • no reply : OK
  • error message : dependency constraint not met
rmmod moduleName remove (=unload) the module called moduleName
lsmod list currently loaded modules

Kernel modules are handled with modprobe.