Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5350418ybc; Wed, 27 Nov 2019 02:41:41 -0800 (PST) X-Google-Smtp-Source: APXvYqydRX5Sbua/wXr+fZsmErtFYtMu5YLwYfzK2GOBfgWFdfExlK9Ozp+Osiur1VI4G/gTss2q X-Received: by 2002:a50:fd95:: with SMTP id o21mr31533381edt.283.1574851301387; Wed, 27 Nov 2019 02:41:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574851301; cv=none; d=google.com; s=arc-20160816; b=hth/6V3weOOZXQ9pryeL5xGzlhGlcQGfGznIi6mE7PU0JJ0IGrlgQ334NaZw1JbECd LUfAZY1L12+8KERqsEB1gFgsgZmBErPIc6N0KxccR6yfcuSWYVhCRh/8p00bm6DiX+G6 mG1dTQyPC0gO5qOHUr1mwGM3yhtLt49zNKwJ+HyfFwEKsi/RqxC+oTWx0V9dsX2MbXOQ mKy2HUj5kujHJaFzIXdSNPWBY71ZGhH3FDVEF0cfQHQRiblmk6cunTCh8AKggmDg5hra jI/Hszsq5PjMI7AcZX6KdZNB3LVy0kLa7xle3+eQCEb3rxCX4lJB9p5ocTA2jfSVv0ux oHIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qFfK+RhJCHHaGwZ1ZQT5tJ1UPAKfIQ5ZqM52SXaRed0=; b=mRaG6vlVVt5E9k6Nf2wgzrb82VQhB5IUePq490FQmnobpyafUznwyEaIS5l1HwIsnj TwiTSATZQrwWB4j/2TA9dVL/2YicN+rM9WSLDKBiqDl2VkPj1RjChNOUvgEsk+3UPgtN KpmLCUt2vwxAXDx4bnz3aoypa6vKL6TVOrzrF5B2bYPn1Jnfs6glreKgd3oiquEfyHWk x9sCy2+xf+09bu9nCCMsmYyjRLmTsWL9MQXzVfgjtwMNfbYomZL/SjeVpvDBa0aaNyr1 +wjzLwKxo1lRtJxJemwdfTj/4jH3Twxx2ZPr7Tkt8Sb00NNpwVJWziUTVOTclXe9zJUP vtyw== ARC-Authentication-Results: i=1; mx.google.com; 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 cz19si171417edb.109.2019.11.27.02.41.17; Wed, 27 Nov 2019 02:41:41 -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; 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 S1727239AbfK0Kjz (ORCPT + 99 others); Wed, 27 Nov 2019 05:39:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:56122 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727169AbfK0Kjw (ORCPT ); Wed, 27 Nov 2019 05:39:52 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 88612B40D; Wed, 27 Nov 2019 10:39:50 +0000 (UTC) From: Michal Suchanek To: linuxppc-dev@lists.ozlabs.org Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Oleg Nesterov , Alexander Viro , Christian Brauner , Nicholas Piggin , Allison Randal , "Naveen N. Rao" , Michal Suchanek , Thomas Gleixner , Breno Leitao , Christophe Leroy , Claudio Carvalho , Russell Currey , Greg Kroah-Hartman , Mahesh Salgaonkar , Arnd Bergmann , Geert Uytterhoeven , Firoz Khan , Dmitry Vyukov , Masahiro Yamada , Hari Bathini , Andrew Donnellan , Nicolai Stange , Valentin Schneider , Diana Craciun , Daniel Axtens , Michael Neuling , Gustavo Romero , Mathieu Malaterre , "Steven Rostedt" , "Eric W. Biederman" , Heiko Carstens , David Howells , Brajeswar Ghosh , Jagadeesh Pagadala , David Hildenbrand , Andrew Morton , Madhavan Srinivasan , linux-kernel@vger.kernel.org Subject: [PATCH v2 rebase 21/34] powerpc/64s/exception: soft nmi interrupt should not use ret_from_except Date: Wed, 27 Nov 2019 11:38:57 +0100 Message-Id: <35ff4ea58b58f949072efc24c9920648ffdafb05.1574803685.git.msuchanek@suse.de> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Piggin The soft nmi handler does not reconcile interrupt state, so it should not return via the normal ret_from_except path. Return like other NMIs, using the EXCEPTION_RESTORE_REGS macro. This becomes important when the scv interrupt is implemented, which must handle soft-masked interrupts that have r13 set to something other than the PACA -- returning to kernel in this case must restore r13. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 38bc66b95516..af1264cd005f 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -2740,7 +2740,11 @@ EXC_COMMON_BEGIN(soft_nmi_common) bl save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD bl soft_nmi_interrupt - b ret_from_except + /* Clear MSR_RI before setting SRR0 and SRR1. */ + li r9,0 + mtmsrd r9,1 + EXCEPTION_RESTORE_REGS hsrr=0 + RFI_TO_KERNEL #endif /* CONFIG_PPC_WATCHDOG */ -- 2.23.0