KVM: selftests: Add and use a helper function for x86's LIDT
authorIvan Orlov <iorlov@amazon.com>
Tue, 17 Dec 2024 18:14:57 +0000 (18:14 +0000)
committerSean Christopherson <seanjc@google.com>
Wed, 18 Dec 2024 23:14:46 +0000 (15:14 -0800)
commit4e9427aeb9572a4023b42e64ca2cd2ca3cbf7e20
tree7f6174c606b7deb3693bf46e8d1d57882efe3adc
parent7bd7ff99110a2f63f758b292ab762cad16b85656
KVM: selftests: Add and use a helper function for x86's LIDT

Implement a function for setting the IDT descriptor from the guest
code. Replace the existing lidt occurrences with calls to this function
as `lidt` is used in multiple places.

Signed-off-by: Ivan Orlov <iorlov@amazon.com>
Link: https://lore.kernel.org/r/20241217181458.68690-7-iorlov@amazon.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/x86/processor.h
tools/testing/selftests/kvm/set_memory_region_test.c
tools/testing/selftests/kvm/x86/sev_smoke_test.c