From: Juergen Gross <jgross@suse.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
Jason Andryuk <jason.andryuk@amd.com>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Brian Gerst <brgerst@gmail.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v3 0/5] x86/pvh: Make 64bit PVH entry relocatable
Date: Mon, 16 Sep 2024 10:44:52 +0200 [thread overview]
Message-ID: <f8cf8e13-cbd3-4dfa-b09c-e0a14f0e346c@suse.com> (raw)
In-Reply-To: <20240823193630.2583107-1-jason.andryuk@amd.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 2878 bytes --]
x86 maintainers,
are you going to pick this series up, or should I take it via the
Xen tree?
Juergen
On 23.08.24 21:36, Jason Andryuk wrote:
> Using the PVH entry point, the uncompressed vmlinux is loaded at
> LOAD_PHYSICAL_ADDR, and execution starts in 32bit mode at the
> address in XEN_ELFNOTE_PHYS32_ENTRY, pvh_start_xen, with paging
> disabled.
>
> Loading at LOAD_PHYSICAL_ADDR has not been a problem in the past as
> virtual machines don't have conflicting memory maps. But Xen now
> supports a PVH dom0, which uses the host memory map, and there are
> Coreboot/EDK2 firmwares that have reserved regions conflicting with
> LOAD_PHYSICAL_ADDR. Xen recently added XEN_ELFNOTE_PHYS32_RELOC to
> specify an alignment, minimum and maximum load address when
> LOAD_PHYSICAL_ADDR cannot be used. This patch series makes the PVH
> entry path PIC to support relocation.
>
> Only x86-64 is converted. The 32bit entry path calling into vmlinux,
> which is not PIC, will not support relocation.
>
> The entry path needs pages tables to switch to 64bit mode. A new
> pvh_init_top_pgt is added to make the transition into the startup_64
> when the regular init_top_pgt pagetables are setup. This duplication is
> unfortunate, but it keeps the changes simpler. __startup_64() can't be
> used to setup init_top_pgt for PVH entry because it is 64bit code - the
> 32bit entry code doesn't have page tables to use.
>
> This is the straight forward implementation to make it work. Other
> approaches could be pursued.
>
> checkpatch.pl gives an error: "ERROR: Macros with multiple statements
> should be enclosed in a do - while loop" about the moved PMDS macro.
> But PMDS is an assembler macro, so its not applicable. There are some
> false positive warnings "WARNING: space prohibited between function name
> and open parenthesis '('" about the macro, too.
>
> v2 addresses review feedback. It also replace LOAD_PHYSICAL_ADDR with
> _pa(pvh_start_xen) in some offset calculations. They happened to be
> equal in my original builds. When the two values differ,
> _pa(pvh_start_xen) is the correct one to use.
>
> v3: Fix build error for 32bit. Add Juergen's R-b to patch 4.
>
> Jason Andryuk (5):
> xen: sync elfnote.h from xen tree
> x86/pvh: Make PVH entrypoint PIC for x86-64
> x86/pvh: Set phys_base when calling xen_prepare_pvh()
> x86/kernel: Move page table macros to header
> x86/pvh: Add 64bit relocation page tables
>
> arch/x86/include/asm/pgtable_64.h | 23 ++++-
> arch/x86/kernel/head_64.S | 20 ----
> arch/x86/platform/pvh/head.S | 161 +++++++++++++++++++++++++++---
> include/xen/interface/elfnote.h | 93 ++++++++++++++++-
> 4 files changed, 259 insertions(+), 38 deletions(-)
>
>
> base-commit: 7c626ce4bae1ac14f60076d00eafe71af30450ba
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
next prev parent reply other threads:[~2024-09-16 8:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 19:36 [PATCH v3 0/5] x86/pvh: Make 64bit PVH entry relocatable Jason Andryuk
2024-08-23 19:36 ` [PATCH v3 1/5] xen: sync elfnote.h from xen tree Jason Andryuk
2024-08-23 19:36 ` [PATCH v3 2/5] x86/pvh: Make PVH entrypoint PIC for x86-64 Jason Andryuk
2024-09-16 6:27 ` Juergen Gross
2024-08-23 19:36 ` [PATCH v3 3/5] x86/pvh: Set phys_base when calling xen_prepare_pvh() Jason Andryuk
2024-08-23 19:36 ` [PATCH v3 4/5] x86/kernel: Move page table macros to header Jason Andryuk
2024-09-25 14:02 ` Dave Hansen
2024-08-23 19:36 ` [PATCH v3 5/5] x86/pvh: Add 64bit relocation page tables Jason Andryuk
2024-09-16 6:33 ` Juergen Gross
2024-09-16 8:44 ` Juergen Gross [this message]
2024-09-25 9:28 ` [PATCH v3 0/5] x86/pvh: Make 64bit PVH entry relocatable Juergen Gross
2024-09-25 14:02 ` Dave Hansen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f8cf8e13-cbd3-4dfa-b09c-e0a14f0e346c@suse.com \
--to=jgross@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jason.andryuk@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oleksandr_tyshchenko@epam.com \
--cc=pbonzini@redhat.com \
--cc=sstabellini@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox