[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <daf28e5b-61ba-42ff-97ba-aaaeaac81c09@suse.com>
Date: Mon, 16 Sep 2024 08:33:34 +0200
From: Juergen Gross <jgross@...e.com>
To: Jason Andryuk <jason.andryuk@....com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
Stefano Stabellini <sstabellini@...nel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>,
Paolo Bonzini <pbonzini@...hat.com>, Brian Gerst <brgerst@...il.com>
Cc: xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 5/5] x86/pvh: Add 64bit relocation page tables
On 23.08.24 21:36, Jason Andryuk wrote:
> 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@....com>
Reviewed-by: Juergen Gross <jgross@...e.com>
Juergen
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3684 bytes)
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists