Unverified Commit 842b6716 authored by bors[bot]'s avatar bors[bot] Committed by GitHub
Browse files

Merge #287

287: add CI tests for Qemu's micorvm r=stlankes a=stlankes

Qemu's microvm is a machine type inspired by Firecracker and constructed after its machine model

More information are published at https://qemu.readthedocs.io/en/latest/system/i386/microvm.html

Co-authored-by: Stefan Lankes's avatarStefan Lankes <slankes@eonerc.rwth-aachen.de>
Co-authored-by: Martin Kröning's avatarMartin Kröning <mkroening@posteo.net>
parents 4d5d5dac e322afa1
Pipeline #575129 passed with stages
in 13 minutes and 58 seconds
......@@ -85,3 +85,25 @@ jobs:
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr \
-kernel loader/target/x86_64-unknown-hermit-loader/release/rusty-loader \
-initrd target/x86_64-unknown-hermit/release/rusty_demo
- name: Build minimal profile
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cargo clean
cargo build --no-default-features --release -p hello_world
- name: Test minimal profile
id: minimal
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
FREQ=`grep 'cpu MHz' /proc/cpuinfo | head -1 | awk -F: '{print $2}' | awk '{printf("%d\n",$1 + 0.5)}'`
echo "FREQ = $FREQ"
qemu-system-x86_64 \
-M microvm,x-option-roms=off,pit=off,pic=off,rtc=on \
-global virtio-mmio.force-legacy=on -nodefaults -no-user-config \
-display none -smp 1 -m 64M -serial stdio \
-kernel loader/target/x86_64-unknown-hermit-loader/release/rusty-loader \
-initrd target/x86_64-unknown-hermit/release/hello_world \
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr \
-device isa-debug-exit,iobase=0xf4,iosize=0x04 \
-append "-freq $FREQ" \
|| qemu_status=$?
test $qemu_status -eq 3
......@@ -58,6 +58,7 @@ num = { version = "0.4", default-features = false }
num-derive = "0.3"
num-traits = { version = "0.2", default-features = false }
scopeguard = { version = "1.1", default-features = false }
qemu-exit = "2.0"
[target.'cfg(target_arch = "x86_64")'.dependencies]
multiboot = "0.7"
......@@ -72,9 +73,6 @@ x86 = { version = "0.43", default-features = false }
version = "0.0.6"
default-features = false
[target.'cfg(target_arch = "aarch64")'.dependencies]
qemu-exit = "2.0"
# The development profile, used for `cargo build`.
[profile.dev]
opt-level = 1 # controls the `--opt-level` the compiler builds with
......
......@@ -22,6 +22,7 @@ use core::arch::x86_64::{
use core::convert::TryInto;
use core::hint::spin_loop;
use core::{fmt, u32};
use qemu_exit::QEMUExit;
use x86::bits64::segmentation;
const IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP: u64 = 1 << 16;
......@@ -424,7 +425,7 @@ impl CpuFrequency {
.or_else(|_e| self.detect_from_cpuid_tsc_info(&cpuid))
.or_else(|_e| self.detect_from_cpuid_hypervisor_info(&cpuid))
.or_else(|_e| self.detect_from_hypervisor())
//.or_else(|_e| self.detect_from_cmdline())
.or_else(|_e| self.detect_from_cmdline())
.or_else(|_e| self.detect_from_cpuid_brand_string(&cpuid))
.or_else(|_e| self.measure_frequency())
.expect("Could not determine the processor frequency");
......@@ -965,9 +966,9 @@ pub fn shutdown() -> ! {
#[cfg(feature = "acpi")]
acpi::poweroff();
loop {
halt();
}
// assume that we running on Qemu
let exit_handler = qemu_exit::X86::new(0xf4, 3);
exit_handler.exit_success()
}
pub fn get_timer_ticks() -> u64 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment