mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-30 00:00:15 +01:00
fix incompatibility issues to KVM API on a x86_64 processors
This commit is contained in:
parent
7a6b06cb91
commit
15b5495f31
1 changed files with 13 additions and 0 deletions
|
@ -602,6 +602,17 @@ int uhyve_init(char *path)
|
|||
/* Create the virtual machine */
|
||||
vmfd = kvm_ioctl(kvm, KVM_CREATE_VM, 0);
|
||||
|
||||
#ifdef __x86_64__
|
||||
init_kvm_arch();
|
||||
if (restart) {
|
||||
if (load_checkpoint(guest_mem, path) != 0)
|
||||
exit(EXIT_FAILURE);
|
||||
} else {
|
||||
if (load_kernel(guest_mem, path) != 0)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
pthread_barrier_init(&barrier, NULL, ncores);
|
||||
cpuid = 0;
|
||||
|
||||
|
@ -664,6 +675,7 @@ int uhyve_loop(int argc, char **argv)
|
|||
|
||||
pthread_barrier_wait(&barrier);
|
||||
|
||||
#ifdef __aarch64__
|
||||
init_kvm_arch();
|
||||
if (restart) {
|
||||
if (load_checkpoint(guest_mem, guest_path) != 0)
|
||||
|
@ -672,6 +684,7 @@ int uhyve_loop(int argc, char **argv)
|
|||
if (load_kernel(guest_mem, guest_path) != 0)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
*((uint32_t*) (mboot+0x24)) = ncores;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue