Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2713731pxb; Sat, 23 Oct 2021 06:21:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvR7fDktkQWSHvTOuGFXYzy6rYAByX4B7DEwsr3GkbeYnPYKZ9h/7GE5xG8D2FoEXkc4LA X-Received: by 2002:a05:6402:27cd:: with SMTP id c13mr9098135ede.351.1634995291783; Sat, 23 Oct 2021 06:21:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634995291; cv=none; d=google.com; s=arc-20160816; b=Rx0QK3aPimY/BxwJWiS/g3XZqgdNKYN1AP5JAX0KrRjJSNH5FZ0JQnABwLbvSCYV+F x9J/XsrVb4RxTtJTtv505ZHGRp+ww+kSCTn2CTXBadGUy03SRhKMKBOVX93uU4RGdW27 YhvWFmqXKI27L+cFLVVORYWq52i56BZmqPqFWx443qsMT2LKo4fVJLSunUT7g2RdfJLD YRLyrkow0hXuIfnGVd1FBqmaLlRv+7XcPJdlbmIEdaycIis4n+b0cQzOqoaUgRNvDjOZ aa2GHnpjuc+/gyLeFjQfNl6J5HVa06TzfkNFw0JPhPCUgfWMv17+VJvNzu3bX5NPiUUE kHLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=fcBHz0I5XY2vPNsGO4q4LZxowC9vUa9STMEj9HK4XZM=; b=tE7SORmoGWpKO+kpiVlHdvxA5HFGNwnDs0lGC2+GK+5bEV4RgtDDuAoSVL90DYw1Su XAkDZknmXfCj/fCYVFT4wH49a6rICZWxLiZciW7I9ucLGjT8ocvYMXvyp4HPcd638PTb wD+zeDyKVIWq0W+ybE5pmzlKD71aJkq9jlfV9X71aTl/BeAyDty9JFZsqrmGGmXLUEqZ sIdFqck6Nz3id+UTRrkmccwx5SglP7eMTmMb7ZiKzV7auCGQontyRN8waoteNMn5Z/vH wcnGUr6wP1c65kh1Vnnu8CfBXhugjDLEsBUmf7a956ZKgY5K/SIEbYuZmn7RT+p+o+59 yOmg== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dz12si6315061edb.66.2021.10.23.06.21.08; Sat, 23 Oct 2021 06:21:31 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230379AbhJWNUq (ORCPT + 99 others); Sat, 23 Oct 2021 09:20:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:39658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbhJWNUq (ORCPT ); Sat, 23 Oct 2021 09:20:46 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 04DC060FDA; Sat, 23 Oct 2021 13:18:27 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1meGum-0015IX-OP; Sat, 23 Oct 2021 14:18:24 +0100 Date: Sat, 23 Oct 2021 14:18:24 +0100 Message-ID: <87ilxnc21r.wl-maz@kernel.org> From: Marc Zyngier To: Vladimir Murzin Cc: Mark Rutland , linux-kernel@vger.kernel.org, aou@eecs.berkeley.edu, catalin.marinas@arm.com, deanbo422@gmail.com, green.hu@gmail.com, guoren@kernel.org, jonas@southpole.se, kernelfans@gmail.com, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, nickhu@andestech.com, palmer@dabbelt.com, paulmck@kernel.org, paul.walmsley@sifive.com, peterz@infradead.org, shorne@gmail.com, stefan.kristiansson@saunalahti.fi, tglx@linutronix.de, torvalds@linux-foundation.org, tsbogend@alpha.franken.de, vgupta@kernel.org, will@kernel.org Subject: Re: [PATCH 09/15] irq: arm: perform irqentry in entry code In-Reply-To: References: <20211021180236.37428-1-mark.rutland@arm.com> <20211021180236.37428-10-mark.rutland@arm.com> <0efc4465-12b5-a568-0228-c744ec0509a3@arm.com> <20211022153602.GE86184@C02TD0UTHF1T.local> <1dc39ac9-1a05-cf8d-2aef-633903a6338d@arm.com> <20211022175854.GK86184@C02TD0UTHF1T.local> <87tuh8uchn.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: vladimir.murzin@arm.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, aou@eecs.berkeley.edu, catalin.marinas@arm.com, deanbo422@gmail.com, green.hu@gmail.com, guoren@kernel.org, jonas@southpole.se, kernelfans@gmail.com, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, nickhu@andestech.com, palmer@dabbelt.com, paulmck@kernel.org, paul.walmsley@sifive.com, peterz@infradead.org, shorne@gmail.com, stefan.kristiansson@saunalahti.fi, tglx@linutronix.de, torvalds@linux-foundation.org, tsbogend@alpha.franken.de, vgupta@kernel.org, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 23 Oct 2021 13:06:25 +0100, Vladimir Murzin wrote: > > On 10/22/21 7:43 PM, Marc Zyngier wrote: > > On Fri, 22 Oct 2021 18:58:54 +0100, > > Mark Rutland wrote: > >> > >> On Fri, Oct 22, 2021 at 05:34:20PM +0100, Vladimir Murzin wrote: [...] > >>> As for TODO, is [1] look something you have been thinking of? IIUC, > >>> the show stopper is that hwirq is being passed from exception entry > >>> which retrieved via xPSR (IPSR to be precise). OTOH hwirq also available > >>> via Interrupt Controller Status Register (ICSR) thus can be used in > >>> driver itself... I gave [1] a go and it runs fine, yet I admit I might > >>> be missing something... > >> > >> I hadn't thought about it in much detail, but that looks good! > >> > >> I was wondering if we needed something like a > >> handle_arch_vectored_irq(), but if we can rely on the ICSR that seems > >> simpler overall. I'm not at all familiar with M-class, so I'm not sure > >> if there are pitfalls in this area. > > > > Why can't we just use IPSR instead from the C code? It has the > > potential of being of lower latency then a MMIO read (though I have no > > idea whether it makes a material difference on M-class) and from what > > I can see in the arch spec, they are strictly equivalent. > > Hmmm, less arch specific asm(s) in driver code, no? Well, it isn't like this driver is going to be useful on anything else, is it? If there is no overhead in reading from MMIO compared to the architected register, then I agree that ICSR is the way to go. Is there any chance you could measure it on a HW platform? Or maybe in emulation? Thanks, M. -- Without deviation from the norm, progress is not possible.