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=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 E0C17C4707A for ; Fri, 21 May 2021 17:12:41 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 9CA8C613E1 for ; Fri, 21 May 2021 17:12:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CA8C613E1 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=desiato.20200630; 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=4wjjLHUXwtHX054vjQHWpQB41Zv7GsGChZuFkNde+T0=; b=oHvqWrUHHi853NyAeJGtZ+Ij3F wPVfKorDdzICAlIJg8Sa5RvNC5RfCgcC05pgTEqF05GFkihX7l5xpcmA9pg8ZIdEEwIpHusGkCjfI M8jrxeV8tN7Fw4PupdjbmlHAwC7X5qOmxlfOIG/7MOYgMMf8KJ57Ig545Wvwg0//zGmxZWaT9byH1 6RaHUn67yvBOHoMIJDaw1OLv3G4QbPFErLdz2L8iLPEUAo0Wa/7wyG6OQVagO0fPwWz1GSnK/KvfA +Odv8IMleAAR1UOTJmnilzbbTuSMrVLfrYyNjKLz5ZuvnbHROkVFt3GfDz+ycTQV79p5GP9U4MnXc vC3BkmwA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk8g1-000PpR-DM; Fri, 21 May 2021 17:11:09 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk8fx-000PoM-8r for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 17:11:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4o1FdUg+vYBPt/6hUEGXjsyao0EfhK2MbZCT8lSneJM=; b=cwIQhzs01Wt46yX9eq4S3vmoUD hj+MDyuLIsuMaLsqTx0ipKIGRaNEHYBJhsYMCPYbu1QLbn4f8f8HQMUZy+dnjYeuaVivKJaOoWE2/ V67YEVvhCKiP3KEsJh9eUb1mndKSscUb2WCM2A+Oxv2egcczpMp8h4QyOD9oznG7xmKVLA1ypP6Ru ef8nK4ZnHr44/liAKd1DotoqGu199gF1aQqrttqO3k67uiYYeWlaS3SfTMOFGpWfeItWrVYBB5nEL R/FAI1B7fCWlzRFW+EsjHQKfNkgGljLa+p1Es9AxWbau+tbR4fGznvXdb0T2esBJIQfFxQSRz9T2m dO64sV6w==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lk8fu-00HIeA-K2 for linux-arm-kernel@lists.infradead.org; Fri, 21 May 2021 17:11:04 +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 B9C4E1424; Fri, 21 May 2021 10:10:58 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.33.243]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2248A3F73D; Fri, 21 May 2021 10:10:57 -0700 (PDT) Date: Fri, 21 May 2021 18:10:54 +0100 From: Mark Rutland To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, james.morse@arm.com, maz@kernel.org, will@kernel.org, nd@arm.com Subject: Re: [PATCH v2 12/19] arm64: entry: improve bad_mode() Message-ID: <20210521171054.GD9239@C02TD0UTHF1T.local> References: <20210519123902.2452-1-mark.rutland@arm.com> <20210519123902.2452-13-mark.rutland@arm.com> <20210521170221.GI35816@e124191.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210521170221.GI35816@e124191.cambridge.arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210521_101102_724083_21BEEEF5 X-CRM114-Status: GOOD ( 19.05 ) 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, May 21, 2021 at 06:02:21PM +0100, Joey Gouly wrote: > On Wed, May 19, 2021 at 01:38:55PM +0100, Mark Rutland wrote: > > Our use of bad_mode() has a few rough edges: > > > > * AArch64 doesn't use the term "mode", and refers to "Execution > > states", "Exception levels", and "Selected stack pointer". > > > > * We log the exception type (SYNC/IRQ/FIQ/SError), but not the actual > > "mode" (though this can be deocded from the SPSR value). Whoops, I meant s/deocded/decoded/ here too. I guess I'm not winning the spelling bee this year. > > * We use bad_mode() as a second-level handler for unexpected synchronous > > exceptions, where the "mode" is legitimate, but the specific exception > > is not. > > > > * We dump the ESR value, but call this "code", and so it's not clear to > > all readers that this is the ESR. > > > > ... and all of this can be someqhat opaque to those who aren't extremely > > familiar with the code. > typo: someqhat -> somewhat > > > > > Let's make this a bit clearer by having bad_mode() log "Unhandled > > ${TYPE} exception" rather than "Bad mode in ${TYPE} handler", using > > "ESR" rather than "code", and having the final panic() log "Unhandled > > exception" rather than "Bad mode". > > > > In future we'd like to log the specific architectural vector rather than > > just the type of exception, so we also split the core of basd_mode() out > typo: basd_mode -> bad_mode > > > into a helper called __panic_unhandled(), which takes the vector as a > > string argument. > > > > Reviewed-by: Joey Gouly Thanks! Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel