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=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 B79A8C4743D for ; Fri, 4 Jun 2021 16:59:28 +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 8A715613B4 for ; Fri, 4 Jun 2021 16:59:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A715613B4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dBdpXH+IpEggqJYbW0pooKdCRHR/CSGBXqygYBldkFo=; b=qdoyEzmHgh/Giq rlcEdTKGpnVkM70ZUuAxF/OwN3xyHoAdCRERAirOIuaxRM2s0siKLX8XZ1OiDc+SlT3YdEs9Zbizy ILy7g4Whlhw37ZPOQ9Ve59t/8F5PW1iter6NVI4KFs9Ii5oZWNxoo1+gb7BcWDc2O39yDvIx2UpCd qRs4SWkqD/6r4Eg2oDVVNdapWqewLiipXtYYkO2zb6CZZ3hsE47snWnsYtMEgyoFFfHQ04eyxrrIC ypoKUz7UY/smLkU6T6/X2u+SLzvCFxxZXd+fclqJc9J+DrmHc5h00X6Oa/G/FKvDqno5kjbjtEXAf ArzPIvzJ7gO63DVH962A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpD94-00EUD8-6T; Fri, 04 Jun 2021 16:58:06 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpD8z-00EUBw-DH for linux-arm-kernel@lists.infradead.org; Fri, 04 Jun 2021 16:58:04 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9CA2C613B4; Fri, 4 Jun 2021 16:57:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622825879; bh=ldfziyVT0lWfVzsSS2hNxwMhquVrrOr5GujnxU9+mQs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BOr5lmr/jgQluDcyfyrh5nBYwblQJHu+PCG0hf07MA4Wu41DrG0zWk5VIJH1RM7IX 6HLTwxApBILNGayu6cgClB7ayHSM3InCg/y6Zyv/T1mWr3aNi34ec9lqYv9M6sCCYB il9XiRQDHyMngMi+JTYUX4O7+XWBGKFDTAENFWqAVsmX/0csLoW/SVscuwptRJowAh 92PxLu1GbV1PN07V6l9IXtUnauNRJWNG4Rnynza6O+maMxKoE+5obKBT+4fgvT4CUx 3FtNqbBEVfdX90hkwoWJJzw6sU9iYHT4eDIzq3CG6moFRuN9YtdpBtNllRh6hb5hFp XjzymPKwaBGBw== Date: Fri, 4 Jun 2021 17:57:55 +0100 From: Will Deacon To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, james.morse@arm.com, joey.gouly@arm.com, maz@kernel.org Subject: Re: [PATCH v3 11/20] arm64: entry: move bad_mode() to entry-common.c Message-ID: <20210604165754.GC3416@willie-the-truck> References: <20210525183302.56293-1-mark.rutland@arm.com> <20210525183302.56293-12-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210525183302.56293-12-mark.rutland@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210604_095801_496126_9C5ECF47 X-CRM114-Status: GOOD ( 21.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 25, 2021 at 07:32:53PM +0100, Mark Rutland wrote: > In subsequent patches we'll rework the way bad_mode is called by > exception entry code. In preparation for this, let's move bad_mode() > itself into entry-common.c. > > Let's also mark it as noinstr (e.g. to prevent it being kprobed), and > let's also make the `handler` array a local variable, as this is only > use by bad_mode(), and will be removed entirely in a subsequent patch. > > There should be no functional change as a result of this patch. > > Signed-off-by: Mark Rutland > Reviewed-by: Joey Gouly > Cc: Catalin Marinas > Cc: James Morse > Cc: Marc Zyngier > Cc: Will Deacon > --- > arch/arm64/kernel/entry-common.c | 27 +++++++++++++++++++++++++++ > arch/arm64/kernel/traps.c | 25 ------------------------- > 2 files changed, 27 insertions(+), 25 deletions(-) > > diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c > index 9c0ed05b98c4..25531a0b547e 100644 > --- a/arch/arm64/kernel/entry-common.c > +++ b/arch/arm64/kernel/entry-common.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > > /* > * This is intended to match the logic in irqentry_enter(), handling the kernel > @@ -159,6 +160,32 @@ static void do_interrupt_handler(struct pt_regs *regs, > extern void (*handle_arch_irq)(struct pt_regs *); > extern void (*handle_arch_fiq)(struct pt_regs *); > > +/* > + * bad_mode handles the impossible case in the exception vector. This is always > + * fatal. > + */ > +asmlinkage void noinstr bad_mode(struct pt_regs *regs, int reason, unsigned int esr) > +{ > + const char *handler[] = { > + "Synchronous Abort", > + "IRQ", > + "FIQ", > + "Error" > + }; If you're rejigging this array anyway, maybe initialising it as: [BAD_SYNC] = "Synchronous Abort", [BAD_IRQ] = ... might make it even clearer. Up to you. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel