diff options
author | Jason Andryuk <jason.andryuk@amd.com> | 2024-08-23 21:36:30 +0200 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2024-09-25 16:06:07 +0200 |
commit | 47ffe0578aee45fed3a06d5dcff76cdebb303163 (patch) | |
tree | 45574bf41767d979fa573949a68b517f50095ea2 /arch/x86/kernel | |
parent | x86/kernel: Move page table macros to header (diff) | |
download | linux-47ffe0578aee45fed3a06d5dcff76cdebb303163.tar.xz linux-47ffe0578aee45fed3a06d5dcff76cdebb303163.zip |
x86/pvh: Add 64bit relocation page tables
The PVH entry point is 32bit. For a 64bit kernel, the entry point must
switch to 64bit mode, which requires a set of page tables. In the past,
PVH used init_top_pgt.
This works fine when the kernel is loaded at LOAD_PHYSICAL_ADDR, as the
page tables are prebuilt for this address. If the kernel is loaded at a
different address, they need to be adjusted.
__startup_64() adjusts the prebuilt page tables for the physical load
address, but it is 64bit code. The 32bit PVH entry code can't call it
to adjust the page tables, so it can't readily be re-used.
64bit PVH entry needs page tables set up for identity map, the kernel
high map and the direct map. pvh_start_xen() enters identity mapped.
Inside xen_prepare_pvh(), it jumps through a pv_ops function pointer
into the highmap. The direct map is used for __va() on the initramfs
and other guest physical addresses.
Add a dedicated set of prebuild page tables for PVH entry. They are
adjusted in assembly before loading.
Add XEN_ELFNOTE_PHYS32_RELOC to indicate support for relocation
along with the kernel's loading constraints. The maximum load address,
KERNEL_IMAGE_SIZE - 1, is determined by a single pvh_level2_ident_pgt
page. It could be larger with more pages.
Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Message-ID: <20240823193630.2583107-6-jason.andryuk@amd.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'arch/x86/kernel')
0 files changed, 0 insertions, 0 deletions