All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stefano Stabellini <stefanos@xilinx.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien.grall@arm.com>,
	206497@studenti.unimore.it,
	xen-devel <xen-devel@lists.xenproject.org>,
	nd@arm.com
Subject: Re: [PATCH] xen/arm: skip first page when RAM starts at 0x0
Date: Thu, 02 May 2019 01:30:52 -0600	[thread overview]
Message-ID: <5CCA9CAC020000780022B058@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1905011536510.23881@sstabellini-ThinkPad-X260>

>>> On 02.05.19 at 00:44, <sstabellini@kernel.org> wrote:
> Hi Jan, I have a question on the PDX code.
> 
> The PDX initialization is a bit different between x86 and ARM, but it
> follows roughly the same pattern, look at
> xen/arch/x86/srat.c:srat_parse_regions (I take that is where things
> happen on x86) and xen/arch/arm/setup.c:init_pdx.
> 
> Mask is initialized calling pdx_init_mask on a start address, then a
> loop fills in the rest of the mask calling pdx_region_mask, based on the
> memory regions present.
> 
> I wrote a small unit test of the ARM PDX initialization and while I was
> playing with addresses and values I noticed that actually if I simply
> skip pdx_init_mask and just initialize the mask to 0 (mask = 0) in
> init_pdx, the rest of the function always calculates the right mask.
> 
> In fact, there are cases where initializing the mask to a value causes
> the rest of the code to miss some potential compressions. While
> initializing the mask to 0 leads to more optimizations. I can provide
> specific examples if you are curious.
> 
> Before I make any changes to that code, I would like to understand a bit
> better why things are done that way today. Do you know why the mask is
> initialized to pdx_init_mask(start-of-ram)?

I'm confused, and hence I'm perhaps misunderstanding your
question. To me it looks like you're re-asking a question already
answered. On x86 we don't want to squash out any of the low
32 bits, because of the special address ranges that live below
4Gb. Hence we invoke pdx_init_mask(first-block-at-or-above-4Gb).
Note it's not start-of-ram, as you've said.

Jan



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

WARNING: multiple messages have this Message-ID (diff)
From: "Jan Beulich" <JBeulich@suse.com>
To: "Stefano Stabellini" <sstabellini@kernel.org>
Cc: Stefano Stabellini <stefanos@xilinx.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien.grall@arm.com>,
	206497@studenti.unimore.it,
	xen-devel <xen-devel@lists.xenproject.org>,
	nd@arm.com
Subject: Re: [Xen-devel] [PATCH] xen/arm: skip first page when RAM starts at 0x0
Date: Thu, 02 May 2019 01:30:52 -0600	[thread overview]
Message-ID: <5CCA9CAC020000780022B058@prv1-mh.provo.novell.com> (raw)
Message-ID: <20190502073052.2qNSrdtnXMsO17Ri-mkAVUnU80fVAQqT9mG5jE5Ay_I@z> (raw)
In-Reply-To: <alpine.DEB.2.10.1905011536510.23881@sstabellini-ThinkPad-X260>

>>> On 02.05.19 at 00:44, <sstabellini@kernel.org> wrote:
> Hi Jan, I have a question on the PDX code.
> 
> The PDX initialization is a bit different between x86 and ARM, but it
> follows roughly the same pattern, look at
> xen/arch/x86/srat.c:srat_parse_regions (I take that is where things
> happen on x86) and xen/arch/arm/setup.c:init_pdx.
> 
> Mask is initialized calling pdx_init_mask on a start address, then a
> loop fills in the rest of the mask calling pdx_region_mask, based on the
> memory regions present.
> 
> I wrote a small unit test of the ARM PDX initialization and while I was
> playing with addresses and values I noticed that actually if I simply
> skip pdx_init_mask and just initialize the mask to 0 (mask = 0) in
> init_pdx, the rest of the function always calculates the right mask.
> 
> In fact, there are cases where initializing the mask to a value causes
> the rest of the code to miss some potential compressions. While
> initializing the mask to 0 leads to more optimizations. I can provide
> specific examples if you are curious.
> 
> Before I make any changes to that code, I would like to understand a bit
> better why things are done that way today. Do you know why the mask is
> initialized to pdx_init_mask(start-of-ram)?

