Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4649275ybc; Tue, 26 Nov 2019 12:17:46 -0800 (PST) X-Google-Smtp-Source: APXvYqzAMjcoQRxdjVGcsUFItHCNI5QWHCffhvRF8bWSjlUc0aX+5j3/EpsLcrISIoePC5Evvs+7 X-Received: by 2002:a17:906:ecf5:: with SMTP id qt21mr44247398ejb.295.1574799466243; Tue, 26 Nov 2019 12:17:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574799466; cv=none; d=google.com; s=arc-20160816; b=d+SRmLPzk+2SSIP8gLrPctfnJiLA9sXoB7/xWkOKc4J3qNmYaUfCjaMyaRQY7++32J WYFgmolWBrcfhNd0TH0+0Ztn0ezuxiZVEaJJ/mx4LE4l1VvitTCUiN7xQnjVl4JDid8v HvqBdwLMNnSm+kouAwfhfqxxtujhTTyslIYoLV2gVR0Ab0sKwCeSYiiOniWBg7Ls4hU6 9CH9+IhtufMT/xWDpqxF64A+04xcQYVXZ1q2sPxE8jawP0ux1FUl+wbDi68weUHVbwhg prkPRRJ+4/T5Dy3XX1udZFUkOcUs0+F/TnLQyR6SNEjY3MbJNJdE0qfG4ALhDLoOE88B i+Fg== 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=Jki/EL/Cdw/bwCr5yUdr7aQoYr8nB1yBsflMLJG39cDQhOH1KxLjxf9rp+uw0ENAZm 2HY6uNU7Yy+B5U/BWiacQ7btK5TMFHaYMOw3ciLxuPs8POEP3/NIXlhjJpfA+X1XbrjH aYgUToqQ1aulmfm8aE/a3nk7CnNEAp2GLnH3ZweKbEZh5IHdDU/8dsVhU2pcHjpNKnFp T3Yjf9I03M+6r0evbmzhu3GSKtrFxNFPwhGeFFPsXfSW52VIyqsgHJjhQ7082ybFwBi+ 1RoEmokLBl/ytS90/nv7hPOpn0B5xZv5DI3ftT6XbBqeos1i65/P9pyuz34bCAlJ9Xgg Jeqg== 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 i26si7074350ejh.159.2019.11.26.12.17.21; Tue, 26 Nov 2019 12:17:46 -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 S1727413AbfKZUOe (ORCPT + 99 others); Tue, 26 Nov 2019 15:14:34 -0500 Received: from mx2.suse.de ([195.135.220.15]:47372 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727377AbfKZUOc (ORCPT ); Tue, 26 Nov 2019 15:14:32 -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 DE41BB30F; Tue, 26 Nov 2019 20:14:30 +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 21/35] powerpc/64s/exception: soft nmi interrupt should not use ret_from_except Date: Tue, 26 Nov 2019 21:13:35 +0100 Message-Id: <407f32f4cd6c96b1bb86c076e82e0ab31edf6d24.1574798487.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