From patchwork Thu Jan 18 12:39:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Pei X-Patchwork-Id: 13522802 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 464D5241E2 for ; Thu, 18 Jan 2024 12:40:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705581636; cv=none; b=Amk25vl6PMtyJ/j3HKdlkEuUc2OvIF6tx3ebpMklZidyS6EwiC5xK7E7R56F+tn+/Rbgw6hLe1WemotT+mpZVGmUjrF2VFqOaz9TWLKPyRQ95vkoILSkn/YUzLPP46IVtEhNGjcytnVEKre/c/9NCXKyQx+8wHS4c8W91/wE5FE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705581636; c=relaxed/simple; bh=fG2nbvaDO2iaCDKu18t4CYIxFFkuV1hjAHkOmEL+RhQ=; h=Received:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding: X-CM-TRANSID:X-CM-SenderInfo:X-Coremail-Antispam; b=WQSRiF4TDQ6gpv9F1rlc26FKMV8IvMW9PvBVZtDmACLhyPCBUxSL61dv6DAMWa+T6MH/8t8+mU7VoIydXjofQneNRcE0fnX1BAPIgrtxUrcXmm/DGKdo9D+52+CWT6vf4hLKNfAY339IXirTYeV+3Op+Ee2j4izC5D5bj3ib8zk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [111.9.175.10]) by gateway (Coremail) with SMTP id _____8CxrutAHKlla6QBAA--.7621S3; Thu, 18 Jan 2024 20:40:32 +0800 (CST) Received: from localhost.localdomain (unknown [111.9.175.10]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxF80nHKll3YgIAA--.1524S3; Thu, 18 Jan 2024 20:40:31 +0800 (CST) From: Huang Pei To: Thomas Bogendoerfer Cc: Bibo Mao , linux-mips@vger.kernel.org, Jiaxun Yang , Paul Burton , Li Xuefeng , Yang Tiezhu , Gao Juxin , Huacai Chen Subject: [PATCH 1/2] MIPS: reserve exception vector space ONLY ONCE Date: Thu, 18 Jan 2024 20:39:28 +0800 Message-Id: <20240118123929.369939-2-huangpei@loongson.cn> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240118123929.369939-1-huangpei@loongson.cn> References: <20240118123929.369939-1-huangpei@loongson.cn> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxF80nHKll3YgIAA--.1524S3 X-CM-SenderInfo: xkxd0whshlqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj93XoW7KFy8ZrW3GF43uFW7Jw1DurX_yoW8WF17p3 WjkasxKr40kr90qay3Jw1DAr4rXF4kWw48K347Ar4Sv3W5Xr13Xwn2qFy3Xr9I9rWxCa4r uF95Z3WayanrZwbCm3ZEXasCq-sJn29KB7ZKAUJUUUUr529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUU9Yb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVWxJr0_GcWln4kS14v26r1Y6r17M2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r12 6r1DMcIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64 vIr41l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xFxVAFwI0_ Jrv_JF1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1V AY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAI cVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42 IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIev Ja73UjIFyTuYvjxU466zUUUUU cpu_probe is called by BP an APs, but reserving exception vector 0x0-0x1000 need once. Call it on cpu 0. Signed-off-by: Huang Pei --- 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); + } } else { c->cputype = CPU_BMIPS4350; __cpu_name[cpu] = "Broadcom BMIPS4350"; @@ -1598,7 +1600,9 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) __cpu_name[cpu] = "Broadcom BMIPS5000"; set_elf_platform(cpu, "bmips5000"); c->options |= MIPS_CPU_ULRI | MIPS_CPU_RIXI; - reserve_exception_space(0x1000, VECTORSPACING * 64); + if (cpu == 0) { + reserve_exception_space(0x1000, VECTORSPACING * 64); + } break; } } @@ -1992,12 +1996,13 @@ void cpu_probe(void) */ loongson3_cpucfg_synthesize_data(c); + if (cpu == 0) { #ifdef CONFIG_64BIT - if (cpu == 0) __ua_limit = ~((1ull << cpu_vmbits) - 1); #endif + reserve_exception_space(0, 0x1000); + } - reserve_exception_space(0, 0x1000); } void cpu_report(void)