[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 0/3] x86/pvh: Support relocating dom0 kernel
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Wed, 6 Mar 2024 13:50:29 -0500
- 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=UXHnUUkP0I4VeoKV7/n47noRYWOiKkviRFLs6MBrGmU=; b=FmbQqw004F3CuzhI2HYEsqlBILPWJz1rt8ssFzTycTIlC+GSflBoTa8+NjDNl5Ib4gPEYoo0AaoqTtBOTuo9nD2A+BAj4geyAjmCWizB3DFIGjN3VGhtWUP0EwsOzJxOvSOEwsYfzp0ctQchpsDUhPy9ShslXBnVopuLd79T8/aAajTNJqg5VLiqBqiYQoRo002vFy1IoNfEkwlzpvQSze5yOdySHMJLgsoS8b5ZuHAEOqqOBU6FtdlYpEJ6n+fldAwQxeb/BuBl4tvjDWt7cBcsc9WTVrl5t2d/wPPnV5/fvUFgn+3oH/YvpvOwiuzJWM93H+7ePhV+O15G6/heYQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FUko/WRHKKy4khx/gNd6FIZb6OTcYmxUc56ULo6LbLSygrtZGNCn1jYvlwo+/8GDDjvqVICJobuI/jN4DZI8ap3BICpjp2d5Gh0zIwhS6AtPCK3aBhwrngpC2PV13EzmLrF6HUlh2ER+kkU7mz9N5y5hsAc/Dy2SYpKq783Q9mbWHJO8kbt0map2cvdGoh2x3HEq1wXnYM1OZcdOvyK4Cg7WRy7XrPvgGIC5GW2mlzX9MdRq6KRqQV6ZqIgnUc32F5NAGL1VZ5Bv1fOjSSUtoV1gDsLUZcMbBNSsaRj1hlbqlKCg6/PCWzsO0JBA/FdNbVlEdC/3dh+sgmzZrZ7HKg==
- Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Wed, 06 Mar 2024 18:50:56 +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. 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
|