mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Huang Pei <huangpei@loongson.cn>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Sasha Levin <sashal@kernel.org>,
	bhelgaas@google.com, arnd@arndb.de, akpm@linux-foundation.org,
	linux-mips@vger.kernel.org
Subject: [PATCH AUTOSEL 5.15 10/11] MIPS: reserve exception vector space ONLY ONCE
Date: Fri,  2 Feb 2024 13:41:24 -0500	[thread overview]
Message-ID: <20240202184130.541736-10-sashal@kernel.org> (raw)
In-Reply-To: <20240202184130.541736-1-sashal@kernel.org>

From: Huang Pei <huangpei@loongson.cn>

[ Upstream commit abcabb9e30a1f9a69c76776f8abffc31c377b542 ]

"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 APs is
too late since memblock is unavailable at that time.

So, reserve exception vector ONLY by BP.

Suggested-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Huang Pei <huangpei@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/kernel/traps.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index afb2c955d99e..5c01a21a216b 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -2001,7 +2001,13 @@ unsigned long vi_handlers[64];
 
 void reserve_exception_space(phys_addr_t addr, unsigned long size)
 {
-	memblock_reserve(addr, size);
+	/*
+	 * reserve exception space on CPUs other than CPU0
+	 * is too late, since memblock is unavailable when APs
+	 * up
+	 */
+	if (smp_processor_id() == 0)
+		memblock_reserve(addr, size);
 }
 
 void __init *set_except_vector(int n, void *addr)
-- 
2.43.0


  parent reply	other threads:[~2024-02-02 18:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 18:41 [PATCH AUTOSEL 5.15 01/11] wifi: cfg80211: fix missing interfaces when dumping Sasha Levin
2024-02-02 18:41 ` [PATCH AUTOSEL 5.15 02/11] wifi: mac80211: fix race condition on enabling fast-xmit Sasha Levin
2024-02-02 18:41 ` [PATCH AUTOSEL 5.15 03/11] fbdev: savage: Error out if pixclock equals zero Sasha Levin
2024-02-02 18:41 ` [PATCH AUTOSEL 5.15 04/11] fbdev: sis: " Sasha Levin
2024-02-02 18:41 ` [PATCH AUTOSEL 5.15 05/11] x86/cpu: Add model number for Intel Clearwater Forest processor Sasha Levin
2024-02-02 18:41 ` [PATCH AUTOSEL 5.15 06/11] spi: hisi-sfc-v3xx: Return IRQ_NONE if no interrupts were detected Sasha Levin
2024-02-02 18:41 ` [PATCH AUTOSEL 5.15 07/11] ahci: asm1166: correct count of reported ports Sasha Levin
2024-02-02 18:41 ` [PATCH AUTOSEL 5.15 08/11] exec: Distinguish in_execve from in_exec Sasha Levin
2024-02-02 18:41 ` [PATCH AUTOSEL 5.15 09/11] ahci: add 43-bit DMA address quirk for ASMedia ASM1061 controllers Sasha Levin
2024-02-02 18:41 ` Sasha Levin [this message]
2024-02-02 18:41 ` [PATCH AUTOSEL 5.15 11/11] platform/x86: touchscreen_dmi: Add info for the TECLAST X16 Plus tablet Sasha Levin

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=20240202184130.541736-10-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=huangpei@loongson.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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

Powered by JetHome