All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Jason Andryuk <jason.andryuk@amd.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v5 1/6] Revert "xen/x86: bzImage parse kernel_alignment"
Date: Wed, 27 Mar 2024 09:59:40 +0100	[thread overview]
Message-ID: <ZgPf_I2CJ7358jbZ@macbook> (raw)
In-Reply-To: <f1940242-0259-4b4c-baff-2fa73435d1b9@suse.com>

On Wed, Mar 27, 2024 at 08:22:41AM +0100, Jan Beulich wrote:
> On 26.03.2024 22:38, Jason Andryuk wrote:
> > A new ELF note will specify the alignment for a relocatable PVH kernel.
> > ELF notes are suitable for vmlinux and other ELF files, so this
> > Linux-specific bzImage parsing in unnecessary.
> > 
> > This reverts commit c44cac229067faeec8f49247d1cf281723ac2d40.
> > 
> > Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
> 
> Since you keep re-sending this: In private discussion Roger has indicated
> that, like me, he too would prefer falling back to the ELF data, before
> falling back to the arch default (Roger, please correct me if I got it
> wrong). That would make it necessary that the change you're proposing to
> revert here is actually kept.

Sorry, was meaning to reply yesterday but Jason is very fast at
sending new version so I'm always one version behind.

IMO the order: ELF note, PHDR alignment, arch default should be the
preferred one.

> Or wait - what you're reverting is taking the alignment out of the
> bzImage header. I don't expect the BSDs to use that protocol; aiui that's
> entirely Linux-specific.

Yeah, I don't have strong opinions in keeping this, we already do
bzImage parsing, so we might as well attempt to fetch the alignment
from there if correct:

ELF note, bzImage kernel_alignment, ELF PHDR alignment, arch default

> I further meanwhile realized that consulting the ELF phdrs may also be
> ambiguous, as there may be more than one. I guess it would need to be the
> maximum of all of them then.

My suggestion (not sure if I mentioned this before) was to use the
alignment of the first LOAD PHDR, which is the one that defines the
value of the dest_base field used as the image load start address.

Using the maximum of all load PHDRs might be safer.

Thanks, Roger.


  reply	other threads:[~2024-03-27  8:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 21:38 [PATCH v5 0/6] x86/pvh: Support relocating dom0 kernel Jason Andryuk
2024-03-26 21:38 ` [PATCH v5 1/6] Revert "xen/x86: bzImage parse kernel_alignment" Jason Andryuk
2024-03-27  7:22   ` Jan Beulich
2024-03-27  8:59     ` Roger Pau Monné [this message]
2024-03-27 14:08       ` Jason Andryuk
2024-03-27 14:19         ` Jan Beulich
2024-03-27 14:49           ` Jason Andryuk
2024-03-26 21:38 ` [PATCH v5 2/6] tools/init-xenstore-domain: Replace variable MB() usage Jason Andryuk
2024-03-26 21:38 ` [PATCH v5 3/6] tools: Move MB/GB() to common-macros.h Jason Andryuk
2024-03-26 21:38 ` [PATCH v5 4/6] libelf: Expand ELF note printing Jason Andryuk
2024-03-27  7:27   ` Jan Beulich
2024-03-26 21:38 ` [PATCH v5 5/6] xen/elfnote: Specify ELF Notes are x86-specific Jason Andryuk
2024-03-27  7:24   ` Jan Beulich
2024-03-26 21:38 ` [PATCH v5 6/6] x86/PVH: Support relocatable dom0 kernels Jason Andryuk
2024-03-26 21:47 ` [PATCH v5] RFC: x86/pvh: Make Xen PVH entrypoint PIC for x86-64 Jason Andryuk
2024-03-27  8:20   ` Jan Beulich
2024-03-27 14:15     ` 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=ZgPf_I2CJ7358jbZ@macbook \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jason.andryuk@amd.com \
    --cc=jbeulich@suse.com \
    --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.