All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Jason Andryuk <jason.andryuk@amd.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Julien Grall" <julien@xen.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6 4/4] x86/PVH: Support relocatable dom0 kernels
Date: Tue, 2 Apr 2024 16:34:20 +0200	[thread overview]
Message-ID: <46a99837-fbb4-4dc9-a78c-634bee5c00a5@suse.com> (raw)
In-Reply-To: <20240327215102.136001-5-jason.andryuk@amd.com>

On 27.03.2024 22:51, Jason Andryuk wrote:
> v6:
> Select alignment from, in order, Note, PHDRs, then default

The comment in the public header also needs to reflect this change.

> +static bool __init check_and_adjust_load_address(
> +    const struct domain *d, struct elf_binary *elf, struct elf_dom_parms *parms)
> +{
> +    paddr_t reloc_base;
> +
> +    if ( check_load_address(d, elf) )
> +        return true;
> +
> +    if ( !parms->phys_reloc )
> +    {
> +        printk("%pd kernel: Address conflict and not relocatable\n", d);
> +        return false;
> +    }
> +
> +    reloc_base = find_kernel_memory(d, elf, parms);
> +    if ( !reloc_base )
> +    {
> +        printk("%pd kernel: Failed find a load address\n", d);
> +        return false;
> +    }
> +
> +    if ( opt_dom0_verbose )
> +        printk("%pd kernel: Moving [%p, %p] -> [%"PRIpaddr", %"PRIpaddr"]\n", d,
> +               elf->dest_base, elf->dest_base + elf->dest_size - 1,
> +               reloc_base, reloc_base + elf->dest_size - 1);
> +
> +    parms->phys_entry = reloc_base +
> +                            (parms->phys_entry - (uintptr_t)elf->dest_base);

I think this would be easier to read as

    parms->phys_entry =
        reloc_base + (parms->phys_entry - (uintptr_t)elf->dest_base);

Everything else looks good to me now.

Jan


  reply	other threads:[~2024-04-02 14:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 21:50 [PATCH v6 0/4] x86/pvh: Support relocating dom0 kernel Jason Andryuk
2024-03-27 21:50 ` [PATCH v6 1/4] tools/init-xenstore-domain: Replace variable MB() usage Jason Andryuk
2024-04-03 12:41   ` Anthony PERARD
2024-04-03 12:51     ` Jason Andryuk
2024-04-04 10:09   ` Jan Beulich
2024-04-04 13:55     ` Jason Andryuk
2024-03-27 21:51 ` [PATCH v6 2/4] tools: Move MB/GB() to common-macros.h Jason Andryuk
2024-04-03 12:57   ` Anthony PERARD
2024-03-27 21:51 ` [PATCH v6 3/4] libelf: Store maximum PHDR p_align Jason Andryuk
2024-03-28 16:47   ` Jan Beulich
2024-03-29 14:41     ` Jason Andryuk
2024-04-02  6:44       ` Jan Beulich
2024-04-04 14:00         ` Jason Andryuk
2024-03-27 21:51 ` [PATCH v6 4/4] x86/PVH: Support relocatable dom0 kernels Jason Andryuk
2024-04-02 14:34   ` Jan Beulich [this message]
2024-04-04 14:01     ` Jason Andryuk
2024-03-27 21:55 ` [PATCH v6] RFC: x86/pvh: Make Xen PVH entrypoint PIC for x86-64 Jason Andryuk

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=46a99837-fbb4-4dc9-a78c-634bee5c00a5@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jason.andryuk@amd.com \
    --cc=julien@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.