From: Julien Grall <julien.grall@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <stefanos@xilinx.com>,
wei.liu2@citrix.com, konrad.wilk@oracle.com,
George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
ian.jackson@eu.citrix.com, tim@xen.org, JBeulich@suse.com
Subject: Re: [Xen-devel] [PATCH v5 2/2] xen/arm: fix mask calculation in pdx_init_mask
Date: Mon, 24 Jun 2019 11:25:45 +0100 [thread overview]
Message-ID: <19811e20-73ba-0a30-7918-fd58da411514@arm.com> (raw)
In-Reply-To: <20190621202407.7781-2-sstabellini@kernel.org>
Hi Stefano,
On 6/21/19 9:24 PM, Stefano Stabellini wrote:
> The mask calculation in pdx_init_mask is wrong when the first bank
> starts at address 0x0. The reason is that pdx_init_mask will do '0 - 1'
> causing an underflow. As a result, the mask becomes 0xffffffffffffffff
> which is the biggest possible mask and ends up causing a significant
> memory waste in the frametable size computation.
>
> For instance, on platforms that have a low memory bank starting at 0x0
> and a high memory bank, the frametable will end up covering all the
> holes in between.
>
> The purpose of the mask is to be passed as a parameter to
> pfn_pdx_hole_setup, which based on the mask parameter calculates
> pfn_pdx_hole_shift, pfn_pdx_bottom_mask, etc. which are actually the
> important masks for frametable initialization later on.
>
> pfn_pdx_hole_setup never compresses addresses below MAX_ORDER bits (1GB
> on ARM). Thus, it is safe to initialize mask passing 1ULL << (MAX_ORDER
> + PAGE_SHIFT) as start address to pdx_init_mask.
>
> Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
> Reviewed-by: Julien Grall <julien.grall@arm.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>
Unfortunately this patch is breaking boot on AMD Seattle (laxton{0,1})
see [1]. The bisector fingered this patch [2].
To unblock osstest, I have taken the liberty to revert the patch on staging.
From Linux, the memory range for Seattle is
0x0000008000000000-0x00000087ffffffff
I am not entirely sure why this patch affects the boot. Stefano can you
look at it?
Cheers,
[1]
http://logs.test-lab.xenproject.org/osstest/results/history/test-arm64-arm64-xl-xsm/xen-unstable-smoke.html
[2] https://lists.xen.org/archives/html/xen-devel/2019-06/msg01549.html
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
prev parent reply other threads:[~2019-06-24 10:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-21 20:23 [Xen-devel] [PATCH v5 0/2] fix mask calculation in pdx_init_mask Stefano Stabellini
2019-06-21 20:24 ` [Xen-devel] [PATCH v5 1/2] xen: Replace u64 with uint64_t in pdx_init_mask() and callers Stefano Stabellini
2019-06-21 20:24 ` [Xen-devel] [PATCH v5 2/2] xen/arm: fix mask calculation in pdx_init_mask Stefano Stabellini
2019-06-24 10:25 ` Julien Grall [this message]
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=19811e20-73ba-0a30-7918-fd58da411514@arm.com \
--to=julien.grall@arm.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=sstabellini@kernel.org \
--cc=stefanos@xilinx.com \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).