Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2882154ybl; Sun, 8 Dec 2019 02:50:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzuHExduwqBhms1B594hDPQObt3x4IzRxjTnEtzRFW9UptM6ASzCVEIHHYyfXgig9DSF93e X-Received: by 2002:a05:6830:1289:: with SMTP id z9mr7351020otp.317.1575802217171; Sun, 08 Dec 2019 02:50:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575802217; cv=none; d=google.com; s=arc-20160816; b=Afc56fmvJUCQymd/1M0cfO2wtEZ1F1d7wMMwpcdxqzGqwpZQe1fb3aN9f7A1MDAdR6 UiryJXlfBij1rY0vsj05qzwdTc7+BaqAq535q6mgIbXT8eZOwCnI6ahgC81VFj9uqrHb +P1n5ZOAgNtledWAtVsDoZTrBmFysAvaX8DtQ2h/Kd8ZadY/24iOQls+UWHT0WU9Ilg9 WVPyPblOTB2V+mdFQhCO6KbhM4tv1FqyKCmB3Ikktk7PDJp7NF0DN9F9yEw2vRnCROur YCfDvKEjNindNpVzRebjQ84D1DgNrTz0JFkMd4ClQQY5XkH5U7elsEYKfQ5/+Yp40q62 Nh4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id :dkim-signature; bh=j94t5POjnfwMOhIyjty//O1HCzuZ8xq1bFZy5q16/YI=; b=xgzuLZ0Of5mvmoB0LAAxrh9X8i876qBTocXH8HEaU8/Derq8/487h+JOFrlaGLctmC mKGf6/4TTIDcD1zNsQEtQMzRe/b+uEkQL4R888gzmZjToD5MEAI1n9od392+Zxf9nxXb 8Bs+DEmbi66SLEvNHZYJNpOa3ILpD/I3LqSls/p2lLyblRR/+3ryVYLPEPBzSeZeuC2X l7zFqO1PbkzGE79rGlkeG2gNL75zoKXrzuai3To7lWs8PCeBqq9qBrpDtlHjzNTO+D3O tkTf4iaGtSdmFdnb4mamGxpo4IQxXKQAY6GfNLd88DDaWT/VHRbC7ANXJp2pSDeuyXW8 60dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=OblfVUjh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b203si5225069oif.101.2019.12.08.02.49.52; Sun, 08 Dec 2019 02:50:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=OblfVUjh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726453AbfLHKsF (ORCPT + 99 others); Sun, 8 Dec 2019 05:48:05 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:3725 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbfLHKsF (ORCPT ); Sun, 8 Dec 2019 05:48:05 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47W3275p9cz9tySD; Sun, 8 Dec 2019 11:47:59 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=OblfVUjh; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id Fjlqa5M82dtu; Sun, 8 Dec 2019 11:47:59 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47W3274WMKz9tyS4; Sun, 8 Dec 2019 11:47:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1575802079; bh=j94t5POjnfwMOhIyjty//O1HCzuZ8xq1bFZy5q16/YI=; h=From:Subject:To:Cc:Date:From; b=OblfVUjh5JfrDrw8apQ0bQF9KcEp5Js0S9M8NuSccX70EezTCPqF55fkFa4bh6Plh WACrOL5LuH3LXSQNXCK92twnILcnh7MxbRAnO/zhb4RiNzwjpIEEbeBMgWnach9Z4k dpbuKlLh4dlyCG8gh6oa3iYuMhz8pslbIt5Am52w= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5E0DB8B77A; Sun, 8 Dec 2019 11:48:02 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id ggcHE-4w7EfL; Sun, 8 Dec 2019 11:48:02 +0100 (CET) Received: from localhost.localdomain (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 070978B76F; Sun, 8 Dec 2019 11:48:01 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id 30D2D63723; Sun, 8 Dec 2019 10:48:01 +0000 (UTC) Message-Id: <1bb34d3ea006c308221706290613e6cc5dc3cb74.1575802064.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH] powerpc/irq: don't use current_stack_pointer() in do_IRQ() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Sun, 8 Dec 2019 10:48:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Before commit 7306e83ccf5c ("powerpc: Don't use CURRENT_THREAD_INFO to find the stack"), the current stack base address was obtained by calling current_thread_info(). That inline function was simply masking out the value of r1. In that commit, it was changed to using current_stack_pointer(), which is an heavier function as it is an outline assembly function which cannot be inlined and which reads the content of the stack at 0(r1) Revert to just getting r1 and masking out its value to obtain the base address of the stack pointer as before. Signed-off-by: Christophe Leroy Fixes: 7306e83ccf5c ("powerpc: Don't use CURRENT_THREAD_INFO to find the stack") --- arch/powerpc/kernel/irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 240eca12c71d..bb34005ff9d2 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -693,10 +693,11 @@ void __do_irq(struct pt_regs *regs) void do_IRQ(struct pt_regs *regs) { struct pt_regs *old_regs = set_irq_regs(regs); + register unsigned long r1 asm("r1"); void *cursp, *irqsp, *sirqsp; /* Switch to the irq stack to handle this */ - cursp = (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1)); + cursp = (void *)(r1 & ~(THREAD_SIZE - 1)); irqsp = hardirq_ctx[raw_smp_processor_id()]; sirqsp = softirq_ctx[raw_smp_processor_id()]; -- 2.13.3