aboutsummaryrefslogtreecommitdiffstats
path: root/executor/test_kvm.cc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-01-12 11:57:17 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-01-12 11:57:17 +0100
commitff8c0180ab432ad1bf8671407f828078cda86551 (patch)
treef2f6472e985c51cbf8125198cd562db715d69468 /executor/test_kvm.cc
parentbcfae12bec951e6e4261a9910eab4b971f767329 (diff)
sys, executor: more kvm improvements
1. Basic support for arm64 kvm testing. 2. Fix compiler warnings in x86 kvm code. 3. Test all pseudo syz calls in csource. 4. Fix handling of real code in x86.
Diffstat (limited to 'executor/test_kvm.cc')
-rw-r--r--executor/test_kvm.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/executor/test_kvm.cc b/executor/test_kvm.cc
index ac696204b..4d990dc19 100644
--- a/executor/test_kvm.cc
+++ b/executor/test_kvm.cc
@@ -108,16 +108,18 @@ extern "C" int test_kvm()
//if (res = test_one(32, text32_div0, sizeof(text32_div0)-1, 0, KVM_EXIT_HLT, true))
// return res;
- const char text16[] = "\x66\xb8\xde\xc0\xad\x0b";
- if (res = test_one(16, text16, sizeof(text16) - 1, 0, KVM_EXIT_HLT, true))
+ const char text8[] = "\x66\xb8\xde\xc0\xad\x0b";
+ if (res = test_one(8, text8, sizeof(text8) - 1, 0, KVM_EXIT_HLT, true))
return res;
- if (res = test_one(16, text16, sizeof(text16) - 1, KVM_SETUP_PROTECTED, KVM_EXIT_HLT, true))
+ if (res = test_one(8, text8, sizeof(text8) - 1, KVM_SETUP_VIRT86, KVM_EXIT_SHUTDOWN, true))
return res;
- if (res = test_one(16, text16, sizeof(text16) - 1, KVM_SETUP_CPL3, KVM_EXIT_SHUTDOWN, true))
+ if (res = test_one(8, text8, sizeof(text8) - 1, KVM_SETUP_VIRT86 | KVM_SETUP_PAGING, KVM_EXIT_SHUTDOWN, true))
return res;
- if (res = test_one(16, text16, sizeof(text16) - 1, KVM_SETUP_VIRT86, KVM_EXIT_SHUTDOWN, true))
+
+ const char text16[] = "\x66\xb8\xde\xc0\xad\x0b";
+ if (res = test_one(16, text16, sizeof(text16) - 1, 0, KVM_EXIT_HLT, true))
return res;
- if (res = test_one(16, text16, sizeof(text16) - 1, KVM_SETUP_VIRT86 | KVM_SETUP_PAGING, KVM_EXIT_SHUTDOWN, true))
+ if (res = test_one(16, text16, sizeof(text16) - 1, KVM_SETUP_CPL3, KVM_EXIT_SHUTDOWN, true))
return res;
const char text32[] = "\xb8\xde\xc0\xad\x0b";
@@ -142,14 +144,14 @@ extern "C" int test_kvm()
// Note: SMM does not work on 3.13 kernels.
if (ver >= 404) {
- const char text16_smm[] = "\x66\xb8\xde\xc0\xad\x0b";
- if (res = test_one(16, text16_smm, sizeof(text16_smm) - 1, KVM_SETUP_SMM, KVM_EXIT_HLT, true))
+ const char text8_smm[] = "\x66\xb8\xde\xc0\xad\x0b";
+ if (res = test_one(8, text8_smm, sizeof(text8_smm) - 1, KVM_SETUP_SMM, KVM_EXIT_HLT, true))
return res;
- if (res = test_one(16, text16_smm, sizeof(text16_smm) - 1, KVM_SETUP_SMM | KVM_SETUP_PROTECTED, KVM_EXIT_HLT, true))
+ if (res = test_one(8, text8_smm, sizeof(text8_smm) - 1, KVM_SETUP_SMM | KVM_SETUP_PROTECTED, KVM_EXIT_HLT, true))
return res;
//const char text32_smm[] = "\xb8\xde\xc0\xad\x0b";
- if (res = test_one(32, text16_smm, sizeof(text16_smm) - 1, KVM_SETUP_SMM, KVM_EXIT_HLT, true))
+ if (res = test_one(32, text8_smm, sizeof(text8_smm) - 1, KVM_SETUP_SMM, KVM_EXIT_HLT, true))
return res;
// Also ensure that we are actually in SMM.