Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp769889ybc; Tue, 12 Nov 2019 08:56:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzUqOUzu57U0i5P/8X+KUUqAcEeLgbOU4xQx0iW64GR/Ufa31fBUxYZtC5fpgjijefc5cdA X-Received: by 2002:a17:906:5151:: with SMTP id s17mr28252362ejl.230.1573577819741; Tue, 12 Nov 2019 08:56:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573577819; cv=none; d=google.com; s=arc-20160816; b=A7LFaizXXiQvKBRWqJOdBgICbGQkLoTBlmytCE5m6CN5DxAxbCrup9srlNRCwCtDyr 4sHZl/qIOmaLPtp5hJ7pjix9CopjybUBdDpb1VeWS8lqAYV585rK1oQ+QZFjLvkExAdQ 0O0s+pJI/1ByhlsFEQMJ0sY73oj1HDAugVu/8KM3u4ILE/1ohgOsPObQaRYnJj6mHRQ5 4xyrG9I6X7tgRwFjqtLFDe+xyPWmiAh+gk9awLUpOp7zcHPowQfwml1SDw85VFUjCQIo WMxy1qPUHP+NsrDLfgprHrKV/pK8FSiaP+q89AVcbooOMPKR+R9rzO2jgBiODHYHVUAO xuyw== 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=auS5Oq3s62uiYBFwanFPiwto9fjx3zQ+p/0NIaFFtqf9t6Xt9Dj1K1mtqxle6S6TPz lzgMDG2IPgQPTNjulXgzBvt6BYNZYzMjaVP16k3nB0iozOTTbu8xs8LtGXFDnmbDY5Su usPGzXmAD3nBewpqLXtjjXBP8x+KM63C6hntyuDum+4AjFZvytf9mWoHu/E9vlvXDAoE be4zpdgKMg7j0kIyh41quvT6nUYvShaPC7sRxtyh3xIZ3Cmy0LxQAkWL/8OaaNPK+hqV fxSGQQSDDoV2QQ2qozLPDpe2d0EH99MdqsS0cIFx8sidh2RsUra5VzbCcUxmdeSNWTFt wdKg== 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 gr10si344256ejb.414.2019.11.12.08.56.35; Tue, 12 Nov 2019 08:56:59 -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 S1727927AbfKLQzN (ORCPT + 99 others); Tue, 12 Nov 2019 11:55:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:34320 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727617AbfKLQxq (ORCPT ); Tue, 12 Nov 2019 11:53:46 -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 DA4ECB13D; Tue, 12 Nov 2019 16:53:45 +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 21/33] powerpc/64s/exception: soft nmi interrupt should not use ret_from_except Date: Tue, 12 Nov 2019 17:52:19 +0100 Message-Id: <85d3a8b3062501f545d16d4caf1c4925ce2fe618.1573576649.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