All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH kvm-unit-tests 0/2] remove tss_descr, replace with a function
@ 2021-10-20 16:53 Paolo Bonzini
  2021-10-20 16:53 ` [PATCH kvm-unit-tests 1/2] unify structs for GDT descriptors Paolo Bonzini
  2021-10-20 16:53 ` [PATCH kvm-unit-tests 2/2] replace tss_descr global with a function Paolo Bonzini
  0 siblings, 2 replies; 7+ messages in thread
From: Paolo Bonzini @ 2021-10-20 16:53 UTC (permalink / raw)
  To: kvm; +Cc: zxwang42, marcorr, seanjc, jroedel, varad.gautam

tss_descr is declared as a struct descriptor_table_ptr but it is actualy
pointing to an _entry_ in the GDT.  Also it is different per CPU, but
tss_descr does not recognize that.  Fix both by reusing the code
(already present e.g. in the vmware_backdoors test) that extracts
the base from the GDT entry; and also provide a helper to retrieve
the limit, which is needed in vmx.c.

Patch 1 adjusts the structs for GDT descriptors, so that the same
code works for both 32-bit and 64-bit (apart from the high 32 bits
of the base field).

Paolo

Paolo Bonzini (2):
  unify structs for GDT descriptors
  replace tss_descr global with a function

 lib/x86/desc.c         | 26 +++++++++++--------
 lib/x86/desc.h         | 58 ++++++++++++++++++++++++++++++++++--------
 x86/cstart64.S         |  1 -
 x86/svm_tests.c        | 15 +++--------
 x86/taskswitch.c       |  2 +-
 x86/vmware_backdoors.c | 22 +++++-----------
 x86/vmx.c              |  9 ++++---
 7 files changed, 78 insertions(+), 55 deletions(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-20 20:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 16:53 [PATCH kvm-unit-tests 0/2] remove tss_descr, replace with a function Paolo Bonzini
2021-10-20 16:53 ` [PATCH kvm-unit-tests 1/2] unify structs for GDT descriptors Paolo Bonzini
2021-10-20 17:58   ` Sean Christopherson
2021-10-20 19:10     ` Paolo Bonzini
2021-10-20 20:05   ` Jim Mattson
2021-10-20 16:53 ` [PATCH kvm-unit-tests 2/2] replace tss_descr global with a function Paolo Bonzini
2021-10-20 18:01   ` Sean Christopherson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.