All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] x86/pvh: Support relocating dom0 kernel
@ 2024-03-06 18:50 Jason Andryuk
  2024-03-06 18:50 ` [PATCH 1/3] features.h: Replace hard tabs Jason Andryuk
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Jason Andryuk @ 2024-03-06 18:50 UTC (permalink / raw)
  To: xen-devel
  Cc: Jason Andryuk, Andrew Cooper, George Dunlap, Jan Beulich,
	Julien Grall, Stefano Stabellini, Wei Liu, Roger Pau Monné

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.  XENFEAT_pvh_relocatable is added for
kernels to indicate they are relocatable.  However, we may want to
switch to an additional ELF note with the kernel alignment.  Linux
specifies a kernel alignment in the bzImage boot_params.setup_header,
but that is not present the ELF vmlinux file.

The first patch fixes some whitespace in features.h

The second patch enhances bzimage_parse to pull the kernel_alignment into
an optional align pointer.

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):
  features.h: Replace hard tabs
  xen/x86: bzImage parse kernel_alignment
  x86/PVH: Support relocatable dom0 kernels

 xen/arch/x86/bzimage.c             |   4 +-
 xen/arch/x86/hvm/dom0_build.c      | 113 ++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/bzimage.h |   3 +-
 xen/arch/x86/pv/dom0_build.c       |   2 +-
 xen/include/public/features.h      |   9 ++-
 5 files changed, 124 insertions(+), 7 deletions(-)

-- 
2.44.0



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

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

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-06 18:50 [PATCH 0/3] x86/pvh: Support relocating dom0 kernel Jason Andryuk
2024-03-06 18:50 ` [PATCH 1/3] features.h: Replace hard tabs Jason Andryuk
2024-03-06 20:41   ` Stefano Stabellini
2024-03-06 18:50 ` [PATCH 2/3] xen/x86: bzImage parse kernel_alignment Jason Andryuk
2024-03-07  2:09   ` Stefano Stabellini
2024-03-07  8:26     ` Jan Beulich
2024-03-07 15:06       ` Jason Andryuk
2024-03-06 18:50 ` [PATCH 3/3] x86/PVH: Support relocatable dom0 kernels Jason Andryuk
2024-03-07  2:09   ` Stefano Stabellini
2024-03-07 16:07     ` Jason Andryuk
2024-03-07  9:30   ` Roger Pau Monné
2024-03-07 17:01     ` Jason Andryuk
2024-03-08  6:34       ` Juergen Gross
2024-03-11 16:53   ` Jan Beulich
2024-03-11 19:53     ` Jason Andryuk
2024-03-06 19:31 ` [LINUX PATCH] RFC: x86/pvh: Make Xen PVH entrypoint PIC Jason Andryuk
2024-03-07 10:00 ` [PATCH 0/3] x86/pvh: Support relocating dom0 kernel Roger Pau Monné
2024-03-07 10:08   ` Jan Beulich
2024-03-07 10:20     ` Roger Pau Monné
2024-03-07 17:33       ` Jason Andryuk
2024-03-08  7:03         ` Jan Beulich

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.