pmem / run_qemu

A script to create bootable OS images, and run qemu with a locally built kernel.
Creative Commons Zero v1.0 Universal
59 stars 23 forks source link
linux linux-kernel mkosi qemu

Requirements

You can also git clone https://github.com/systemd/mkosi, symlink to mkosi.git/bin/mkosi and run mkosi directly from source. This works out of the box with git tags v15 and above.

Fedora 39+ Notes

Fedora 39 updates mkosi to 15 (and later) which contains a lot of breaking changes, and indeed breaks various expectations with run_qemu's usage of it.

Fedora 39 and 40 have packaged mkosi 14 separately and in parallel to the latest mkosi. Uninstall the default mkosi package, and install 'mkosi14' to continue using run_qemu on Fedora 39 and 40:

# dnf remove --noautoremove mkosi
# dnf install mkosi14

Fedora 41 has stopped packaging mkosi14.

Installation

Usage Notes

CXL Usage

The script enables generating a sane QEMU commandline for instantiating a basic CXL topology. Since QEMU support for CXL isn't yet upstream, --git-qemu is additionally required. The CXL related options are:

DAX Usage

Kernel config

The following is a way to check basic sanity within the QEMU guest:

lspci  | grep '3[45]:00'
34:00.0 PCI bridge: Intel Corporation Device 7075
35:00.0 Memory controller [0502]: Intel Corporation Device 0d93 (rev 01)

readlink -f /sys/bus/cxl/devices/mem0
/sys/devices/pci0000:34/0000:34:00.0/0000:35:00.0/mem0