Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5351472ybc; Wed, 27 Nov 2019 02:42:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzicNlAr3Oc8z2u6yfOwmsJanyg6BFZTw7WHt6PuW0qa9SvbtaNnBXKnksY3Rjo1iyRz+gT X-Received: by 2002:a17:906:aad0:: with SMTP id kt16mr22681333ejb.223.1574851362126; Wed, 27 Nov 2019 02:42:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574851362; cv=none; d=google.com; s=arc-20160816; b=eUrXdP3UiwESYlLe3aZKGzQHhLpjBpXHHWula4JqQZWInZKSRTCiS7aCtZbTBkHSbZ N0H8EdJlZpMMPYuuo0WjwF133g1AYoGiFOLbsH3Eq9b+XxfF/pMkvfDDMxfby7B/Hq6u uD5s7hRlOyH/1R3ys2aHxw7ycoiD0mLDExjmXWbWFmRNQ2QZQ8dqiVNkNVnW+UUQ5b3D rVsYRluEBwhWdt1bWlhVvpb/XN46ONWpXUQ6GkRynecQ0Nc80q/DehWaEjUC6tngc37W Ji5BxZs6F43CIPSXrveGyeGA9F9HP6WssTDhTJtwSEtgqnsm5vqWx92fNZrZh0oFQvKv YUUA== 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=yMldOvAWQznY1UsBAQ3ZUyTnVmPpRl7ZnnKfVAJdZbssRc2vA9eTmSQl1bBMVNqGWC pSdTA6tf8zRND4rkHBtKPRFx2Lwyd6FSymfBOlw8Mrpu3/1v9uGir8bugyyevrrVwRni l8fPeuAbl/Kk01SMp1yfd1Np3dS35CVV+LSGk/rzLvLgohewYDMnq9bdaPT9Y0kVRk+V zFwY+p676zKINNDl/HBSEKHEl7xaIHRbUt8z9qXagHYnH7GK/gsObbroNhTtKPfRBGKb SsEkvxX0L05ywN6CVCwtVbIqyRAvHICeL0fJGPyR/McOySZppJr65vWjy33cR1W6N2IC mlAw== 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 h20si11535643edj.48.2019.11.27.02.42.19; Wed, 27 Nov 2019 02:42:42 -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 S1727460AbfK0Kkh (ORCPT + 99 others); Wed, 27 Nov 2019 05:40:37 -0500 Received: from mx2.suse.de ([195.135.220.15]:56444 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727187AbfK0Kj6 (ORCPT ); Wed, 27 Nov 2019 05:39:58 -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 B0279B473; Wed, 27 Nov 2019 10:39:56 +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 25/34] powerpc/64s/exception: remove lite interrupt return Date: Wed, 27 Nov 2019 11:39:01 +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