All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH v2 0/6] Initial x86_64 UEFI support
@ 2021-08-19 11:33 Varad Gautam
  2021-08-19 11:33 ` [kvm-unit-tests PATCH v2 1/6] x86: Build tests as PE objects for the EFI loader Varad Gautam
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Varad Gautam @ 2021-08-19 11:33 UTC (permalink / raw)
  To: Zixuan Wang, Nadav Amit, Marc Orr, Joerg Roedel, kvm list,
	Linux Virtualization, Paolo Bonzini, Andrew Jones, bp,
	Thomas.Lendacky, brijesh.singh, Hyunwook Baek, Erdem Aktas,
	Tom Roeder
  Cc: Varad Gautam

This series brings EFI support to kvm-unit-tests on x86_64.

EFI support works by changing the test entrypoint to a stub entry
point for the EFI loader to jump to in long mode, where the test binary
exits EFI boot services, performs the remaining CPU bootstrapping,
and then calls the testcase main().

Since the EFI loader only understands PE objects, the first commit
introduces a `configure --efi` mode which builds each test as a shared
lib. This shared lib is repackaged into a PE via objdump.

Commit 2-4 take a trip from the asm entrypoint to C to exit EFI and
relocate ELF .dynamic contents.

Commit 5 adds post-EFI long mode x86_64 setup and calls the testcase.

Commit 6 from Zixuan [1] fixes up some testcases with non-PIC inline
asm stubs which allows building these as PIC.

Changes in v2:
- Add Zixuan's patch to enable more testcases.
- Fix TSS setup in cstart64.S for CONFIG_EFI.

[1]: https://lore.kernel.org/r/20210818000905.1111226-10-zixuanwang@google.com/
git tree: https://github.com/varadgautam/kvm-unit-tests/tree/efi-stub-v2

Varad Gautam (5):
  x86: Build tests as PE objects for the EFI loader
  x86: Call efi_main from _efi_pe_entry
  x86: efi_main: Get EFI memory map and exit boot services
  x86: efi_main: Self-relocate ELF .dynamic addresses
  cstart64.S: x86_64 bootstrapping after exiting EFI

Zixuan Wang (1):
  x86 UEFI: Convert x86 test cases to PIC

 .gitignore          |   2 +
 Makefile            |  16 +-
 configure           |  11 +
 lib/linux/uefi.h    | 518 ++++++++++++++++++++++++++++++++++++++++++++
 lib/x86/usermode.c  |   3 +-
 x86/Makefile.common |  53 +++--
 x86/Makefile.x86_64 |  52 +++--
 x86/access.c        |   6 +-
 x86/cet.c           |   8 +-
 x86/cstart64.S      |  91 ++++++++
 x86/efi.lds         |  67 ++++++
 x86/efi_main.c      | 167 ++++++++++++++
 x86/emulator.c      |   5 +-
 x86/eventinj.c      |   6 +-
 x86/smap.c          |   8 +-
 x86/umip.c          |  10 +-
 16 files changed, 966 insertions(+), 57 deletions(-)
 create mode 100644 lib/linux/uefi.h
 create mode 100644 x86/efi.lds
 create mode 100644 x86/efi_main.c

-- 
2.30.2


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

end of thread, other threads:[~2021-08-24 22:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 11:33 [kvm-unit-tests PATCH v2 0/6] Initial x86_64 UEFI support Varad Gautam
2021-08-19 11:33 ` [kvm-unit-tests PATCH v2 1/6] x86: Build tests as PE objects for the EFI loader Varad Gautam
2021-08-19 11:33 ` [kvm-unit-tests PATCH v2 2/6] x86: Call efi_main from _efi_pe_entry Varad Gautam
2021-08-24 22:08   ` Krish Sadhukhan
2021-08-19 11:33 ` [kvm-unit-tests PATCH v2 3/6] x86: efi_main: Get EFI memory map and exit boot services Varad Gautam
2021-08-24 22:10   ` Krish Sadhukhan
2021-08-19 11:33 ` [kvm-unit-tests PATCH v2 4/6] x86: efi_main: Self-relocate ELF .dynamic addresses Varad Gautam
2021-08-24 22:10   ` Krish Sadhukhan
2021-08-19 11:33 ` [kvm-unit-tests PATCH v2 5/6] cstart64.S: x86_64 bootstrapping after exiting EFI Varad Gautam
2021-08-24 22:11   ` Krish Sadhukhan
2021-08-19 11:34 ` [kvm-unit-tests PATCH v2 6/6] x86 UEFI: Convert x86 test cases to PIC Varad Gautam
2021-08-24 22:12   ` Krish Sadhukhan
2021-08-21  0:01 ` [kvm-unit-tests PATCH v2 0/6] Initial x86_64 UEFI support Sean Christopherson
2021-08-21  0:42   ` Zixuan Wang

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.