All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: jgross@suse.com, Julien Grall <julien@xen.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	xen-devel@lists.xenproject.org,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [Xen-devel] [PATCH for-4.13] xen/arm: mm: Allow generic xen page-tables helpers to be called early
Date: Fri, 11 Oct 2019 14:33:56 +0100	[thread overview]
Message-ID: <6784a597-0865-5069-18be-4dc4197de7ff@arm.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1910101706350.9081@sstabellini-ThinkPad-T480s>

(+ Andrew and Jan)

Hi,

On 11/10/2019 01:27, Stefano Stabellini wrote:
> On Thu, 10 Oct 2019, Julien Grall wrote:
>> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
>> index be23acfe26..a6637ce347 100644
>> --- a/xen/arch/arm/mm.c
>> +++ b/xen/arch/arm/mm.c
>> @@ -964,11 +964,40 @@ static int create_xen_table(lpae_t *entry)
>>   
>>   static lpae_t *xen_map_table(mfn_t mfn)
>>   {
>> +    /*
>> +     * We may require to map the page table before map_domain_page() is
>> +     * useable. The requirements here is it must be useable as soon as
>> +     * page-tables are allocated dynamically via alloc_boot_pages().
>> +     *
>> +     * We need to do the check on physical address rather than virtual
>> +     * address to avoid truncation on Arm32. Therefore is_kernel() cannot
>> +     * be used.
>> +     */
>> +    if ( system_state == SYS_STATE_early_boot )
>> +    {
>> +        const mfn_t mstart = virt_to_mfn(_start);
>> +        const mfn_t mend = virt_to_mfn(_end);
>> +
>> +        if ( (mfn_x(mstart) <= mfn_x(mfn)) && (mfn_x(mfn) < mfn_x(mend)) )
>> +        {
> 
> The patch is good. Actually I noticed that we already have
> is_xen_fixed_mfn(), looks like it is made for this. I think we should
> use it here, except that is_xen_fixed_mfn has:

Thanks, I thought we had one but I couldn't remember the name :(.

> 
>       (mfn_to_maddr(mfn) <= virt_to_maddr(&_end)))
> 
> I think it should actually be:
> 
>       (mfn_to_maddr(mfn) < virt_to_maddr(&_end)))
> 
> Maybe we could fix that at the same time in one patch? However, it is
> the same definition as on x86, so I don't know what is going on there.

For Arm we should definitely use < and not <=.

I am assuming this is the same for x86. Andrew? Jan?

Cheers,

-- 
Julien Grall

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

  parent reply	other threads:[~2019-10-11 13:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 17:52 [Xen-devel] [PATCH for-4.13] xen/arm: mm: Allow generic xen page-tables helpers to be called early Julien Grall
2019-10-11  0:27 ` Stefano Stabellini
2019-10-11 13:06   ` Julien Grall
2019-10-11 13:33   ` Julien Grall [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-09-17 16:02 [Xen-devel] [[PATCH for-4.13]] " Julien Grall
2019-09-19 23:37 ` Stefano Stabellini
2019-09-20  9:44   ` Julien Grall
2019-09-20 15:16     ` Stefano Stabellini
2019-09-20 15:26       ` Julien Grall
2019-10-02 17:49         ` Julien Grall
2019-10-03  1:02         ` Stefano Stabellini
2019-10-07 20:35           ` Julien Grall
2019-10-08  0:18             ` Stefano Stabellini
2019-10-08 14:02               ` Julien Grall
2019-10-08 22:24                 ` Stefano Stabellini
2019-10-10 16:56                   ` Julien Grall
2019-10-11  0:32                     ` Stefano Stabellini
2019-10-11 10:14                       ` Julien Grall
2019-10-11 17:11                         ` Stefano Stabellini
2019-10-11 17:51                           ` Julien Grall
2019-10-11 19:01                             ` Stefano Stabellini
2019-10-11 19:14                               ` Julien Grall
2019-09-25 15:23 ` Julien Grall
2019-09-25 15:27   ` Jürgen Groß
2019-10-11  9:53 ` Xia, Hongyan
2019-10-16 12:46   ` Julien Grall
2019-10-16 13:16     ` Xia, Hongyan

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=6784a597-0865-5069-18be-4dc4197de7ff@arm.com \
    --to=julien.grall@arm.com \
    --cc=JBeulich@suse.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.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.