All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Andrii Anisov <andrii.anisov@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: Matthew Daley <mattd@bugfuzz.com>,
	"sstabellini@kernel.org" <sstabellini@kernel.org>
Subject: Re: [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen
Date: Tue, 18 Dec 2018 13:13:24 +0000	[thread overview]
Message-ID: <6fc1e7ab-f2e5-fd05-79c5-3bcd48cb1435@arm.com> (raw)
In-Reply-To: <4b6cf406-6005-fcad-b0be-bc43396ff31f@gmail.com>



On 12/18/18 12:09 PM, Andrii Anisov wrote:
> Hello Julien,

Hi,

> On 17.12.18 19:34, Andrii Anisov wrote:
>> I see something like following as a quick WA (not even build tested):
>>
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index d2c63a8..bf72ba9 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -223,8 +223,9 @@ fail:
>>    * meet these requirements directly. So instead of proceed as follows:
>>    *
>>    * We first allocate the largest allocation we can as low as we
>> - * can. This then becomes the first bank. This bank must be at least
>> - * 128MB (or dom0_mem if that is smaller).
>> + * can. This then becomes the first bank. This bank is at least 128MB 
>> even if
>> + * dom0 is configured for less. It is the way to get that bank 128MB 
>> aligned,
>> + * what is required for 32-bit zImage.
>>    *
>>    * Then we start allocating more memory, trying to allocate the
>>    * largest possible size and trying smaller sizes until we
>> @@ -253,7 +254,7 @@ static void __init allocate_memory_11(struct 
>> domain *d,
>>                                         struct kernel_info *kinfo)
>>   {
>>       const unsigned int min_low_order =
>> -        get_order_from_bytes(min_t(paddr_t, dom0_mem, MB(128)));
>> +        get_order_from_bytes(MB(128));
>>       const unsigned int min_order = get_order_from_bytes(MB(4));
>>       struct page_info *pg;
>>       unsigned int order = get_allocation_size(kinfo->unassigned_mem);
>> @@ -268,6 +269,10 @@ static void __init allocate_memory_11(struct 
>> domain *d,
>>        */
>>       BUG_ON(!is_domain_direct_mapped(d));
>>
>> +    if ( dom0_mem < MB(128))
>> +        printk(XENLOG_WARNING "Allocating 128MB for Domain0 with 
>> %"PRIu64"MB\n",
>> +               dom0_mem/MB(1));
>> +
>>       printk("Allocating 1:1 mappings totalling %ldMB for dom0:\n",
>>              /* Don't want format this as PRIpaddr (16 digit hex) */
>>              (unsigned long)(kinfo->unassigned_mem >> 20));
>>
>>
>> But I'm not sure if it worth to be sent, because I'm going to rewrite 
>> it soon.
> 
>  From the second thought, we have last posting date for 4.12 already in 
> the past. So redesign will not go to 4.12.
> Maybe it worth to have the thing above as a bugfix for 4.12?
> What do you think?

AFAICT, it was possible to boot a Dom0 with only 64MB on Arm64. So I am 
not entirely why we would also limit the size there.

For Arm32, I think we should just return an error and fail the domain 
build. If you ask 64MB and we give you 128MB then something is already 
really wrong.

Anyway, I think this should be submitted properly to discuss for Xen 
4.12 inclusion.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-12-18 13:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 11:44 [PATCH for-4.12 v2 0/2] xen/arm: mm: Boot fixes Julien Grall
2018-12-14 11:44 ` [PATCH for-4.12 v2 1/2] xen/arm: mm: Use pte_xen_addr when creating xen entries Julien Grall
2018-12-14 21:44   ` Stefano Stabellini
2018-12-14 11:44 ` [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen Julien Grall
2018-12-14 15:52   ` Andrii Anisov
2018-12-14 16:09     ` Andrii Anisov
2018-12-14 16:26     ` Julien Grall
2018-12-14 17:24       ` Andrii Anisov
2018-12-14 17:48         ` Julien Grall
2018-12-17 11:11           ` Julien Grall
2018-12-17 16:02             ` Andrii Anisov
2018-12-17 16:56               ` Julien Grall
2018-12-17 17:57             ` Stefano Stabellini
2018-12-17 18:03               ` Julien Grall
2018-12-17 13:14           ` Andrii Anisov
2018-12-17 13:38             ` Julien Grall
2018-12-17 15:55               ` Andrii Anisov
2018-12-17 17:02                 ` Julien Grall
2018-12-17 17:34                   ` Andrii Anisov
2018-12-18 12:09                     ` Andrii Anisov
2018-12-18 13:13                       ` Julien Grall [this message]
2018-12-14 17:46       ` Andrii Anisov
2018-12-14 18:04         ` Julien Grall
2018-12-17 15:54           ` Andrii Anisov
2018-12-17 17:03             ` Julien Grall
2018-12-14 16:13   ` Andrii Anisov

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=6fc1e7ab-f2e5-fd05-79c5-3bcd48cb1435@arm.com \
    --to=julien.grall@arm.com \
    --cc=andrii.anisov@gmail.com \
    --cc=mattd@bugfuzz.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.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.