tools/devtool build -- --features vsock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
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"
}'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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, }, | |
{ } | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 |