Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp713747pxf; Thu, 1 Apr 2021 11:33:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNAHcYIJqHGAhjmoFJo4fVBh2ex3SU5LbqBi/ZZFFAV9RFp8jpanU8S6zyNvIhel6f7ifa X-Received: by 2002:a17:906:1a16:: with SMTP id i22mr10683409ejf.522.1617302039584; Thu, 01 Apr 2021 11:33:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617302039; cv=none; d=google.com; s=arc-20160816; b=ZWNsQAnrhFbNG2RtGDOqnpCl6jeL60V4oAgtp4K51q+8JV10kzEevTRp44Ud2nLrd1 g5zUl+j/8hYQxOgOXIZ6QR+B+GxLgggNHKNQ0GAo6U+dztef8faZ6X5/T/AopY3CQ90s vKLJLsH7HOdu4pvhr8ECbb0HKiykLf6Ha9cG2pB0Q22sGV2zM8yIqUIM82VZDRN3lVhR jRRvsDwrsE2PLkUSwfTfquopxjwKR5uCQMpFRYh/JIvi24D/+vcFO5F5SVGK6zjpHPWx ZRT4l/oKGjYYLwk5bjVwKxg6HPBPt2xvqjim9HASbV1e2KawIQ/ePmqAn4f5ifG/6Qnq T6Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=kZhl7XT7yjoTfmdpqjRB8WpDyAACjOxtCQTkSmgt2zU=; b=daD2QFyv7/+wmbH5iFWckPq48DiTMC0vjzSrL62tWv83uHBWwF4PJMcxybJIR9qjRy fqWOgGji3LfqEaIa0Uyl+m68Kcit+CU/nmvbBFpsjAX2Bi4ywQnDA4gLiYul98fHAkaM k7MI8Dpb8g/AZgVm5hhEUaLKQEUUs0uZZtTPAcxUuLcJ7GL2WLFdKlRZVL+w3cYYRfCh LaUjemrtDFqh1jHj7EuqJV1pku4BdsyP5FKMqpyDF6zfGjq9GPiExZRx5pxkkMM77qHR jVuaM0u2IZBolB6xMlm16sXG7OlfJ/eGqGDgshdSIF6fwXPNt0hLiHvXFYr1Tqr0uTFa 0mLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si5047854edo.515.2021.04.01.11.33.36; Thu, 01 Apr 2021 11:33:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236906AbhDASck (ORCPT + 99 others); Thu, 1 Apr 2021 14:32:40 -0400 Received: from gate.crashing.org ([63.228.1.57]:48323 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238933AbhDASKj (ORCPT ); Thu, 1 Apr 2021 14:10:39 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 131GGI0w032424; Thu, 1 Apr 2021 11:16:18 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 131GGGMJ032422; Thu, 1 Apr 2021 11:16:16 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 1 Apr 2021 11:16:16 -0500 From: Segher Boessenkool To: Nicholas Piggin Cc: Michael Ellerman , aik@ozlabs.ru, akpm@linux-foundation.org, alistair@popple.id.au, aneesh.kumar@linux.ibm.com, atrajeev@linux.vnet.ibm.com, benh@kernel.crashing.org, christophe.leroy@csgroup.eu, haren@linux.ibm.com, jniethe5@gmail.com, john.ogness@linutronix.de, kan.liang@linux.intel.com, kjain@linux.ibm.com, kvm-ppc@vger.kernel.org, leobras.c@gmail.com, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, maddy@linux.ibm.com, mikey@neuling.org, msuchanek@suse.de, oleg@redhat.com, paulus@samba.org, peterx@redhat.com, peterz@infradead.org, pmladek@suse.com, ravi.bangoria@linux.ibm.com, rppt@kernel.org, Xiongwei Song , Xiongwei Song Subject: Re: [PATCH v2] powerpc/traps: Enhance readability for trap types Message-ID: <20210401161616.GF13863@gate.crashing.org> References: <20210330150425.10145-1-sxwjean@me.com> <875z17y79i.fsf@mpe.ellerman.id.au> <20210331212550.GD13863@gate.crashing.org> <87im5620f3.fsf@mpe.ellerman.id.au> <1617262858.ls37f2d81f.astroid@bobo.none> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1617262858.ls37f2d81f.astroid@bobo.none> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 01, 2021 at 06:01:29PM +1000, Nicholas Piggin wrote: > Excerpts from Michael Ellerman's message of April 1, 2021 12:39 pm: > > Segher Boessenkool writes: > >> On Wed, Mar 31, 2021 at 08:58:17PM +1100, Michael Ellerman wrote: > >>> So perhaps: > >>> > >>> EXC_SYSTEM_RESET > >>> EXC_MACHINE_CHECK > >>> EXC_DATA_STORAGE > >>> EXC_DATA_SEGMENT > >>> EXC_INST_STORAGE > >>> EXC_INST_SEGMENT > >>> EXC_EXTERNAL_INTERRUPT > >>> EXC_ALIGNMENT > >>> EXC_PROGRAM_CHECK > >>> EXC_FP_UNAVAILABLE > >>> EXC_DECREMENTER > >>> EXC_HV_DECREMENTER > >>> EXC_SYSTEM_CALL > >>> EXC_HV_DATA_STORAGE > >>> EXC_PERF_MONITOR > >> > >> These are interrupt (vectors), not exceptions. It doesn't matter all > >> that much, but confusing things more isn't useful either! There can be > >> multiple exceptions that all can trigger the same interrupt. > > > > Yeah I know, but I think that ship has already sailed as far as the > > naming we have in the kernel. > > It has, but there are also several other ships also sailing in different > directions. It could be worse though, at least they are not sideways in > the Suez. :-) > > We have over 250 uses of "exc", and several files called "exception" > > something. > > > > Using "interrupt" can also be confusing because Linux uses that to mean > > "external interrupt". > > > > But I dunno, maybe INT or VEC is clearer? .. or TRAP :) > > We actually already have defines that follow Segher's suggestion, it's > just that they're hidden away in a KVM header. > > #define BOOK3S_INTERRUPT_SYSTEM_RESET 0x100 > #define BOOK3S_INTERRUPT_MACHINE_CHECK 0x200 > #define BOOK3S_INTERRUPT_DATA_STORAGE 0x300 > #define BOOK3S_INTERRUPT_DATA_SEGMENT 0x380 > #define BOOK3S_INTERRUPT_INST_STORAGE 0x400 > #define BOOK3S_INTERRUPT_INST_SEGMENT 0x480 > #define BOOK3S_INTERRUPT_EXTERNAL 0x500 > #define BOOK3S_INTERRUPT_EXTERNAL_HV 0x502 > #define BOOK3S_INTERRUPT_ALIGNMENT 0x600 > > It would take just a small amount of work to move these to general > powerpc header, add #ifdefs for Book E/S where the numbers differ, > and remove the BOOK3S_ prefix. > > I don't mind INTERRUPT_ but INT_ would be okay too. VEC_ actually > doesn't match what Book E does (which is some weirdness to map some > of them to match Book S but not all, arguably we should clean that > up too and just use vector numbers consistently, but the INTERRUPT_ > prefix would still be valid if we did that). VEC also is pretty incorrect: there is code at those addresses, not vectors pointing to code (as similar things on some other architectures have). Everyone understands what it means of course, except it is confusing with a thing we *do* have on Power called VEC (the MSR bit) :-P (And TRAP is just one cause of 700...) Segher