From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68625C33C99 for ; Fri, 10 Jan 2020 03:37:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2DB3620678 for ; Fri, 10 Jan 2020 03:37:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tey6vvtJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DB3620678 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CDzD2rh5zfTiI5KHNiFLTscLLJFik672WRrIiHIMY98=; b=tey6vvtJJCJRVu j3VUB46WHMAPjyGVIZdoe7Mr7rsiGyar73juVPc9t1lZ/zpfdhzmavYsTcqBzbL8hXWaxqITrNVIv 80DrbwUO8TFSLlwVdYoIsrD25q2K0HbFuPGwxDm0FRVJvQhTDyKQc2h1tbF6HxBVZBvKdsFpzuxeW VWIiTq8+UqedsdLWKmcJJ1wrOhm1NCLZG2iIFoy6NB4EP0N3OcAN75EuU4AUSY/INguHhNE+se4h2 //eUZw+L/iCEtAI1DdWcuH8yub16zr5d4vmEPMg5Wm0igPoAe3EJAh4KSQSybtipWXYQMNDT8f5v/ Ngl0wZnmdts4GF6nqsWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipl7U-0003dy-JH; Fri, 10 Jan 2020 03:37:56 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipl7Q-0003dR-UZ for linux-arm-kernel@lists.infradead.org; Fri, 10 Jan 2020 03:37:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DD42D1396; Thu, 9 Jan 2020 19:37:51 -0800 (PST) Received: from [10.162.42.128] (p8cg001049571a15.blr.arm.com [10.162.42.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D11E93F703; Thu, 9 Jan 2020 19:37:48 -0800 (PST) Subject: Re: [PATCH 10/17] arm64: entry: consolidate EL1 return paths To: Mark Rutland , linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, james.morse@arm.com References: <20200108185634.1163-1-mark.rutland@arm.com> <20200108185634.1163-11-mark.rutland@arm.com> From: Anshuman Khandual Message-ID: Date: Fri, 10 Jan 2020 09:09:03 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200108185634.1163-11-mark.rutland@arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200109_193753_028329_EDA8C92C X-CRM114-Status: GOOD ( 18.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: keescook@chromium.org, maz@kernel.org, broonie@kernel.org, labbott@redhat.com, robin.murphy@arm.com, julien.thierry.kdev@gmail.com, alex.popov@linux.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 01/09/2020 12:26 AM, Mark Rutland wrote: > Each of the EL1 exception handler stubs has an identical copy of the > kernel_exit code. While each handler needs its own kernel_entry > sequence, there's no need to duplicate this for each handler, and we can > consolidate them for better I-cache usage. > > This patch makes the EL1 handlers all use a common kernel_exit stub > called ret_to_kernel, matching the ret_to_user stub used by EL0 > handlers. > > As with the handlers, ret_to_kenerl is aligned for better I-cache and Small nit, s/ret_to_kenerl/ret_to_kernel > brapnch predictor utilization, and for consistency the same alignment is Small nit, s/brapnch/branch > applied to ret_to_user. > > Signed-off-by: Mark Rutland > Cc: Catalin Marinas > Cc: James Morse > Cc: Will Deacon Reviewed-by: Anshuman Khandual > --- > arch/arm64/kernel/entry.S | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S > index 35a8c56b0582..e76326feb1da 100644 > --- a/arch/arm64/kernel/entry.S > +++ b/arch/arm64/kernel/entry.S > @@ -519,7 +519,7 @@ el1_sync: > kernel_entry 1 > mov x0, sp > bl el1_sync_handler > - kernel_exit 1 > + b ret_to_kernel > ENDPROC(el1_sync) > > .align 6 > @@ -527,7 +527,7 @@ el1_irq: > kernel_entry 1 > mov x0, sp > bl el1_irq_handler > - kernel_exit 1 > + b ret_to_kernel > ENDPROC(el1_irq) > > .align 6 > @@ -535,10 +535,18 @@ el1_error: > kernel_entry 1 > mov x0, sp > bl el1_error_handler > - kernel_exit 1 > + b ret_to_kernel > ENDPROC(el1_error) > > /* > + * Common EL1 exception return path > + */ > + .align 6 > +ret_to_kernel: > + kernel_exit 1 > +ENDPROC(ret_to_kernel) > + > +/* > * EL0 mode handlers. > */ > .align 6 > @@ -606,6 +614,7 @@ work_pending: > /* > * "slow" syscall return path. > */ > + .align 6 > ret_to_user: > disable_daif > gic_prio_kentry_setup tmp=x3 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel