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 v2 3/3] x86/PVH: Support relocatable dom0 kernels
Date: Tue, 19 Mar 2024 09:11:14 +0100	[thread overview]
Message-ID: <f09d7b16-c13a-4e9f-8aa1-7605c24780d6@suse.com> (raw)
In-Reply-To: <769e4e95-1c76-4e07-b623-27b35ef388ef@amd.com>

On 18.03.2024 22:19, Jason Andryuk wrote:
> On 2024-03-14 10:19, Jan Beulich wrote:
>> On 14.03.2024 15:13, Jason Andryuk wrote:
>>> On 2024-03-14 09:21, Jan Beulich wrote:
>>>> On 13.03.2024 20:30, Jason Andryuk wrote:
>>>>> --- a/xen/include/public/elfnote.h
>>>>> +++ b/xen/include/public/elfnote.h
>>>>> @@ -194,6 +194,17 @@
>>>>>     */
>>>>>    #define XEN_ELFNOTE_PHYS32_ENTRY 18
>>>>>    
>>>>> +/*
>>>>> + * Physical loading constraints for PVH kernels
>>>>> + *
>>>>> + * Used to place constraints on the guest physical loading addresses and
>>>>> + * alignment for a PVH kernel.  This note's value is 3 64bit values in
>>>>> + * the following order: minimum, maximum and alignment.
>>>>
>>>> Along the lines of what I said on another sub-thread, I think at least
>>>> alignment wants to be optional here. Perhaps, with max going first, min
>>>> could also be optional.
>>>
>>> Interesting idea.
>>>
>>>> As indicated in different context by Roger, the values being uniformly
>>>> 64-bit ones also is questionable.
>>>>
>>>>> + * The presence of this note indicates the kernel is relocatable.
>>>>
>>>> I think it wants making explicit here that the act of relocating is still
>>>> left to the kernel.
>>>
>>> Ok.
>>>
>>> How is this for a new description?
>>>
>>> """
>>> Physical loading constraints for PVH kernels
>>>
>>> Used to place constraints on the guest physical loading addresses and
>>> alignment for a PVH kernel.
>>>
>>> The presence of this note indicates the kernel supports relocating itself.
>>>
>>> The note may include up to three 32bit values.
>>
>> I'm as unsure about always 32-bit as I am on it being uniformly 64-bit.
>> One question here is whether this note is intended to be x86-specific.
>>
>>>    - a maximum address for the entire image to be loaded below (default
>>> 0xfffffff)
>>
>> One f too few?
> 
> Whoops - yes.
> 
>>>    - a minimum address for the start of the image (default 0)
>>>    - a required start alignment (default 1)
> 
> Jan, in the discussion of patch 1, you wrote "Hmm, shouldn't the order 
> of attempts to figure the alignment be ELF note, ELF header, and then 
> 2Mb?"  My latest revision initializes phys_alignment to 1 and updates 
> that if PHYS32_RELOC specifies an alignment.  Do you still want these 
> other locations checked for alignment values?

I think it would be prudent to do so, yet at the same time I guess I won't
insist. Defaulting to 1, though, looks overly lax. In order for the
alignment value to be sensible to omit, the default needs to be sensible
(no lower than 4k, and quite likely better 2M).

Jan


  reply	other threads:[~2024-03-19  8:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 19:30 [PATCH v2 0/3] x86/pvh: Support relocating dom0 kernel Jason Andryuk
2024-03-13 19:30 ` [PATCH v2 1/3] Revert "xen/x86: bzImage parse kernel_alignment" Jason Andryuk
2024-03-14  7:11   ` Jan Beulich
2024-03-14 13:01     ` Jason Andryuk
2024-03-14 13:33       ` Jan Beulich
2024-03-13 19:30 ` [PATCH v2 2/3] libelf: Expand ELF note printing Jason Andryuk
2024-03-14 13:16   ` Jan Beulich
2024-03-14 20:36     ` Jason Andryuk
2024-03-13 19:30 ` [PATCH v2 3/3] x86/PVH: Support relocatable dom0 kernels Jason Andryuk
2024-03-13 21:02   ` Jason Andryuk
2024-03-14  7:12     ` Jan Beulich
2024-03-14 12:46       ` Jason Andryuk
2024-03-14  9:48   ` Roger Pau Monné
2024-03-14 13:51     ` Jason Andryuk
2024-03-14 14:33       ` Roger Pau Monné
2024-03-14 15:30         ` Jan Beulich
2024-03-14 16:48           ` Roger Pau Monné
2024-03-14 16:59           ` Jason Andryuk
2024-03-14 17:02             ` Jan Beulich
2024-03-15  8:45             ` Roger Pau Monné
2024-03-14 13:21   ` Jan Beulich
2024-03-14 14:13     ` Jason Andryuk
2024-03-14 14:19       ` Jan Beulich
2024-03-18 21:19         ` Jason Andryuk
2024-03-19  8:11           ` Jan Beulich [this message]
2024-03-14 13:31   ` Jan Beulich
2024-03-14 19:19     ` Jason Andryuk
2024-03-15  9:48       ` Jan Beulich
2024-03-18 21:21         ` Jason Andryuk
2024-03-19  8:15           ` Jan Beulich
2024-03-19 13:50             ` Jason Andryuk
2024-03-13 19:46 ` [PATCH] 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=f09d7b16-c13a-4e9f-8aa1-7605c24780d6@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.