]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: force hart_lottery to put in .sdata section
authorZong Li <zong.li@sifive.com>
Tue, 4 Feb 2020 11:19:47 +0000 (19:19 +0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Tue, 3 Mar 2020 18:28:11 +0000 (10:28 -0800)
commite524e55b29ec8cb2307fd66e70cc5896c91323e6
treede4e4c049078c2797b654767457568f32374643a
parent58699a7d67c92f2ea5b2dbb03dd5e547d3d63006
riscv: force hart_lottery to put in .sdata section

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>
Reviewed-by: Anup Patel <anup@brainfault.org>
[Palmer: added a comment]
Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/kernel/setup.c