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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 0B27CC4743D for ; Fri, 4 Jun 2021 17:43:55 +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 CEC01611CE for ; Fri, 4 Jun 2021 17:43:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CEC01611CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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=nC2yQ+sbfaQxhbsebP49qmmADv2g+TMjX6JLLMhoIPs=; b=1dDyPlGmH3ggIQ qHd6FmGc0yOjKI5CsvToXd17OueQM1DNz8eRm4lbSjKTsGTvetSeM8j521pT47lwn4wOGoKi6Srri OsPy6JJX3e2QF/0paH1SJSGXfLCPH92RCj0FeLuTtpm4HAXL+cA7W7XIB9EcCpALUw/zCjjKzbN4G 9w00iUW1xcdhM/yRfKNotOvdSWZyMZd79DhuiWK8TIBR03WLOmPobe13QXeaRfkMgW5q95LJ1uJoC H1vuyxUbXkjeI+6F2gRyHmYRa5m3ho/1xdzOPD21hTsR1OUOCFKbsB80lnv8Mm0eygXA6V/U83skV Y7FSsNQu/Hp2AFDUDRMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpDpx-00Eigt-59; Fri, 04 Jun 2021 17:42:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpDpt-00Eiex-CQ for linux-arm-kernel@lists.infradead.org; Fri, 04 Jun 2021 17:42:22 +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 CEE341063; Fri, 4 Jun 2021 10:42:19 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.6.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AC98B3F73D; Fri, 4 Jun 2021 10:42:18 -0700 (PDT) Date: Fri, 4 Jun 2021 18:42:16 +0100 From: Mark Rutland To: Will Deacon 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: <20210604174216.GC73426@C02TD0UTHF1T.local> References: <20210525183302.56293-1-mark.rutland@arm.com> <20210525183302.56293-12-mark.rutland@arm.com> <20210604165754.GC3416@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210604165754.GC3416@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210604_104221_507866_6B5DE015 X-CRM114-Status: GOOD ( 25.58 ) 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 Fri, Jun 04, 2021 at 05:57:55PM +0100, Will Deacon wrote: > 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. Since I'm removing the BAD_* definitions (and the array) in a latter patch, I'd prefer to leave this as-is here so that this clearly has no functional change. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel