mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Jason Andryuk <jason.andryuk@amd.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	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>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Brian Gerst <brgerst@gmail.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/5] x86/pvh: Make PVH entrypoint PIC for x86-64
Date: Mon, 16 Sep 2024 08:27:22 +0200	[thread overview]
Message-ID: <1f62d675-0a1b-4ee6-ab39-314b1e443a4b@suse.com> (raw)
In-Reply-To: <20240823193630.2583107-3-jason.andryuk@amd.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1270 bytes --]

On 23.08.24 21:36, Jason Andryuk wrote:
> The PVH entrypoint is 32bit non-PIC code running the uncompressed
> vmlinux at its load address CONFIG_PHYSICAL_START - default 0x1000000
> (16MB).  The kernel is loaded at that physical address inside the VM by
> the VMM software (Xen/QEMU).
> 
> When running a Xen PVH Dom0, the host reserved addresses are mapped 1-1
> into the PVH container.  There exist system firmwares (Coreboot/EDK2)
> with reserved memory at 16MB.  This creates a conflict where the PVH
> kernel cannot be loaded at that address.
> 
> Modify the PVH entrypoint to be position-indepedent to allow flexibility
> in load address.  Only the 64bit entry path is converted.  A 32bit
> kernel is not PIC, so calling into other parts of the kernel, like
> xen_prepare_pvh() and mk_pgtable_32(), don't work properly when
> relocated.
> 
> This makes the code PIC, but the page tables need to be updated as well
> to handle running from the kernel high map.
> 
> The UNWIND_HINT_END_OF_STACK is to silence:
> vmlinux.o: warning: objtool: pvh_start_xen+0x7f: unreachable instruction
> after the lret into 64bit code.
> 
> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


[-- 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 --]

  reply	other threads:[~2024-09-16  6:27 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 [this message]
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 ` [PATCH v3 0/5] x86/pvh: Make 64bit PVH entry relocatable Juergen Gross
2024-09-25  9:28   ` 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=1f62d675-0a1b-4ee6-ab39-314b1e443a4b@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

all inboxes | Powered by JetHome®