I'm confused, and hence I'm perhaps misunderstanding your
question. To me it looks like you're re-asking a question already
answered. On x86 we don't want to squash out any of the low
32 bits, because of the special address ranges that live below
4Gb. Hence we invoke pdx_init_mask(first-block-at-or-above-4Gb).
Note it's not start-of-ram, as you've said.

Jan



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

  reply	other threads:[~2019-05-02  7:30 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25 17:51 [PATCH] xen/arm: skip first page when RAM starts at 0x0 Stefano Stabellini
2019-04-25 17:51 ` [Xen-devel] " Stefano Stabellini
2019-04-25 21:27 ` Julien Grall
2019-04-25 21:27   ` [Xen-devel] " Julien Grall
2019-04-26  9:12   ` Jan Beulich
2019-04-26  9:12     ` [Xen-devel] " Jan Beulich
2019-04-26  9:19     ` Julien Grall
2019-04-26  9:19       ` [Xen-devel] " Julien Grall
2019-04-26  9:42       ` Jan Beulich
2019-04-26  9:42         ` [Xen-devel] " Jan Beulich
2019-04-26 15:38         ` Julien Grall
2019-04-26 15:38           ` [Xen-devel] " Julien Grall
2019-04-26 15:48           ` Jan Beulich
2019-04-26 15:48             ` [Xen-devel] " Jan Beulich
2019-04-26 21:31             ` Julien Grall
2019-04-26 21:31               ` [Xen-devel] " Julien Grall
2019-04-26 23:47               ` Stefano Stabellini
2019-04-26 23:47                 ` [Xen-devel] " Stefano Stabellini
2019-04-27 19:43                 ` Julien Grall
2019-04-27 19:43                   ` [Xen-devel] " Julien Grall
2019-04-29  7:15                 ` Jan Beulich
2019-04-29  7:15                   ` [Xen-devel] " Jan Beulich
2019-04-29 15:54                   ` Julien Grall
2019-04-29 15:54                     ` [Xen-devel] " Julien Grall
2019-04-29 16:07                     ` Jan Beulich
2019-04-29 16:07                       ` [Xen-devel] " Jan Beulich
2019-04-29 17:51                       ` Stefano Stabellini
2019-04-29 17:51                         ` [Xen-devel] " Stefano Stabellini
2019-05-01 22:44                         ` Stefano Stabellini
2019-05-01 22:44                           ` [Xen-devel] " Stefano Stabellini
2019-05-02  7:30                           ` Jan Beulich [this message]
2019-05-02  7:30                             ` Jan Beulich
2019-05-02  9:02                             ` Julien Grall
2019-05-02  9:02                               ` [Xen-devel] " Julien Grall
2019-05-02  9:20                               ` Jan Beulich
2019-05-02  9:20                                 ` [Xen-devel] " Jan Beulich
2019-05-02 22:25                                 ` Stefano Stabellini
2019-05-02 22:25                                   ` [Xen-devel] " Stefano Stabellini
2019-05-03  7:26                                   ` Jan Beulich
2019-05-03  7:26                                     ` [Xen-devel] " Jan Beulich
2019-05-03 20:16                                     ` Stefano Stabellini
2019-05-03 20:16                                       ` [Xen-devel] " Stefano Stabellini
2019-04-29  7:07               ` Jan Beulich
2019-04-29  7:07                 ` [Xen-devel] " Jan Beulich

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=5CCA9CAC020000780022B058@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=206497@studenti.unimore.it \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=nd@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=stefanos@xilinx.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 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.