Skip to content

Instantly share code, notes, and snippets.

diff --git a/virtcontainers/utils/utils_linux.go b/virtcontainers/utils/utils_linux.go
index 31cb7d1..5f16aba 100644
--- a/virtcontainers/utils/utils_linux.go
+++ b/virtcontainers/utils/utils_linux.go
@@ -6,9 +6,9 @@
package utils
import (
- "crypto/rand"
+// "crypto/rand"
tools/devtool build -- --features vsock

Enable Kata open tracing support

$ grep enable_tracing /usr/share/defaults/kata-containers/configuration.toml
enable_tracing = true

Start the all-in-one Jaeger Docker container

docker run -d --name jaeger \
curl --unix-socket /tmp/firecracker.sock -i \
    -X PUT 'http://localhost/boot-source'   \
    -H 'Accept: application/json'           \
    -H 'Content-Type: application/json'     \
    -d '{
        "kernel_image_path": "/home/samuel/devlp/hypervisor/firecracker-data/hello-vmlinux.bin",
        "boot_args": "console=ttyS0 reboot=k panic=1 pci=off"
    }'
#define ACPI_PROCESSOR_OBJECT_HID "LNXCPU"
#define ACPI_PROCESSOR_DEVICE_HID "ACPI0007"
static const struct acpi_device_id processor_device_ids[] = {
{ ACPI_PROCESSOR_OBJECT_HID, },
{ ACPI_PROCESSOR_DEVICE_HID, },
{ }
};
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
OPTS=`getopt -o b:e:f:i:k:m: --long binary:,exit:,firmware:,iterations:,kernel:,machine: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
eval set -- "$OPTS"
@sameo
sameo / qemu-upstream.md
Last active November 29, 2018 14:43
QEMU upstream submission scripts

Get maintainers

git diff --cached | ./scripts/get_maintainer.pl --nol | cut -d '(' -f 1 | awk '$0="Cc: "$0' | sed -e 's/[[:space:]]*$//'

git-request-pull

git request-pull upstream/master https://github.com/intel/nemu topic/upstream/acpi

Poor man's QEMU boot time benchmark

The idea is to add dummy IO port writes in the firmware, kernel and guest OS that will trigger VM exits. One can then ftrace those from the host and get kernel timestamp for each and every one of them.

This is very limited and only provides boot time stamps but allows to measure both the guest kernel and firmware boot times.

In this example we're using 0xf4 as the dummy port, and I patched the guest OVMF and kernel.

OVMF patch

accel/accel.c
accel/hw/boards.h
accel/hw/xen/xen.h
accel/kvm/exec/gdbstub.h
accel/kvm/exec/memory.h
accel/kvm/exec/ram_addr.h
accel/kvm/hw/hw.h
accel/kvm/kvm-all.c
accel/kvm/sev-stub.c
accel/kvm/sysemu/cpus.h
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.18.0 Kernel Configuration
#
#
# Compiler: gcc (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5)
#
CONFIG_64BIT=y
CONFIG_X86_64=y