linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Alex Ghiti <alex@ghiti.fr>
To: Zong Li <zong.li@sifive.com>,
	paul.walmsley@sifive.com, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: force hart_lottery to put in .sdata section
Date: Mon, 10 Feb 2020 01:42:44 -0500	[thread overview]
Message-ID: <c5cbea2f-eaad-19eb-ba38-03a71e0ab7c2@ghiti.fr> (raw)
In-Reply-To: <20200204111947.52013-1-zong.li@sifive.com>

Hi Zong,

On 2/4/20 6:19 AM, Zong Li wrote:
> In PIC code model, the zero initialized data always be put in .bss
> section, so when building kernel as PIE, the hart_lottery won't present
> in small data section, and it causes more than one harts to get the
> lottery, because the main hart clears the content of .bss section
> immediately after it getting the lottery.
> 
> Signed-off-by: Zong Li <zong.li@sifive.com>
> ---
>   arch/riscv/kernel/setup.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> index 22b671dbbcf1..45c63dc06360 100644
> --- a/arch/riscv/kernel/setup.c
> +++ b/arch/riscv/kernel/setup.c
> @@ -40,7 +40,7 @@ struct screen_info screen_info = {
>   #endif
>   
>   /* The lucky hart to first increment this variable will boot the other cores */
> -atomic_t hart_lottery;
> +atomic_t hart_lottery __section(.sdata);
>   unsigned long boot_cpu_hartid;
>   
>   void __init parse_dtb(void)
> 

Thanks for testing the relocatable patch in SMP and fixing this issue. 
It looks good to me too as I did not find any other variable being used 
before bss clearing so feel free to add:

Reviewed-by: Alexandre Ghiti <alex@ghiti.fr>


      parent reply	other threads:[~2020-02-10  6:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 11:19 [PATCH] riscv: force hart_lottery to put in .sdata section Zong Li
2020-02-04 11:39 ` Anup Patel
2020-02-05 11:07   ` Zong Li
2020-02-18 21:26     ` Palmer Dabbelt
2020-02-19  8:48       ` Zong Li
2020-02-10  6:42 ` Alex Ghiti [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=c5cbea2f-eaad-19eb-ba38-03a71e0ab7c2@ghiti.fr \
    --to=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=zong.li@sifive.com \
    /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).