All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/6] x86/pvh: Support relocating dom0 kernel
@ 2024-03-26 21:38 Jason Andryuk
  2024-03-26 21:38 ` [PATCH v5 1/6] Revert "xen/x86: bzImage parse kernel_alignment" Jason Andryuk
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Jason Andryuk @ 2024-03-26 21:38 UTC (permalink / raw)
  To: xen-devel
  Cc: Jason Andryuk, Jan Beulich, Andrew Cooper, Roger Pau Monné,
	Juergen Gross, Julien Grall, Anthony PERARD, George Dunlap,
	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_PHYS32_RELOC 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 and third patches move MB/GB() to common-macros.h.

The fourth patch expands ELF note printing beyond just printing
integers and strings.

The fifth patch expands specifies the Xen ELF Notes are x86-specific.

The sixth patch expands the pvh dom0 kernel placement code.

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

Jason Andryuk (6):
  Revert "xen/x86: bzImage parse kernel_alignment"
  tools/init-xenstore-domain: Replace variable MB() usage
  tools: Move MB/GB() to common-macros.h
  libelf: Expand ELF note printing
  xen/elfnote: Specify ELF Notes are x86-specific
  x86/PVH: Support relocatable dom0 kernels

 tools/firmware/hvmloader/util.h         |   3 -
 tools/helpers/init-xenstore-domain.c    |  11 ++-
 tools/include/xen-tools/common-macros.h |   4 +
 tools/libs/light/libxl_internal.h       |   4 -
 xen/arch/x86/bzimage.c                  |   4 +-
 xen/arch/x86/hvm/dom0_build.c           | 104 +++++++++++++++++++++++-
 xen/arch/x86/include/asm/bzimage.h      |   2 +-
 xen/arch/x86/pv/dom0_build.c            |   2 +-
 xen/common/libelf/libelf-dominfo.c      |  99 ++++++++++++++++------
 xen/common/libelf/libelf-private.h      |   1 +
 xen/include/public/elfnote.h            |  18 +++-
 xen/include/xen/libelf.h                |   4 +
 12 files changed, 213 insertions(+), 43 deletions(-)

-- 
2.44.0



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

end of thread, other threads:[~2024-03-27 14:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-26 21:38 [PATCH v5 0/6] x86/pvh: Support relocating dom0 kernel Jason Andryuk
2024-03-26 21:38 ` [PATCH v5 1/6] Revert "xen/x86: bzImage parse kernel_alignment" Jason Andryuk
2024-03-27  7:22   ` Jan Beulich
2024-03-27  8:59     ` Roger Pau Monné
2024-03-27 14:08       ` Jason Andryuk
2024-03-27 14:19         ` Jan Beulich
2024-03-27 14:49           ` Jason Andryuk
2024-03-26 21:38 ` [PATCH v5 2/6] tools/init-xenstore-domain: Replace variable MB() usage Jason Andryuk
2024-03-26 21:38 ` [PATCH v5 3/6] tools: Move MB/GB() to common-macros.h Jason Andryuk
2024-03-26 21:38 ` [PATCH v5 4/6] libelf: Expand ELF note printing Jason Andryuk
2024-03-27  7:27   ` Jan Beulich
2024-03-26 21:38 ` [PATCH v5 5/6] xen/elfnote: Specify ELF Notes are x86-specific Jason Andryuk
2024-03-27  7:24   ` Jan Beulich
2024-03-26 21:38 ` [PATCH v5 6/6] x86/PVH: Support relocatable dom0 kernels Jason Andryuk
2024-03-26 21:47 ` [PATCH v5] RFC: x86/pvh: Make Xen PVH entrypoint PIC for x86-64 Jason Andryuk
2024-03-27  8:20   ` Jan Beulich
2024-03-27 14:15     ` 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.