diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-07-28 18:09:44 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-08-06 17:32:02 +0200 |
commit | 2305339ee7129d9d56af3bdd4d59aff4d29ed390 (patch) | |
tree | 4f3fdd0a7e31a8b7f2ebf9f68221898aa043f24c /tools/testing/selftests/kvm/include/kvm_util.h | |
parent | 44883f01fe6ae436a8604c47d8435276fef369b0 (diff) | |
download | linux-2305339ee7129d9d56af3bdd4d59aff4d29ed390.tar.gz linux-2305339ee7129d9d56af3bdd4d59aff4d29ed390.tar.bz2 linux-2305339ee7129d9d56af3bdd4d59aff4d29ed390.zip |
kvm: selftests: create a GDT and TSS
The GDT and the TSS base were left to zero, and this has interesting effects
when the TSS descriptor is later read to set up a VMCS's TR_BASE. Basically
it worked by chance, and this patch fixes it by setting up all the protected
mode data structures properly.
Because the GDT and TSS addresses are virtual, the page tables now always
exist at the time of vcpu setup.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/kvm_util.h')
-rw-r--r-- | tools/testing/selftests/kvm/include/kvm_util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h index 637b7017b6ee..87e05664c7f9 100644 --- a/tools/testing/selftests/kvm/include/kvm_util.h +++ b/tools/testing/selftests/kvm/include/kvm_util.h @@ -75,7 +75,7 @@ void vcpu_ioctl(struct kvm_vm *vm, uint32_t vcpuid, unsigned long ioctl, void *arg); void vm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg); void vm_mem_region_set_flags(struct kvm_vm *vm, uint32_t slot, uint32_t flags); -void vm_vcpu_add(struct kvm_vm *vm, uint32_t vcpuid); +void vm_vcpu_add(struct kvm_vm *vm, uint32_t vcpuid, int pgd_memslot, int gdt_memslot); vm_vaddr_t vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min, uint32_t data_memslot, uint32_t pgd_memslot); void *addr_gpa2hva(struct kvm_vm *vm, vm_paddr_t gpa); |