From 4e164c6d95bbb09f904b7e77eca66fbceea121cb Mon Sep 17 00:00:00 2001 From: copy Date: Sun, 2 Apr 2017 15:20:55 -0500 Subject: [PATCH] Add kvm-unit-test (#129) --- Readme.md | 1 + src/browser/main.js | 36 ++++++++++++++++++++++++++++++++++++ tests/Readme.md | 2 ++ 3 files changed, 39 insertions(+) diff --git a/Readme.md b/Readme.md index 7f2e55c5..042b4291 100644 --- a/Readme.md +++ b/Readme.md @@ -159,6 +159,7 @@ Credits - - CPU test cases via QEMU, http://wiki.qemu.org/Main_Page +- More tests via [kvm-unit-tests](https://www.linux-kvm.org/page/KVM-unit-tests) - [Disk Images](https://github.com/copy/images) - [The jor1k project](https://github.com/s-macke/jor1k) for 9p, filesystem and uart drivers - [WinWorld](https://winworldpc.com/) sources of some old operating systems diff --git a/src/browser/main.js b/src/browser/main.js index 72390313..dbe5396f 100644 --- a/src/browser/main.js +++ b/src/browser/main.js @@ -399,6 +399,42 @@ }, ]; + if(DEBUG) + { + // see tests/kvm-unit-tests/x86/ + var tests = [ + "realmode", + // All tests below require an APIC + "cmpxchg8b", + "port80", + "setjmp", + "sieve", + "hypercall", // crashes + "init", // stops execution + "msr", // TODO: Expects 64 bit msrs + "smap", // test stops, SMAP not enabled + "tsc_adjust", // TODO: IA32_TSC_ADJUST + "tsc", // TODO: rdtscp + "rmap_chain", // crashes + "memory", // missing mfence (uninteresting) + "taskswitch", // TODO: Jump + "taskswitch2", // TODO: Call TSS + "eventinj", // Missing #nt + "ioapic", + "apic", + ]; + + for(let test of tests) + { + oses.push({ + name: "Test case: " + test, + id: "test-" + test, + memory_size: 128 * 1024 * 1024, + multiboot: { "url": "tests/kvm-unit-tests/x86/" + test + ".flat", } + }); + } + } + var query_args = get_query_arguments(); var profile = query_args["profile"]; diff --git a/tests/Readme.md b/tests/Readme.md index 11538708..55ae9f92 100644 --- a/tests/Readme.md +++ b/tests/Readme.md @@ -5,5 +5,7 @@ A couple of test cases. - [qemu](qemu/): Builds a Linux binary, which tests many CPU features. Needs to be manually put on a Linux image and run in the emulator. This test is contained in the `linux.iso` image and automatically run in the full test. +- [kvm-unit-test](kvm-unit-test/): Based on tests from the KVM project, tests + various CPU features. - [perf-irhydra](perf-irhydra/): Manual performance test. Probably not interesting for you.