All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] x86/pvh: Support relocating dom0 kernel
@ 2024-03-13 19:30 Jason Andryuk
  2024-03-13 19:30 ` [PATCH v2 1/3] Revert "xen/x86: bzImage parse kernel_alignment" Jason Andryuk
                   ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: Jason Andryuk @ 2024-03-13 19:30 UTC (permalink / raw)
  To: xen-devel
  Cc: Jason Andryuk, Jan Beulich, Andrew Cooper, Roger Pau Monné,
	Wei Liu, George Dunlap, Julien Grall, Stefano Stabellini

Xen tries to load a PVH dom0 kernel at the fixed guest physical address
from the elf headers.  For Linux, this defaults to 0x1000000 (16MB), but
it can be configured.

Unfortunately there exist firmwares that have reserved regions at this
address, so Xen fails to load the dom0 kernel since it's not RAM.

The other issue is that the Linux PVH entry point is not
position-independent.  It expects to run at the compiled
CONFIG_PHYSICAL_ADDRESS.

This patch set expands the PVH dom0 builder to try to relocate the
kernel if needed and possible.  XEN_ELFNOTE_PVH_RELOCATION is added for
kernels to indicate they are relocatable and their acceptable address
range and alignment.

The first patch reverts "xen/x86: bzImage parse kernel_alignment" since
the alignment will be specified by the ELF note.

The second patch expands ELF note printing so arrays of values can be
handled.

The third patch expands the pvh dom0 kernel placement code.

I'll post an additional patch showing the Linux changes to make PVH
relocatable.

Jason Andryuk (3):
  Revert "xen/x86: bzImage parse kernel_alignment"
  libelf: Expand ELF note printing
  x86/PVH: Support relocatable dom0 kernels

 xen/arch/x86/bzimage.c             |   4 +-
 xen/arch/x86/hvm/dom0_build.c      | 112 ++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/bzimage.h |   2 +-
 xen/arch/x86/pv/dom0_build.c       |   2 +-
 xen/common/libelf/libelf-dominfo.c |  72 +++++++++++++------
 xen/include/public/elfnote.h       |  11 +++
 xen/include/xen/libelf.h           |   3 +
 7 files changed, 177 insertions(+), 29 deletions(-)

-- 
2.44.0



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

end of thread, other threads:[~2024-03-19 13:51 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 19:30 [PATCH v2 0/3] x86/pvh: Support relocating dom0 kernel Jason Andryuk
2024-03-13 19:30 ` [PATCH v2 1/3] Revert "xen/x86: bzImage parse kernel_alignment" Jason Andryuk
2024-03-14  7:11   ` Jan Beulich
2024-03-14 13:01     ` Jason Andryuk
2024-03-14 13:33       ` Jan Beulich
2024-03-13 19:30 ` [PATCH v2 2/3] libelf: Expand ELF note printing Jason Andryuk
2024-03-14 13:16   ` Jan Beulich
2024-03-14 20:36     ` Jason Andryuk
2024-03-13 19:30 ` [PATCH v2 3/3] x86/PVH: Support relocatable dom0 kernels Jason Andryuk
2024-03-13 21:02   ` Jason Andryuk
2024-03-14  7:12     ` Jan Beulich
2024-03-14 12:46       ` Jason Andryuk
2024-03-14  9:48   ` Roger Pau Monné
2024-03-14 13:51     ` Jason Andryuk
2024-03-14 14:33       ` Roger Pau Monné
2024-03-14 15:30         ` Jan Beulich
2024-03-14 16:48           ` Roger Pau Monné
2024-03-14 16:59           ` Jason Andryuk
2024-03-14 17:02             ` Jan Beulich
2024-03-15  8:45             ` Roger Pau Monné
2024-03-14 13:21   ` Jan Beulich
2024-03-14 14:13     ` Jason Andryuk
2024-03-14 14:19       ` Jan Beulich
2024-03-18 21:19         ` Jason Andryuk
2024-03-19  8:11           ` Jan Beulich
2024-03-14 13:31   ` Jan Beulich
2024-03-14 19:19     ` Jason Andryuk
2024-03-15  9:48       ` Jan Beulich
2024-03-18 21:21         ` Jason Andryuk
2024-03-19  8:15           ` Jan Beulich
2024-03-19 13:50             ` Jason Andryuk
2024-03-13 19:46 ` [PATCH] RFC: x86/pvh: Make Xen PVH entrypoint PIC for x86-64 Jason Andryuk

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.