mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-30 23:00:29 +00:00
bbd4840872
Add new pseudo syscall syz_kvm_setup_cpu that setups VCPU into interesting states for execution. KVM is too difficult to setup otherwise. Lots of improvements possible, but this is a starting point.
34 lines
840 B
C++
34 lines
840 B
C++
// Copyright 2017 syzkaller project authors. All rights reserved.
|
|
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
|
|
|
// +build
|
|
|
|
#include <stdio.h>
|
|
|
|
#define PRINT(x) \
|
|
extern const unsigned char x[], x##_end[]; \
|
|
print(#x, x, x##_end);
|
|
|
|
void print(const char* name, const unsigned char* start, const unsigned char* end)
|
|
{
|
|
printf("const char %s[] = \"", name);
|
|
for (const unsigned char* p = start; p < end; p++)
|
|
printf("\\x%02x", *p);
|
|
printf("\";\n");
|
|
}
|
|
|
|
int main()
|
|
{
|
|
printf("// AUTOGENERATED FILE\n");
|
|
PRINT(kvm_asm16_cpl3);
|
|
PRINT(kvm_asm32_paged);
|
|
PRINT(kvm_asm32_vm86);
|
|
PRINT(kvm_asm32_paged_vm86);
|
|
PRINT(kvm_asm64_vm86);
|
|
PRINT(kvm_asm64_enable_long);
|
|
PRINT(kvm_asm64_init_vm);
|
|
PRINT(kvm_asm64_vm_exit);
|
|
PRINT(kvm_asm64_cpl3);
|
|
return 0;
|
|
}
|