From patchwork Fri Mar 14 00:00:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 330150 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 893CD2C019C for ; Fri, 14 Mar 2014 11:02:39 +1100 (EST) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0206.outbound.protection.outlook.com [207.46.163.206]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C26622C00CD for ; Fri, 14 Mar 2014 11:01:14 +1100 (EST) Received: from snotra.am.freescale.net (192.88.168.49) by BY2PR03MB395.namprd03.prod.outlook.com (10.141.141.14) with Microsoft SMTP Server (TLS) id 15.0.898.11; Fri, 14 Mar 2014 00:01:01 +0000 From: Scott Wood To: Benjamin Herrenschmidt Subject: [PATCH 01/10] powerpc/book3e: initialize crit/mc/dbg kernel stack pointers Date: Thu, 13 Mar 2014 19:00:40 -0500 Message-ID: <1394755249-8856-2-git-send-email-scottwood@freescale.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1394755249-8856-1-git-send-email-scottwood@freescale.com> References: <1394755249-8856-1-git-send-email-scottwood@freescale.com> MIME-Version: 1.0 X-Originating-IP: [192.88.168.49] X-ClientProxiedBy: DM2PR04CA004.namprd04.prod.outlook.com (10.141.96.14) To BY2PR03MB395.namprd03.prod.outlook.com (10.141.141.14) X-Forefront-PRVS: 0150F3F97D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009001)(6009001)(428001)(199002)(189002)(90146001)(56816005)(92726001)(33646001)(76482001)(42186004)(51856001)(92566001)(53806001)(4396001)(50226001)(83072002)(47976001)(46102001)(49866001)(47736001)(63696002)(85852003)(50986001)(97186001)(47776003)(65816001)(97336001)(20776003)(89996001)(80022001)(66066001)(79102001)(54316002)(56776001)(59766001)(95666003)(77982001)(94316002)(86362001)(93516002)(95416001)(94946001)(36756003)(76786001)(77096001)(77156001)(76796001)(81342001)(69226001)(62966002)(81542001)(93136001)(50466002)(74876001)(74706001)(74502001)(47446002)(31966008)(74662001)(48376002)(74366001)(81686001)(19580405001)(83322001)(19580395003)(80976001)(81816001)(87286001)(87976001)(87266001)(85306002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB395; H:snotra.am.freescale.net; FPR:BCDEF770.A1E09682.5453635C.A06406E8.201AB; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (: freescale.com does not designate permitted sender hosts) X-OriginatorOrg: freescale.com Cc: Scott Wood , Tiejun Chen , linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Tiejun Chen We already allocated critical/machine/debug check exceptions, but we also should initialize those associated kernel stack pointers for use by special exceptions in the PACA. Signed-off-by: Tiejun Chen Signed-off-by: Scott Wood --- arch/powerpc/kernel/setup_64.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index f5f11a7..da9c42f 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -552,14 +552,20 @@ static void __init irqstack_early_init(void) static void __init exc_lvl_early_init(void) { unsigned int i; + unsigned long sp; for_each_possible_cpu(i) { - critirq_ctx[i] = (struct thread_info *) - __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); - dbgirq_ctx[i] = (struct thread_info *) - __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); - mcheckirq_ctx[i] = (struct thread_info *) - __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); + sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE); + critirq_ctx[i] = (struct thread_info *)__va(sp); + paca[i].crit_kstack = __va(sp + THREAD_SIZE); + + sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE); + dbgirq_ctx[i] = (struct thread_info *)__va(sp); + paca[i].dbg_kstack = __va(sp + THREAD_SIZE); + + sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE); + mcheckirq_ctx[i] = (struct thread_info *)__va(sp); + paca[i].mc_kstack = __va(sp + THREAD_SIZE); } if (cpu_has_feature(CPU_FTR_DEBUG_LVL_EXC))