xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH v3 0/5] Clean up x86_64 boot code
@ 2019-08-21 16:35 David Woodhouse
  2019-08-21 16:35 ` [Xen-devel] [PATCH v3 1/5] x86/boot: Only jump into low trampoline code for real-mode boot David Woodhouse
  0 siblings, 1 reply; 19+ messages in thread
From: David Woodhouse @ 2019-08-21 16:35 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Jan Beulich, Roger Pau Monné


[-- Attachment #1.1: Type: text/plain, Size: 3585 bytes --]

Some cleanups for the boot path, originally inspired by an attempt to
avoid scribbling on arbitrarily-chosen low memory.

In the no-real-mode case we don't need to bounce through low memory at
all; we can run the 32-bit trampoline in-place in the Xen image.

The variables containing information which is optionally discovered by
the real-mode boot code can be put back in place in the Xen image and we
can dispense with the bootsym() pointer gymnastics in C code which
access them in low memory.

I haven't yet got to reloc(), which I think exists only to ensure that
the various breadcrumbs left all over the place by the Multiboot
bootloader aren't scribbled on when we copy the 16-bit boot trampoline
into low memory. I'd quite like to kill reloc() and pass the original
pointer up to 64-bit code to be handled in C.

That would require finding a *safe* location to put the 16-bit boot
trampoline though, which doesn't already contain anything that the
bootloader created for us.

In fact, isn't there already a chance that head.S will choose a location
for the trampoline which is already part of a module or contains one of
the Multiboot breadcrumbs?

https://xenbits.xen.org/gitweb/?p=people/dwmw2/xen.git;a=shortlog;h=refs/heads/bootcleanup

v2: Patch #1 of the first series is already merged.
    Fold in minor fixup from Andrew to what is now patch #1.
    Verbally agree to overcome Jan's objections to patch #1, in Chicago.

v3: Another patch merged from v2 posting. And then there were five.
    Update to staging branch, especially commit c3cfa5b30 ("x86: Restore
      IA32_MISC_ENABLE on wakeup").
    Minor bikeshedding and commit comment improvements.
    Ignore Andy's conflicting cleanups except to use them as an excuse for
      not making the GDT sizing automatic as discussed.

David Woodhouse (5):
      x86/boot: Only jump into low trampoline code for real-mode boot
      x86/boot: Split bootsym() into four types of relocations
      x86/boot: Rename trampoline_{start,end} to boot_trampoline_{start,end}
      x86/boot: Copy 16-bit boot variables back up to Xen image
      x86/boot: Do not use trampoline for no-real-mode boot paths

 xen/arch/x86/acpi/power.c         |   6 +++---
 xen/arch/x86/boot/edd.S           |  18 ++++++++++--------
 xen/arch/x86/boot/head.S          |  89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
 xen/arch/x86/boot/mem.S           |  14 ++++++++------
 xen/arch/x86/boot/trampoline.S    | 146 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------
 xen/arch/x86/boot/video.S         |  36 +++++++++++++++++++-----------------
 xen/arch/x86/boot/wakeup.S        |  16 ++++++++--------
 xen/arch/x86/cpu/common.c         |   2 +-
 xen/arch/x86/cpu/intel.c          |   2 +-
 xen/arch/x86/efi/efi-boot.h       |  31 +++----------------------------
 xen/arch/x86/platform_hypercall.c |  18 +++++++++---------
 xen/arch/x86/setup.c              |  68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------
 xen/arch/x86/smpboot.c            |   6 +++---
 xen/arch/x86/tboot.c              |   6 +++---
 xen/arch/x86/x86_64/mm.c          |   2 +-
 xen/arch/x86/xen.lds.S            |  28 +++++++++++++++++++++-------
 xen/include/asm-x86/acpi.h        |   2 +-
 xen/include/asm-x86/config.h      |  12 ++++++------
 xen/include/asm-x86/edd.h         |   1 -
 19 files changed, 331 insertions(+), 172 deletions(-)

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5174 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2019-09-02 14:10 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-21 16:35 [Xen-devel] [PATCH v3 0/5] Clean up x86_64 boot code David Woodhouse
2019-08-21 16:35 ` [Xen-devel] [PATCH v3 1/5] x86/boot: Only jump into low trampoline code for real-mode boot David Woodhouse
2019-08-21 16:35   ` [Xen-devel] [PATCH v3 2/5] x86/boot: Split bootsym() into four types of relocations David Woodhouse
2019-08-30 15:10     ` Jan Beulich
2019-08-30 16:12       ` David Woodhouse
2019-09-02  7:37         ` Jan Beulich
2019-08-21 16:35   ` [Xen-devel] [PATCH v3 3/5] x86/boot: Rename trampoline_{start, end} to boot_trampoline_{start, end} David Woodhouse
2019-08-21 16:35   ` [Xen-devel] [PATCH v3 4/5] x86/boot: Copy 16-bit boot variables back up to Xen image David Woodhouse
2019-08-30 15:43     ` Jan Beulich
2019-08-30 16:25       ` David Woodhouse
2019-09-02  7:44         ` Jan Beulich
2019-09-02 12:51           ` David Woodhouse
2019-09-02 13:47             ` Jan Beulich
2019-09-02 13:52               ` David Woodhouse
2019-09-02 14:10                 ` Jan Beulich
2019-08-21 16:35   ` [Xen-devel] [PATCH v3 5/5] x86/boot: Do not use trampoline for no-real-mode boot paths David Woodhouse
2019-09-02  8:54     ` Jan Beulich
2019-08-30 14:25   ` [Xen-devel] [PATCH v3 1/5] x86/boot: Only jump into low trampoline code for real-mode boot Jan Beulich
2019-08-30 14:28     ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).