All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 kvm-unit-tests 0/8] x86: Move IDT, GDT and TSS to C code
@ 2021-10-21 11:49 Paolo Bonzini
  2021-10-21 11:49 ` [PATCH kvm-unit-tests 1/9] x86: cleanup handling of 16-byte GDT descriptors Paolo Bonzini
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Paolo Bonzini @ 2021-10-21 11:49 UTC (permalink / raw)
  To: kvm
  Cc: aaronlewis, jmattson, zxwang42, marcorr, seanjc, jroedel, varad.gautam

Patches 1-4 clean up tss_descr; it 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.

Patches 5-9 move the IDT, GDT and TSS to C code.  This was originally done
by Zixuan Wang for the UEFI port, which is 64-bit only.  The series extends
this to 32-bit code for consistency and to avoid duplicating code between
C and assembly.

Paolo

v2->v3: cleaned up handling of 16 byte descriptors (new patch 1)
	get TR limit from GDT
	rename high four bits of segment limit to "limit2"
	included Zixuan's work to port GDT/TSS/IDT to C, extended to 32-bit

Paolo Bonzini (8):
  x86: cleanup handling of 16-byte GDT descriptors
  x86: fix call to set_gdt_entry
  unify field names and definitions for GDT descriptors
  replace tss_descr global with a function
  x86: Move IDT to desc.c
  x86: unify name of 32-bit and 64-bit GDT
  x86: get rid of ring0stacktop
  x86: Move 32-bit GDT and TSS to desc.c

Zixuan Wang (1):
  x86: Move 64-bit GDT and TSS to desc.c

 lib/x86/asm/setup.h    |   6 +++
 lib/x86/desc.c         | 116 +++++++++++++++++++++++++++++++++++------
 lib/x86/desc.h         |  31 +++++------
 lib/x86/setup.c        |  49 +++++++++++++++++
 lib/x86/usermode.c     |   9 ++--
 x86/access.c           |  16 +++---
 x86/cstart.S           | 115 ++++++----------------------------------
 x86/cstart64.S         |  97 ++++------------------------------
 x86/smap.c             |   2 +-
 x86/svm_tests.c        |  15 ++----
 x86/taskswitch.c       |   4 +-
 x86/umip.c             |  19 ++++---
 x86/vmware_backdoors.c |  22 +++-----
 x86/vmx.c              |  17 +++---
 x86/vmx_tests.c        |   4 +-
 15 files changed, 244 insertions(+), 278 deletions(-)
 create mode 100644 lib/x86/asm/setup.h

-- 
2.27.0


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

end of thread, other threads:[~2021-11-30 17:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 11:49 [PATCH v3 kvm-unit-tests 0/8] x86: Move IDT, GDT and TSS to C code Paolo Bonzini
2021-10-21 11:49 ` [PATCH kvm-unit-tests 1/9] x86: cleanup handling of 16-byte GDT descriptors Paolo Bonzini
2021-11-29 21:46   ` Marc Orr
2021-11-30 10:55     ` Paolo Bonzini
2021-11-30 17:22       ` Marc Orr
2021-11-30 17:26         ` Paolo Bonzini
2021-10-21 11:49 ` [PATCH kvm-unit-tests 2/9] x86: fix call to set_gdt_entry Paolo Bonzini
2021-10-21 11:49 ` [PATCH kvm-unit-tests 3/9] unify field names and definitions for GDT descriptors Paolo Bonzini
2021-10-21 11:49 ` [PATCH kvm-unit-tests 4/9] replace tss_descr global with a function Paolo Bonzini
2021-10-21 11:49 ` [PATCH kvm-unit-tests 5/9] x86: Move IDT to desc.c Paolo Bonzini
2021-10-21 11:49 ` [PATCH kvm-unit-tests 6/9] x86: unify name of 32-bit and 64-bit GDT Paolo Bonzini
2021-10-21 11:49 ` [PATCH kvm-unit-tests 7/9] x86: get rid of ring0stacktop Paolo Bonzini
2021-10-21 23:08   ` Aaron Lewis
2021-10-21 11:49 ` [PATCH kvm-unit-tests 8/9] x86: Move 64-bit GDT and TSS to desc.c Paolo Bonzini
2021-10-21 11:49 ` [PATCH kvm-unit-tests 9/9] x86: Move 32-bit " Paolo Bonzini
2021-10-21 14:37 ` [PATCH v3 kvm-unit-tests 0/8] x86: Move IDT, GDT and TSS to C code Paolo Bonzini

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.