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>, "Wei Liu" <wl@xen.org>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Julien Grall" <julien@xen.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 3/3] x86/PVH: Support relocatable dom0 kernels
Date: Mon, 25 Mar 2024 08:46:01 +0100	[thread overview]
Message-ID: <b0e4d3e0-f760-4ba2-a90b-f8c5ddb676ad@suse.com> (raw)
In-Reply-To: <63cad597-b48f-43df-8d53-0ee8c1aa744d@amd.com>

On 22.03.2024 15:24, Jason Andryuk wrote:
> On 2024-03-21 09:45, Jason Andryuk wrote:
>> On 2024-03-20 10:39, Jan Beulich wrote:
>>> On 19.03.2024 21:58, Jason Andryuk wrote:
> 
>>>> @@ -536,6 +565,10 @@ elf_errorstatus elf_xen_parse(struct elf_binary 
>>>> *elf,
>>>>       parms->p2m_base = UNSET_ADDR;
>>>>       parms->elf_paddr_offset = UNSET_ADDR;
>>>>       parms->phys_entry = UNSET_ADDR32;
>>>> +    parms->phys_min = 0;
>>>> +    parms->phys_max = 0xffffffff;
>>>> +    parms->phys_align = 0x200000;
>>>
>>> I think this wants to be MB(2) (requiring a pre-patch to centralize MB()
>>> in the tool stack to tools/include/xen-tools/common-macros.h). And I
>>> further think this needs to be an arch-specific constant, even if right
>>> now the note is expected to be present only for x86. Which then also
>>> needs saying ...
> 
> Are you thinking something like the following in libelf-dominfo.c:
> 
> #define X86_PHYS_ALIGN_DEFAULT MB(2)
> #define X86_PHYS_MAX_DEFAULT (GB(4) - 1)
> 
> and setting as:
> parms->phys_max = X86_PHYS_MAX_DEFAULT;
> parms->phys_align = X86_PHYS_ALIGN_DEFAULT;
> 
> libelf is arch neutral, so there isn't a natural place to introduce 
> arch-specific defines.  Or were you looking for each arch to set it?  We 
> only care about x86 right now, so we can do something like:
> 
> #if x86
> #define ARCH_PHYS_MAX_DEFAULT   (GB(4) - 1)
> #define ARCH_PHYS_ALIGN_DEFAULT MB(2)
> #else
> #define ARCH_PHYS_MAX_DEFAULT   0
> #define ARCH_PHYS_ALIGN_DEFAULT 0
> #endif

More like the latter. The former only if the phys_* fields themselves were
to also become x86-only.

As you say, libelf in its present shape doesn't easily lend itself to such
arch-specifics.

Jan


  reply	other threads:[~2024-03-25  7:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19 20:58 [PATCH v3 0/3] x86/pvh: Support relocating dom0 kernel Jason Andryuk
2024-03-19 20:58 ` [PATCH v3 1/3] Revert "xen/x86: bzImage parse kernel_alignment" Jason Andryuk
2024-03-19 20:58 ` [PATCH v3 2/3] libelf: Expand ELF note printing Jason Andryuk
2024-03-20 14:00   ` Jan Beulich
2024-03-19 20:58 ` [PATCH v3 3/3] x86/PVH: Support relocatable dom0 kernels Jason Andryuk
2024-03-20 14:39   ` Jan Beulich
2024-03-21  1:12     ` Stefano Stabellini
2024-03-21 13:45     ` Jason Andryuk
2024-03-21 14:02       ` Jan Beulich
2024-03-22 14:24       ` Jason Andryuk
2024-03-25  7:46         ` Jan Beulich [this message]
2024-03-19 21:16 ` [PATCH v3] 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=b0e4d3e0-f760-4ba2-a90b-f8c5ddb676ad@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=wl@xen.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.