Received: by 10.223.164.202 with SMTP id h10csp1183657wrb; Tue, 7 Nov 2017 23:38:28 -0800 (PST) X-Google-Smtp-Source: ABhQp+QgtjbuvIswOgKrqFkjW08hhV/aofO487qUwLWf2y+BSi/NohlkSTtxMNkG/aquf/cy0wJc X-Received: by 10.159.252.200 with SMTP id o8mr1436199pls.80.1510126707975; Tue, 07 Nov 2017 23:38:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510126707; cv=none; d=google.com; s=arc-20160816; b=T8gb1nOCM5xEijTQRSWkGVeSgg61JdICHhI2Mtr/JjCtqD0dwW6GzdWHnFdxXsCDru CBt/urpvNgtLyo+seqDG1/71H7iU5Tht8212hoyfQRZDuQM0AXONQKIKjaUlKQF8a/aC 3M5CCeYpf75XO2Wb4D9YoAcRDfInsNEsRQA3hcbjCgY5DEzwaHuf8bEK1yjpsHfzyUQj Pj257aTBh7Cx7RmxM13WVAYBl33zqDT8li6VXljrJEVe7ycw2Wq/pHwa3Yvo0b0ZCB5+ sDwDWz5flRN6idvEOifHJwnA8O2vGSAiWdwrwlq8VOgodoA/GaUhfxZ+TLQX+exYbxXD Ek2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=ejMY4y/Qzp53/ZyLVhtCSKcRDv5Y9/+2KhINM9n897c=; b=GSMDO8LeTqVoU+kiPx/Gr+RamozE106VgVNlzDCX0gzbVY7rU37hObcyqVNrcUTXks 2msNXMMqNMHNJWBGAUTbV3hjn6uPQXLFxmXzQprwfbtx3Cqj6NmK4XrBlBTtMGBYu4Uk MD3hGyg5mq01S604MH5rib4ZgM9wXKnUlNFDzGhCU/DtdDEEEyY3yWswsJDCZxXA9ozc 2HZJaJG8bKdRybTMmwXBwVA3l6Z1t1E82rKJjiyV7N/cfZhTilNT27wjU872IGyWzJwI ZCwzKb6L+AHDH13XgaRu/YTlg6/hKrJOnA4L+nLexGDqgC5kk3FAydy6Ao90ATGUvvFY yU9Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si2944579pgo.542.2017.11.07.23.38.15; Tue, 07 Nov 2017 23:38:27 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756549AbdKGWN2 (ORCPT + 90 others); Tue, 7 Nov 2017 17:13:28 -0500 Received: from smtprelay4.synopsys.com ([198.182.47.9]:47218 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756525AbdKGWN0 (ORCPT ); Tue, 7 Nov 2017 17:13:26 -0500 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 620B724E0ECF; Tue, 7 Nov 2017 14:13:26 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 50039994; Tue, 7 Nov 2017 14:13:26 -0800 (PST) Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2.internal.synopsys.com [10.12.239.237]) by mailhost.synopsys.com (Postfix) with ESMTP id 4635998F; Tue, 7 Nov 2017 14:13:26 -0800 (PST) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.266.1; Tue, 7 Nov 2017 14:13:25 -0800 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.266.1; Wed, 8 Nov 2017 03:43:23 +0530 Received: from vineetg-Latitude-E7450.internal.synopsys.com (10.10.161.44) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.266.1; Wed, 8 Nov 2017 03:43:22 +0530 From: Vineet Gupta To: CC: , Peter Zijlstra , Vineet Gupta Subject: [PATCH 4/4] ARCv2: entry: Reduce perf intr return path Date: Tue, 7 Nov 2017 14:13:04 -0800 Message-ID: <1510092784-19942-5-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510092784-19942-1-git-send-email-vgupta@synopsys.com> References: <1510092784-19942-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.10.161.44] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the more likely case of returning to kernel from perf interrupt, do a fast path returning w/o bothering about CONFIG_PREEMPT etc However, if returning to user space, need do go thru the usual gyrations, as check for pending signals is an absolute must. Signed-off-by: Vineet Gupta --- arch/arc/include/asm/entry-arcv2.h | 2 ++ arch/arc/kernel/entry-arcv2.S | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/arch/arc/include/asm/entry-arcv2.h b/arch/arc/include/asm/entry-arcv2.h index 257a68f3c2fe..8b49b327b1f9 100644 --- a/arch/arc/include/asm/entry-arcv2.h +++ b/arch/arc/include/asm/entry-arcv2.h @@ -58,6 +58,8 @@ /*------------------------------------------------------------------------*/ .macro INTERRUPT_EPILOGUE called_from + ; Assumes STATUS32.Z bit set if return to K + .ifnc \called_from, exception add sp, sp, 12 ; skip BTA/ECR/orig_r0 placeholderss .endif diff --git a/arch/arc/kernel/entry-arcv2.S b/arch/arc/kernel/entry-arcv2.S index cc558a25b8fa..9ca1d146426b 100644 --- a/arch/arc/kernel/entry-arcv2.S +++ b/arch/arc/kernel/entry-arcv2.S @@ -51,7 +51,7 @@ VECTOR handle_interrupt ; (16) Timer0 VECTOR handle_interrupt ; unused (Timer1) VECTOR handle_interrupt ; unused (WDT) VECTOR handle_interrupt ; (19) Inter core Interrupt (IPI) -VECTOR handle_interrupt ; (20) perf Interrupt +VECTOR handle_interrupt_pct ; (20) perf Interrupt VECTOR handle_interrupt ; (21) Software Triggered Intr (Self IPI) VECTOR handle_interrupt ; unused VECTOR handle_interrupt ; (23) unused @@ -97,6 +97,26 @@ ENTRY(handle_interrupt) END(handle_interrupt) +ENTRY(handle_interrupt_pct) + + INTERRUPT_PROLOGUE irq + + IRQ_DISABLE + + lr r0, [ICAUSE] + + bl.d arch_do_IRQ + mov r1, sp + + ld r0, [sp, PT_status32] ; returning to User/Kernel Mode + btst r0, STATUS_U_BIT + bnz resume_user_mode_begin + + clri + b .Lisr_ret_fast_path_to_k + +END(handle_interrupt_pct) + ;################### Non TLB Exception Handling ############################# ENTRY(EV_SWI) @@ -224,6 +244,7 @@ debug_marker_l1: bset.nz r11, r11, AUX_IRQ_ACT_BIT_U ; NZ means U sr r11, [AUX_IRQ_ACT] +.Lisr_ret_fast_path_to_k: INTERRUPT_EPILOGUE irq rtie -- 2.7.4 From 1584731803178518565@xxx Wed Nov 22 02:33:39 +0000 2017 X-GM-THRID: 1584731803178518565 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread