From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Cc: Roy Franz <roy.franz@linaro.org>,
tim@xen.org, Fu Wei <fu.wei@linaro.org>,
Jan Beulich <JBeulich@suse.com>,
stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH RFC 2/2] xen: arm: Enable physical address space compression (PDX) on arm64
Date: Thu, 07 Aug 2014 17:03:13 +0100 [thread overview]
Message-ID: <53E3A341.2000502@linaro.org> (raw)
In-Reply-To: <53da2211.8511ec0a.4375.46ddSMTPIN_ADDED_MISSING@mx.google.com>
Hi Ian,
On 07/31/2014 12:01 PM, Ian Campbell wrote:
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index 446b4dc..dbd92bb 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -423,6 +423,46 @@ static paddr_t __init get_xen_paddr(void)
> return paddr;
> }
>
> +/* Sets all bits from the most-significant 1-bit down to the LSB */
> +static u64 __init fill_mask(u64 mask)
> +{
> + while (mask & (mask + 1))
Coding style: Missing spaces
> + mask |= mask + 1;
> + return mask;
> +}
> +
> +static void init_pdx(void)
> +{
> + u64 mask = fill_mask(bootinfo.mem.bank[0].start - 1);
> + int bank;
> +
> + for ( bank = 0 ; bank < bootinfo.mem.nr_banks; bank++ )
> + {
> + paddr_t bank_start = bootinfo.mem.bank[bank].start;
> + paddr_t bank_size = bootinfo.mem.bank[bank].size;
> + paddr_t bank_end = bank_start + bank_size;
> +
> + set_pdx_range(paddr_to_pfn(bank_start),
> + paddr_to_pfn(bank_end));
> +
> +
> + mask |= bank_start | fill_mask(bank_start ^ (bank_end - 1));
> + }
> +
> + for ( bank = 0 ; bank < bootinfo.mem.nr_banks; bank++ )
> + {
> + paddr_t bank_start = bootinfo.mem.bank[bank].start;
> + paddr_t bank_size = bootinfo.mem.bank[bank].size;
> + paddr_t bank_end = bank_start + bank_size;
> +
> + if (~mask &
> + fill_mask(bank_start ^ (bank_end - 1)))
Coding style.
I don't really understand what the function is achieving. Could you
explain a bit more?
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-08-07 16:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <a0063c96455a2512091f40df5b7b8ec5bbef4b13.1406804493.git.ian.campbell@citrix.com>
2014-07-31 11:01 ` [PATCH RFC 2/2] xen: arm: Enable physical address space compression (PDX) on arm64 Ian Campbell
[not found] ` <53da2211.8511ec0a.4375.46ddSMTPIN_ADDED_MISSING@mx.google.com>
2014-08-06 3:04 ` Roy Franz
2014-08-07 16:03 ` Julien Grall [this message]
2014-09-04 16:40 ` Ian Campbell
2014-09-05 8:20 ` Jan Beulich
2014-09-05 8:26 ` Ian Campbell
2014-09-09 0:32 ` Julien Grall
2014-09-09 12:16 ` Ian Campbell
2014-09-09 16:54 ` Roy Franz
2014-09-09 20:59 ` Julien Grall
2014-09-10 9:36 ` Ian Campbell
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=53E3A341.2000502@linaro.org \
--to=julien.grall@linaro.org \
--cc=JBeulich@suse.com \
--cc=fu.wei@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=roy.franz@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.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.