Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions os/axvisor/configs/vms/linux-x86_64-qemu-smp1-svm.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Vm base info configs
#
[base]
# Guest vm id.
id = 1
# Guest vm name.
name = "linux-x86_64-qemu-svm"
# Virtualization type.
vm_type = 1
# The number of virtual CPUs.
cpu_num = 1
# Guest vm physical cpu sets.
phys_cpu_sets = [1]

#
# Vm kernel configs
#
[kernel]
# The entry point of the kernel image.
# Linux direct boot uses the Linux-specific boot stub at this GPA.
entry_point = 0x8000
# The location of image: "memory" | "fs".
image_location = "fs"
# The file path of the kernel image.
kernel_path = "/guest/linux/linux-qemu"
# The load address of the kernel image.
kernel_load_addr = 0x20_0000
# Whether to enable BIOS boot flow.
enable_bios = false
# SVM phase-1 smoke keeps a dedicated command line so later stages can
# adjust SVM bring-up independently from the VMX baseline.
cmdline = "console=ttyS0 root=/dev/vda rw rootwait devtmpfs.mount=1 init=/sbin/getty acpi=off pci=conf1 pci=nomsi nox2apic tsc=unstable initcall_blacklist=ahci_pci_driver_init,i8042_init -- -n -l /bin/sh -L 115200 ttyS0 dumb"

## The path of the disk image.
# disk_path = ""

# Memory regions with format (`base_paddr`, `size`, `flags`, `map_type`).
# For `map_type`, 0 means `MAP_ALLOC`, 1 means `MAP_IDENTICAL`, 2 means `MAP_RESERVED`.
memory_regions = [
[0x0000_0000, 0x0800_0000, 0x7, 1], # System RAM 128M MAP_IDENTICAL for DMA-capable passthrough
[0x0000_0000, 0x0010_0000, 0x7, 0], # Low boot scratch for real-mode stub and boot_params
]

#
# Device specifications
#
[devices]
# The interrupt mode.
interrupt_mode = "passthrough"

# Emu_devices.
# Name Base-Ipa Ipa_len Alloc-Irq Emu-Type EmuConfig.
emu_devices = [
["x86-com1", 0x3f8, 0x8, 0x0, 0x2, []],
["x86-ioapic", 0xfec0_0000, 0x1000, 0x0, 0x23, []],
["x86-pit", 0x40, 0x22, 0x0, 0x24, []],
]

# Pass-through devices.
# Name Base-Ipa Base-Pa Length Alloc-Irq.
passthrough_devices = [
[
"HPET",
0xfed0_0000,
0xfed0_0000,
0x1000,
0x1,
],
]

# Passthrough addresses.
# Base-GPA Length.
passthrough_addresses = [
# QEMU q35 low MMIO window needed by PCI/virtio-blk probing.
[0xfe00_0000, 0x00c0_0000],
# Linux probes a q35/ICH system MMIO page at 0xfed8_03c0 after the PIT/HLT path is fixed.
[0xfed8_0000, 0x1000],
]

# Devices that are not desired to be passed through to the guest
excluded_devices = []
1 change: 0 additions & 1 deletion os/axvisor/src/vmm/devices/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const IOAPIC_VECTOR_END: usize = IOAPIC_VECTOR_BASE + IOAPIC_GSI_COUNT;

const PIT_TIMER_GSI: usize = 0;
const COM1_GSI: usize = 4;

static IOAPIC_IRQ_FORWARDING_ENABLED: AtomicBool = AtomicBool::new(false);
static IOAPIC_IRQ_HOOK_REGISTERED: AtomicBool = AtomicBool::new(false);
static IOAPIC_IRQ_FORWARD_VM_ID: AtomicUsize = AtomicUsize::new(usize::MAX);
Expand Down
1 change: 1 addition & 0 deletions os/axvisor/src/vmm/vcpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ fn vcpu_run() {
}
}
AxVCpuExitReason::PreemptionTimer => {
super::timer::check_events();
#[cfg(target_arch = "x86_64")]
super::devices::x86::inject_due_pit_irq0(&vm, &vcpu);
#[cfg(target_arch = "x86_64")]
Expand Down
2 changes: 1 addition & 1 deletion test-suit/axvisor/svm/qemu/build-x86_64-unknown-none.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ features = [
]
log = "Info"
target = "x86_64-unknown-none"
vm_configs = ["os/axvisor/configs/vms/nimbos-x86_64-qemu-smp1.toml"]
vm_configs = ["os/axvisor/configs/vms/linux-x86_64-qemu-smp1-svm.toml"]
22 changes: 15 additions & 7 deletions test-suit/axvisor/svm/qemu/smoke/qemu-x86_64.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
args = [
"-nographic",
"-nodefaults",
"-no-user-config",
"-display",
"none",
"-serial",
"stdio",
"-monitor",
"none",
"-cpu",
"host",
"-machine",
"q35",
"q35,sata=off,smbus=off,i8042=off,usb=off,graphics=off",
"-smp",
"1",
"-accel",
"kvm",
"-device",
"virtio-blk-pci,drive=disk0",
"virtio-blk-pci,drive=disk0,addr=03.0",
"-drive",
"id=disk0,if=none,format=raw,file=${workspace}/tmp/axbuild/rootfs/rootfs-x86_64-alpine.img",
"-m",
"128M",
"512M",
]
timeout = 180
fail_regex = [
"(?i)\\bpanic(?:ked)?\\b",
"(?i)kernel panic",
"(?i)login incorrect",
"(?i)permission denied",
]
success_regex = ["Hello world from user mode program!"]
shell_prefix = ">>"
shell_init_cmd = "hello_world"
success_regex = ["(?m)^guest linux test pass!\\s*$"]
shell_prefix = "~ #"
shell_init_cmd = "pwd && echo 'guest linux test pass!'"
to_bin = false
uefi = false
Loading