xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@linaro.org>
To: Julien Grall <julien.grall@linaro.org>
Cc: xen-devel@lists.xenproject.org, stefano.stabellini@eu.citrix.com,
	tim@xen.org, ian.campbell@citrix.com, patches@linaro.org
Subject: Re: [PATCH] xen/arm: midway: implement SMP
Date: Tue, 19 Nov 2013 16:24:05 +0100	[thread overview]
Message-ID: <528B8295.3080806@linaro.org> (raw)
In-Reply-To: <1384781260-10429-1-git-send-email-julien.grall@linaro.org>

On 11/18/2013 02:27 PM, Julien Grall wrote:
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> ---
>   xen/arch/arm/platforms/midway.c | 22 ++++++++++++++++++++++
>   1 file changed, 22 insertions(+)
>
> diff --git a/xen/arch/arm/platforms/midway.c b/xen/arch/arm/platforms/midway.c
> index 399056b..3b9fcfc 100644
> --- a/xen/arch/arm/platforms/midway.c
> +++ b/xen/arch/arm/platforms/midway.c
> @@ -47,6 +47,27 @@ static uint32_t midway_quirks(void)
>       return PLATFORM_QUIRK_DOM0_MAPPING_11;
>   }
>
> +static int __init midway_cpu_up(int cpu)

Wouldn't it make more sense to do this initialization in smp_init() 
instead of here per CPU? init_secondary() is fixed and thus we will not 
write different values for each core.
I guess it does not really matter, I was just wondering whether this 
would be a saner approach (and I think your first version was this way, 
right?)

Thanks,
Andre.

P.S. BTW: Any reason we instantiate cpu_up() for all platforms where 
they are actually NOPs? I think the platform code only calls a function 
if it is non-NULL, so we could just skip all of this: cpu_up() {return 
0;} definition.

> +{
> +    void __iomem *pens;
> +
> +    pens = ioremap_nocache(0, PAGE_SIZE);
> +    if ( !pens )
> +    {
> +        dprintk(XENLOG_ERR, "Unable to map midway pens MMIO\n");
> +        return -EFAULT;
> +    }
> +
> +    printk("Set cpu pen %u to %"PRIpaddr" (%p)\n",
> +           cpu, __pa(init_secondary), init_secondary);
> +
> +    writel(__pa(init_secondary), pens + 0x40 + cpu * 0x10);
> +
> +    iounmap(pens);
> +
> +    return 0;
> +}
> +
>   static const char * const midway_dt_compat[] __initconst =
>   {
>       "calxeda,ecx-2000",
> @@ -57,6 +78,7 @@ PLATFORM_START(midway, "CALXEDA MIDWAY")
>       .compatible = midway_dt_compat,
>       .reset = midway_reset,
>       .quirks = midway_quirks,
> +    .cpu_up = midway_cpu_up,
>   PLATFORM_END
>
>   /*
>

  parent reply	other threads:[~2013-11-19 15:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 13:27 [PATCH] xen/arm: midway: implement SMP Julien Grall
2013-11-18 15:47 ` Stefano Stabellini
2013-11-19 14:52 ` Ian Campbell
2013-11-19 15:24 ` Andre Przywara [this message]
2013-11-19 15:46   ` 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=528B8295.3080806@linaro.org \
    --to=andre.przywara@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=patches@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.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 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).