[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 0/3] x86/pvh: Support relocating dom0 kernel
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Wed, 13 Mar 2024 15:30:18 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Lz4h54/N/vGW4eVNNvLMe6hEsmbsEffwEzT057PZlXs=; b=cobKFs16vqbSl/boAwlV/bgvQqvu2Nswg8is3wJOXgBi7SNIHxe7DB/ddIg44sQmDpbyIghW+stT90ZtRxoo5cAzw6v/gz/AYC5ZhMp2x/cBDwcMGPwmOczupAyeHDQOFJQuHncWh6I26SkxfZwPrCBXUMku2sjRXfrzV9v33U5w5R3FCP/+gk2FF+9mIoeFbllgxoi8At6tbUOxVeALpQP+gRIiQ+zJp/aXl2+Xvq9qbC1EB38XO9Ctdd+5ZD0CJ7997TKP3TmPsFF/+NTQUiEcfmu/LU3/tHxzBmMDCSJF4+TAWuY+gmo+Cjp6Lxso7E0x8gqfW33VWtYEHrpwYw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IY35FrMSL9AQQ4+xljyowJsW74P4wtsdMvqzVcTh6CSAuOLBdb4gpJ18dM/P4oQ+v+USlWYEVbC3FIzyW43TxrTUXwDDjTSn7HaOu7ZzW4O1bKYv6G4NpgrW/4k0LLamNjm0qFMLnZna1ujoBsrCI1L1482CPk3jUYjnWrnrX5SFc/9aA7OyfZNWGP5STJM/tuA30uKzmIjON1ukzhCbwPxzcOePsrBv9PDNpdmPZR4e3QLnQ1481gxNfkUI/BkaNKo53phn/QGDRjztZ7WQjPmbiXcMv0eqCmKfp0n96DbsFGVTCVC0tNTTMFz4hTZwI+poV4Wnx8KtwGaN0F6+TA==
- Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Wed, 13 Mar 2024 19:39:13 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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
|