Skip to content

Instantly share code, notes, and snippets.

@mcastelino
mcastelino / qemu_direct_kernel_boot_disk.md
Created September 20, 2018 18:55
QEMU Direct Kernel Boot into a disk image
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
VMN=${VMN:=1}
NEMU=~/build-x86_64/x86_64-softmmu/qemu-system-x86_64
sudo $NEMU \
-trace events=/tmp/events \
@mcastelino
mcastelino / acpi_qemu_pci_hotplug.md
Last active January 24, 2023 23:50
APCI QEMU PCI Discovery, Enumeration and Hotplug

Overview

This document attempts to call out all the elements and mechanisms involved in the discovery as well as hotplug of PCI devices including

  • QEMU framework
  • APCI Tables and Methods
  • Linux Kernel functions and tables

The logic pertaining to the GED interrupt based APCI eventing is specific to NEMU. The rest of this document is generic.

QEMU Hotplug Registration

@mcastelino
mcastelino / PCI Interrupt Routing.md
Last active June 1, 2022 22:32
PCI Interrupt Routing

Debug outputs on a NUC

APCI PRT Table Dump

[    0.076942] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 10 *11 12 14 15)
[    0.077030] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    0.077111] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 *10 11 12 14 15)
[    0.077191] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 *10 11 12 14 15)
[    0.077270] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 *5 6 10 11 12 14 15)

Physical Setup:

---------------------
| workstation  [enp5s0f0] -- internet
|                  |          ---------------
|              [enp5s0f1] -- |    switch    |
--------------------         |              |
               [lab-nuc-1] --|              |
 [lab-nuc-2] --|--------------|
@mcastelino
mcastelino / NEMU Changes.md
Last active August 15, 2018 20:33
Summarizing NEMU changes to date

Summary

This tries to capture all the changes made to NEMU while I was on sabbatical. Will also be an attempt to document the overall architecture of the new x86 virt platform.

New Configuration Items

CONFIG_SYS_BUS_DEBUG
CONFIG_ACPI_HW_REDUCED
CONFIG_PCI_LITE

NEMU build

Configure script: configure.sh

git clone https://github.com/intel/nemu
cd nemu
git checkout -b topic/virt-x86 origin/topic/virt-x86
mkdir build-x86-64
cd build-x86-64
@mcastelino
mcastelino / build.sh
Created May 31, 2018 21:23 — forked from jcvenegas/build.sh
build static qemu for kata
#git status
#On branch stable-2.11
#Your branch is up-to-date with 'origin/stable-2.11'.
#nothing to commit, working directory clean
./configure --disable-bluez --disable-brlapi --disable-docs --disable-curses --disable-gtk --disable-opengl --disable-sdl --disable-spice --disable-vte --disable-vnc --disable-vnc-jpeg --disable-vnc-png --disable-vnc-sasl --disable-fdt --disable-glusterfs --disable-libiscsi --disable-libnfs --disable-bzip2 --disable-lzo --disable-snappy --disable-seccomp --disable-tpm --disable-slirp --disable-libusb --disable-usb-redir --disable-tcg --disable-uuid --disable-debug-tcg --disable-qom-cast-debug --disable-tcg-interpreter --disable-tcmalloc --disable-curl --disable-rdma --disable-tools --disable-xen --disable-linux-aio --enable-kvm --enable-vhost-net --enable-virtfs --enable-attr --enable-cap-ng --target-list=x86_64-softmmu --extra-cflags=" -O3 -fno-semantic-interposition -falign-functions=32 -D_FORTIFY_SOURCE=2 -fPIE" --extra-ldflags=" -z noexecstack -z relro -z now" --static --
@mcastelino
mcastelino / secure_forward.md
Created April 25, 2018 22:21
Secure SSL Port forwarding

To forward remote port to a port on your local machine localhost

ssh -nNTL 8888:localhost:remoteport username@remotemachine
@mcastelino
mcastelino / README-vsock-nfs.md
Created April 25, 2018 16:55 — forked from grahamwhaley/README-vsock-nfs.md
Setting up vsock/nfs

How to set up vsock/nfs and QEMU

Wed 25 Apr 16:15:47 BST 2018

Setting up the experimental vsock/nfs between a host Linux machine and a KVM/QEMU client is not quite trivial - let's write it down...

Overview

over in kata containers, we use 9pfs to mount host side filesystems into the QEMU/KVM Virtual Machine.

@mcastelino
mcastelino / qemu_virtio_all.md
Last active February 16, 2023 23:25
Testing a all virtio QEMU platform with all possible virtio devices

Test Target

Devices needed

name "vhost-scsi", bus virtio-bus
name "vhost-user-blk", bus virtio-bus
name "vhost-user-scsi", bus virtio-bus
name "virtio-blk-device", bus virtio-bus