From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933057AbcBCDQx (ORCPT ); Tue, 2 Feb 2016 22:16:53 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:5207 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932822AbcBCDQs (ORCPT ); Tue, 2 Feb 2016 22:16:48 -0500 From: Paul Burton To: , Ralf Baechle CC: Markos Chandras , Paul Burton , Leonid Yegoshin , "Maciej W. Rozycki" , , James Hogan , Petri Gynther Subject: [PATCH 02/15] MIPS: traps: Make sure secondary cores have a sane ebase register Date: Wed, 3 Feb 2016 03:15:22 +0000 Message-ID: <1454469335-14778-3-git-send-email-paul.burton@imgtec.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454469335-14778-1-git-send-email-paul.burton@imgtec.com> References: <1454469335-14778-1-git-send-email-paul.burton@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.100.200.215] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markos Chandras We shouldn't trust that the secondary cores will have a sane ebase register (either from the bootloader or during the hardware design phase) so use the ebase address as calculated by the boot CPU. Signed-off-by: Markos Chandras Signed-off-by: Paul Burton --- arch/mips/kernel/traps.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index bafcb7a..1fb5f8a 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2125,6 +2125,13 @@ void per_cpu_trap_init(bool is_boot_cpu) * o read IntCtl.IPFDC to determine the fast debug channel interrupt */ if (cpu_has_mips_r2_r6) { + /* + * We shouldn't trust a secondary core has a sane EBASE register + * so use the one calculated by the boot CPU. + */ + if (!is_boot_cpu) + write_c0_ebase(ebase); + cp0_compare_irq_shift = CAUSEB_TI - CAUSEB_IP; cp0_compare_irq = (read_c0_intctl() >> INTCTLB_IPTI) & 7; cp0_perfcount_irq = (read_c0_intctl() >> INTCTLB_IPPCI) & 7; -- 2.7.0