[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 5/5] x86/PVH: Support relocatable dom0 kernels


  • To: Jason Andryuk <jason.andryuk@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 26 Mar 2024 14:40:06 +0100
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 26 Mar 2024 13:40:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.03.2024 14:24, Jason Andryuk wrote:
> On 2024-03-26 03:50, Jan Beulich wrote:
>> On 25.03.2024 21:45, Jason Andryuk wrote:
>>> @@ -227,6 +239,27 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary 
>>> *elf,
>>>       case XEN_ELFNOTE_PHYS32_ENTRY:
>>>           parms->phys_entry = val;
>>>           break;
>>> +
>>> +    case XEN_ELFNOTE_PHYS32_RELOC:
>>> +        parms->phys_reloc = true;
>>> +
>>> +        if ( descsz >= 4 )
>>> +        {
>>> +            parms->phys_max = elf_note_numeric_array(elf, note, 4, 0);
>>> +            elf_msg(elf, " = max: %#"PRIx32, parms->phys_max);
>>
>> As indicated before, I consider the = here a little odd.
> 
> I retained = for consistency with other notes:
> ELF: note: PHYS32_RELOC = max: 0x40000000 min: 0x1000000 align: 0x200000
> ELF: note: PHYS32_ENTRY = 0x1000000
> ELF: note: GUEST_OS = "linux"
> 
> I guess whitespace and labels makes it clear, so I'll drop the '='.
> 
>>> +        }
>>> +        if ( descsz >= 8 )
>>> +        {
>>> +            parms->phys_min = elf_note_numeric_array(elf, note, 4, 1);
>>> +            elf_msg(elf, " min: %#"PRIx32, parms->phys_min);
>>> +        }
>>> +        if ( descsz >= 12 )
>>> +        {
>>> +            parms->phys_align = elf_note_numeric_array(elf, note, 4, 2);
>>> +            elf_msg(elf, " align: %#"PRIx32, parms->phys_align);
>>> +        }
>>
>> I'd like us to reconsider this ordering: I'm inclined to say that MAX isn't
>> the most likely one a guest may find a need to use. Instead I'd expect both
>> MIN and ALIGN wanting to be given higher priority; what I'm less certain
>> about is the ordering between the two. To keep MIN and MAX adjacent, how
>> about ALIGN, MIN, MAX?
> 
> ALIGN, MIN, MAX works for me.
> 
> On the Linux side, I'm expecting them all to be set:
> ALIGN = CONFIG_PHYSICAL_ALIGN
> MIN = LOAD_PHYSICAL_ADDR
> MAX = KERNEL_IMAGE_SIZE
> 
> You need enough identity page tables to cover up to MAX. 
> LOAD_PHYSICAL_ADDR is used as a minimum, so requesting placement above 
> MIN makes sense to me.

Hmm, setting MIN like this means moving down is precluded. Why would it
not be possible to move a kernel to lower than the default of 16M, when
CONFIG_PHYSICAL_START can be as low as 0? (In fact, I doubt 0 would work
if chosen, but 2M surely does work, as I build some of my Dom0 kernels
that way.)

MAX, otoh, I guess really wants setting as you say, for KERNEL_IMAGE_SIZE
actually being commented upon as mis-named. Just that it now really wants
to be KERNEL_IMAGE_SIZE-1.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.