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=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 CAF9BC4743C for ; Fri, 4 Jun 2021 17:15:50 +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 92361613FF for ; Fri, 4 Jun 2021 17:15:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92361613FF 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=Frz8wLbO1ApXAij3m6RkfU8xftF2dQpnnLlj3EsM/JM=; b=HQAzQaYq0ep7G+ HOrgqXCNBXDoe3HyO5uJk5H5Rf3u/uMKddbj+1+YWa+Ya8PhgfBgwJZ5mvKWtpwG//uoM+zi8GVAU brw69ucsOqBqboCcnPzy+QwPjommcqonXoc2KIyzCTrnHLjOvttrNLZcX4Xt1UJ5yOYWj+19KSLUS f0qs/mucGetVNbTuSxyPu5tkzfpqSx3xQDdKvmJ9XpJCmdLcrB7VPccSP+OkMCegTSL1SK4h9i5Kp tXZs9mwb0CzFSdNaF+LVEVpYgJMCUpffUJ6QrKrGC4zX/KXflgtih3/8LcECiCXWXh84foWJLuIea k661hMaDk4bYJHGc4QsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpDOX-00EZjB-Ec; Fri, 04 Jun 2021 17:14:05 +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 1lpDNi-00EZGc-3s for linux-arm-kernel@lists.infradead.org; Fri, 04 Jun 2021 17:13:15 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9A02561359; Fri, 4 Jun 2021 17:13:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622826793; bh=U6kHCKWWD+QB0TMizIVvJv2sBPixq8DwBvrOuwPHmMs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cXC1oenTbWh5zCu5/2DvNVPjgMy0XWTlPRGj/YAB6nylvOPcTyjtPNp1CeJSdplSz 7W16nqthicyjsVko3uthPKjKxqKn6TLjj9ljXOL9VdmXbaWLlvRgwNEptzji4ANeFL I8e/4F6t/0JXyxM4WbgVsN9lqQS/DKsFNQyDWIfH56XTvF0a+OHuMlwYFCoRFYJHwr 38630OL82pzacjK/gRpiWWDmjcBxJmCox0NhLcLCb1rArs/zUdWZU7RbHq7stCx2O9 kGUNsASpl2q6Va2zE3ctaSI6275TfzLJPKaE0hoMrp5vnUPxT0FWxbq4wuJVQSt2tk Px+GbSD3QesCw== Date: Fri, 4 Jun 2021 18:13:09 +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 14/20] arm64: entry: handle all vectors with C Message-ID: <20210604171309.GD3416@willie-the-truck> References: <20210525183302.56293-1-mark.rutland@arm.com> <20210525183302.56293-15-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210525183302.56293-15-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_101314_212754_210B315E X-CRM114-Status: GOOD ( 21.90 ) 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:56PM +0100, Mark Rutland wrote: > We have 16 architectural exception vectors, and depending on kernel > configuration we handle 8 or 12 of these with C code, and we handle 8 or > 4 of these as sepcial cases in the entry assembly. > > It would be nicer if the entry assembly were uniform for all exceptions, > and we deferred any specific handling of the exceptions to C code. This > way the entry assembly can be more easily templated without ifdeffery or > special cases, and it's easier to modify the handling of these cases in > future (e.g. to dump additional registers other context). > > This patch reworks the entry code so that we always have a C handler for > every architectural exception vector, with the entry assembly being > completely uniform. We now have to handle exceptions from EL1t and EL1h, > and also have to handle exceptions from AArch32 even when the kernel is > built without CONFIG_COMPAT. To make this clear and to simplify > templating, we rename the top-level exception handlers with a consistent > naming scheme: > > asm: __ > c: ___handler > > .. where: > > is `el1t`, `el1h`, or `el0t` > is `64` or `32` > is `sync`, `irq`, `fiq`, or `error` > > ... e.g. > > asm: el1h_64_sync > c: el1h_64_sync_handler > > ... with lower-level handlers simply using "el1" and "compat" as today. > > For unexpected exceptions, this information is passed to > panic_unandled(), so it can report the specific vector an unexpected panic_unandled()? Cor blimey, guv'nor! > diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S > index b4e9860a2227..d9a2625168aa 100644 > --- a/arch/arm64/kernel/entry.S > +++ b/arch/arm64/kernel/entry.S > @@ -45,16 +45,7 @@ > .endr > .endm > > -/* > - * Bad Abort numbers > - *----------------- > - */ > -#define BAD_SYNC 0 > -#define BAD_IRQ 1 > -#define BAD_FIQ 2 > -#define BAD_ERROR 3 > - > - .macro kernel_ventry, el:req, regsize:req, label:req > + .macro kernel_ventry, el:req, ht, regsize:req, label:req Might as well have ht:req given that you did it for the others earlier on? > - .macro entry_handler el:req, regsize:req, label:req > + .macro entry_handler el:req, ht, regsize:req, label:req Same here. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel