All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/6] Reuse 32 bit C code more safely
@ 2024-10-14  8:53 Frediano Ziglio
  2024-10-14  8:53 ` [PATCH v4 1/6] x86/boot: Prep work for 32bit object changes Frediano Ziglio
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Frediano Ziglio @ 2024-10-14  8:53 UTC (permalink / raw)
  To: xen-devel
  Cc: Frediano Ziglio, Jan Beulich, Andrew Cooper, Roger Pau Monné,
	Julien Grall, Stefano Stabellini, Daniel P. Smith,
	Marek Marczykowski-Górecki

This series attempt to:
- use more C code, that is replace some assembly code with C;
- avoid some code duplication between C and assembly;
- prevent some issues having relocations in C code.

The idea is extending the current C to binary code conversion
done for 32 bit C code called from head.S making sure relocations
are safe and allowing external symbols usage from C code.

More details of the implementation are in commit message 2/6,
which is the largest patch.
Patch 3/6 reuses code to relocate the trampoline between 32 and 64 bit.
Patches 4/6 and 5/6 move some code from assembly to C.

Other RFC commits were excluded, I didn't manage to entangle the issues
sharing headers between 32 and 64 bits.
Since RFC code was more tested, also with CI and some incompatibility
were fixed. On that it's weird that we need Python 3.8 for Qemu but we
still use Python 2 for Xen. Shouldn't we bump requirement to Python 3
even for Xen?

Code boots successfully using:
- BIOS boot;
- EFI boot with Grub2 and ELF file;
- direct EFI boot without Grub.

Code is currently based on "master" branch, currently commit
76a54badf890f56ff72644593c0fbc72138e13aa.

Changes since v1:
- 2 preliminary commits for adjust .gitignore;
- last commit split (one variable at a time);
- lot of style and names changes;
- first commit, now 3/6 had some build changes, more details on
  commit message.

Changes since v2:
- removed merged commits;
- reverted order of 2 commits;
- remove some useless casts;
- added change to comment.

Changes since v3:
- added a preparation commit for Makefiles (mainly written by Andrew Cooper);
- added a comment improvement commit;
- allows also data;
- other minor style changes;
- added some Reviewed-by.

Frediano Ziglio (6):
  x86/boot: Prep work for 32bit object changes
  x86/boot: create a C bundle for 32 bit boot code and use it
  x86/boot: Reuse code to relocate trampoline
  x86/boot: Use boot_vid_info variable directly from C code
  x86/boot: Use trampoline_phys variable directly from C code
  x86/boot: Clarify comment

 xen/arch/x86/boot/.gitignore                  |   5 +-
 xen/arch/x86/boot/Makefile                    |  61 ++++--
 .../x86/boot/{build32.lds => build32.lds.S}   |  41 +++-
 xen/arch/x86/boot/cmdline.c                   |  12 -
 xen/arch/x86/boot/head.S                      |  49 +----
 xen/arch/x86/boot/reloc-trampoline.c          |  36 +++
 xen/arch/x86/boot/reloc.c                     |  35 +--
 xen/arch/x86/efi/efi-boot.h                   |  15 +-
 xen/tools/combine_two_binaries.py             | 207 ++++++++++++++++++
 9 files changed, 341 insertions(+), 120 deletions(-)
 rename xen/arch/x86/boot/{build32.lds => build32.lds.S} (63%)
 create mode 100644 xen/arch/x86/boot/reloc-trampoline.c
 create mode 100755 xen/tools/combine_two_binaries.py

-- 
2.34.1



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

end of thread, other threads:[~2024-10-17 12:37 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-14  8:53 [PATCH v4 0/6] Reuse 32 bit C code more safely Frediano Ziglio
2024-10-14  8:53 ` [PATCH v4 1/6] x86/boot: Prep work for 32bit object changes Frediano Ziglio
2024-10-15  6:44   ` Jan Beulich
2024-10-14  8:53 ` [PATCH v4 2/6] x86/boot: create a C bundle for 32 bit boot code and use it Frediano Ziglio
2024-10-14 15:31   ` Anthony PERARD
2024-10-14 15:46     ` Jan Beulich
2024-10-14 15:52     ` Andrew Cooper
2024-10-14 16:32     ` Frediano Ziglio
2024-10-15  5:59       ` Jan Beulich
2024-10-15 13:51       ` Anthony PERARD
2024-10-16  8:33         ` Frediano Ziglio
2024-10-16 11:25           ` Anthony PERARD
2024-10-16 15:05             ` Frediano Ziglio
2024-10-17 10:58               ` Frediano Ziglio
2024-10-17 11:01                 ` Andrew Cooper
2024-10-17 12:36               ` Anthony PERARD
2024-10-15 13:54   ` Andrew Cooper
2024-10-14  8:53 ` [PATCH v4 3/6] x86/boot: Reuse code to relocate trampoline Frediano Ziglio
2024-10-15 15:03   ` Anthony PERARD
2024-10-14  8:53 ` [PATCH v4 4/6] x86/boot: Use boot_vid_info variable directly from C code Frediano Ziglio
2024-10-14  8:53 ` [PATCH v4 5/6] x86/boot: Use trampoline_phys " Frediano Ziglio
2024-10-14  8:53 ` [PATCH v4 6/6] x86/boot: Clarify comment Frediano Ziglio

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.