OSDN Git Service

kvm: selftests: create a GDT and TSS
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 28 Jul 2018 16:09:44 +0000 (18:09 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 6 Aug 2018 15:32:02 +0000 (17:32 +0200)
commit2305339ee7129d9d56af3bdd4d59aff4d29ed390
tree4f3fdd0a7e31a8b7f2ebf9f68221898aa043f24c
parent44883f01fe6ae436a8604c47d8435276fef369b0
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>
tools/testing/selftests/kvm/include/kvm_util.h
tools/testing/selftests/kvm/include/x86.h
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/kvm_util_internal.h
tools/testing/selftests/kvm/lib/x86.c