Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp771769ybc; Tue, 12 Nov 2019 08:58:54 -0800 (PST) X-Google-Smtp-Source: APXvYqx8V/fwe8nlQfeOcxORxG4a+n1hi84PI1/+pUorQG5lnvMRCjSw8CXEZJRHmJjoyxfEwbMS X-Received: by 2002:a17:906:6b0c:: with SMTP id q12mr3181814ejr.197.1573577934820; Tue, 12 Nov 2019 08:58:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573577934; cv=none; d=google.com; s=arc-20160816; b=Nmcpw3hSn77o3vy9XcSPnyHxdgFsfMSr4jw8Hq+POfnwGcp6PX2ZiYVEZy73SIXKC5 7DawW7j6n0lFTU865q8JsH0j+ArtY/O11Wv9ryNsbKSwDb7GMbBxSTHFq3b7RScbjBVk /EaE1v/RRpLeuKbzy9PkY/MGNnd2nXoFjXkk1lp5LC2eqL3dmrnkGUWGD2+/R5+7QMGS l2DuXsvfKtp+/qF9gI+oKAXHwBJVG69Hs5IfrRaewZapRuLSsOiMXaxPMUeuZ7PE9HXd nrHwUh/c+a2lbhnQUk5BLf8W2MDfW3KpZgYiuZwLhA079Z+IP4h12BBJpOam0uTtZqDU wtgQ== 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=wc2oAarbwyBmBVmNKADXQReqEwb9dRq85aNRMnvoZts=; b=Zq19noG52eRYtrmO8mu8r/me3YkvJ56yVUIln2N8phObjHDfln8oLgZHl9QPFAk9ev YYQEbiStHnhaGKgLJgeOs73FB6sR3sTH1p7v6vsEC5UEZtbg4sAZVrKhvL+q7A1ERxnk cC8JZcpyeNz8XQ0WwBs2bptf3DcdsAYP+vXmINKQZL3mGguOltb7/kaWiA/VFVcTZ0nQ y2I2vg7L8OmyGxticvrtFIlzPfwUOzhaNw6pc5hbL+vQbp7j+bYQbMiNFp6YtufLfPUq A5yoyBaKi9tj6g28HfMSa6UeHZI8E5+i9/L2ThsSzVeW5/x6rLJbj8+I5lvdjoG7igDt PUlw== 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 gx24si329807ejb.429.2019.11.12.08.58.31; Tue, 12 Nov 2019 08:58:54 -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 S1727906AbfKLQzF (ORCPT + 99 others); Tue, 12 Nov 2019 11:55:05 -0500 Received: from mx2.suse.de ([195.135.220.15]:35372 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727544AbfKLQxy (ORCPT ); Tue, 12 Nov 2019 11:53:54 -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 EFBA0AD72; Tue, 12 Nov 2019 16:53:51 +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 25/33] powerpc/64s/exception: remove lite interrupt return Date: Tue, 12 Nov 2019 17:52:23 +0100 Message-Id: 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 difference between lite and regular returns is that the lite case restores all NVGPRs, whereas lite skips that. This is quite clumsy though, most interrupts want the NVGPRs saved for debugging, not to modify in the caller, so the NVGPRs restore is not necessary most of the time. Restore NVGPRs explicitly for one case that requires it, and move everything else over to avoiding the restore unless the interrupt return demands it (e.g., handling a signal). Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/entry_64.S | 4 ---- arch/powerpc/kernel/exceptions-64s.S | 21 +++++++++++---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index b2e68f5ca8f7..00173cc904ef 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S @@ -452,10 +452,6 @@ _GLOBAL(fast_interrupt_return) .balign IFETCH_ALIGN_BYTES _GLOBAL(interrupt_return) - REST_NVGPRS(r1) - - .balign IFETCH_ALIGN_BYTES -_GLOBAL(interrupt_return_lite) ld r4,_MSR(r1) andi. r0,r4,MSR_PR beq kernel_interrupt_return diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 269edd1460be..1bccc869ebd3 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -1507,7 +1507,7 @@ EXC_COMMON_BEGIN(hardware_interrupt_common) RUNLATCH_ON addi r3,r1,STACK_FRAME_OVERHEAD bl do_IRQ - b interrupt_return_lite + b interrupt_return GEN_KVM hardware_interrupt @@ -1694,7 +1694,7 @@ EXC_COMMON_BEGIN(decrementer_common) RUNLATCH_ON addi r3,r1,STACK_FRAME_OVERHEAD bl timer_interrupt - b interrupt_return_lite + b interrupt_return GEN_KVM decrementer @@ -1785,7 +1785,7 @@ EXC_COMMON_BEGIN(doorbell_super_common) #else bl unknown_exception #endif - b interrupt_return_lite + b interrupt_return GEN_KVM doorbell_super @@ -2183,7 +2183,7 @@ EXC_COMMON_BEGIN(h_doorbell_common) #else bl unknown_exception #endif - b interrupt_return_lite + b interrupt_return GEN_KVM h_doorbell @@ -2213,7 +2213,7 @@ EXC_COMMON_BEGIN(h_virt_irq_common) RUNLATCH_ON addi r3,r1,STACK_FRAME_OVERHEAD bl do_IRQ - b interrupt_return_lite + b interrupt_return GEN_KVM h_virt_irq @@ -2260,7 +2260,7 @@ EXC_COMMON_BEGIN(performance_monitor_common) RUNLATCH_ON addi r3,r1,STACK_FRAME_OVERHEAD bl performance_monitor_exception - b interrupt_return_lite + b interrupt_return GEN_KVM performance_monitor @@ -3013,7 +3013,7 @@ do_hash_page: cmpdi r3,0 /* see if __hash_page succeeded */ /* Success */ - beq interrupt_return_lite /* Return from exception on success */ + beq interrupt_return /* Return from exception on success */ /* Error */ blt- 13f @@ -3027,10 +3027,11 @@ do_hash_page: handle_page_fault: 11: andis. r0,r5,DSISR_DABRMATCH@h bne- handle_dabr_fault + bl save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD bl do_page_fault cmpdi r3,0 - beq+ interrupt_return_lite + beq+ interrupt_return mr r5,r3 addi r3,r1,STACK_FRAME_OVERHEAD ld r4,_DAR(r1) @@ -3045,9 +3046,9 @@ handle_dabr_fault: bl do_break /* * do_break() may have changed the NV GPRS while handling a breakpoint. - * If so, we need to restore them with their updated values. Don't use - * interrupt_return_lite here. + * If so, we need to restore them with their updated values. */ + REST_NVGPRS(r1) b interrupt_return -- 2.23.0