All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Huang Pei <huangpei@loongson.cn>
Cc: Bibo Mao <maobibo@loongson.cn>,
	linux-mips@vger.kernel.org, Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Paul Burton <paulburton@kernel.org>,
	Li Xuefeng <lixuefeng@loongson.cn>,
	Yang Tiezhu <yangtiezhu@loongson.cn>,
	Gao Juxin <gaojuxin@loongson.cn>,
	Huacai Chen <chenhuacai@loongson.cn>
Subject: Re: [PATCH 1/2] MIPS: reserve exception vector space ONLY ONCE
Date: Fri, 19 Jan 2024 17:15:02 +0100	[thread overview]
Message-ID: <ZaqgBugqaPLZTofT@alpha.franken.de> (raw)
In-Reply-To: <20240119040240.392442-2-huangpei@loongson.cn>

On Fri, Jan 19, 2024 at 12:02:39PM +0800, Huang Pei wrote:
> "cpu_probe" is called both by BP and APs, but reserving exception vector
> (like 0x0-0x1000) called by "cpu_probe" need once and calling on BPs is
> too late since memblock is unavailable at that time.
> 
> So, reserve exception vector ONLY by BP.
> 
> Signed-off-by: Huang Pei <huangpei@loongson.cn>
> ---
>  arch/mips/kernel/cpu-probe.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
> index b406d8bfb15a..6939d0de2a03 100644
> --- a/arch/mips/kernel/cpu-probe.c
> +++ b/arch/mips/kernel/cpu-probe.c
> @@ -1581,7 +1581,9 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
>  			__cpu_name[cpu] = "Broadcom BMIPS4380";
>  			set_elf_platform(cpu, "bmips4380");
>  			c->options |= MIPS_CPU_RIXI;
> -			reserve_exception_space(0x400, VECTORSPACING * 64);
> +			if (cpu == 0) {
> +				reserve_exception_space(0x400, VECTORSPACING * 64);
> +			}

why not do a 

if (smp_processor_id() == 0)
	memblock_reserve(...)
		
in reserve_exception_space() ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

  parent reply	other threads:[~2024-01-19 16:15 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-25  9:30 [PATCH] MIPS: loongson64: fix boot failure Huang Pei
2024-01-09 21:40 ` Thomas Bogendoerfer
2024-01-13  9:55   ` [PATCH V2]: " Huang Pei
2024-01-13  9:55     ` [PATCH 1/3] MIPS: adjust exception vector space revervation Huang Pei
2024-01-13  9:55     ` [PATCH 2/3] MIPS: loongson64: fix booting failure Huang Pei
2024-01-13  9:55     ` [PATCH 3/3] Revert "MIPS: Loongson64: Handle more memory types passed from firmware" Huang Pei
2024-01-13 11:59       ` Jiaxun Yang
2024-01-14  8:53         ` Huang Pei
2024-01-14 11:58           ` Jiaxun Yang
2024-01-15  1:25             ` Huang Pei
2024-01-15 14:14               ` Jiaxun Yang
2024-01-16  3:10                 ` Huang Pei
2024-01-18 12:39   ` [PATCH V3]: MIPS: loongson64: fix booting failure Huang Pei
2024-01-18 12:39     ` [PATCH 1/2] MIPS: reserve exception vector space ONLY ONCE Huang Pei
2024-01-18 12:39     ` [PATCH 2/2] MIPS: loongson64: set nid for reserved memblock region Huang Pei
2024-01-19  4:02   ` [PATCH V4]: MIPS: loongson64: fix boot failure Huang Pei
2024-01-19  4:02     ` [PATCH 1/2] MIPS: reserve exception vector space ONLY ONCE Huang Pei
2024-01-19 15:23       ` Sergei Shtylyov
2024-01-19 16:15       ` Thomas Bogendoerfer [this message]
2024-01-21  7:13         ` Huang Pei
2024-01-19  4:02     ` [PATCH 2/2] MIPS: loongson64: set nid for reserved memblock region Huang Pei
2024-01-19 10:05       ` Jiaxun Yang
2024-01-21  2:14         ` Huang Pei
2024-01-21 10:35           ` Jiaxun Yang
2024-01-22  8:08   ` [PATCH V6]: MIPS: loongson64: fix boot failure Huang Pei
2024-01-22  8:08     ` [PATCH 1/2] MIPS: reserve exception vector space ONLY ONCE Huang Pei
2024-01-22  8:08     ` [PATCH 2/2] MIPS: loongson64: set nid for reserved memblock region Huang Pei
2024-01-22  8:20       ` Sergey Shtylyov
2024-01-23  1:47   ` [PATCH 1/2] MIPS: reserve exception vector space ONLY ONCE Huang Pei
2024-01-23  1:47     ` [PATCH 2/2] MIPS: loongson64: set nid for reserved memblock region Huang Pei
2024-01-26 10:12       ` Thomas Bogendoerfer
2024-01-26 14:24         ` Huacai Chen
2024-01-26 17:24           ` Thomas Bogendoerfer
2024-01-27  9:12             ` [PATCH] " Huang Pei
2024-01-27  9:12               ` Huang Pei
2024-01-27 10:04                 ` Thomas Bogendoerfer
2024-01-28  4:42                   ` Huang Pei
2024-01-26 10:12     ` [PATCH 1/2] MIPS: reserve exception vector space ONLY ONCE Thomas Bogendoerfer
2024-01-15 14:08 ` memblock_reserve for unadded region (was: [PATCH] MIPS: loongson64: fix boot failure) Jiaxun Yang
2024-01-16  3:27   ` Huang Pei
2024-01-16  8:39   ` Mike Rapoport
2024-01-16 12:23     ` Huang Pei
2024-01-17  2:20       ` Yajun Deng
2024-01-17  3:01         ` Huang Pei
2024-01-17  3:17           ` Yajun Deng
2024-01-17  3:59             ` Huang Pei
2024-01-17  6:46               ` Mike Rapoport
2024-01-17  7:45                 ` Huang Pei
2024-01-17 11:08                   ` Mike Rapoport
2024-01-18  2:26                     ` Huang Pei

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=ZaqgBugqaPLZTofT@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=chenhuacai@loongson.cn \
    --cc=gaojuxin@loongson.cn \
    --cc=huangpei@loongson.cn \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-mips@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=maobibo@loongson.cn \
    --cc=paulburton@kernel.org \
    --cc=yangtiezhu@loongson.cn \
    /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.