Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2659377pxb; Sat, 23 Oct 2021 05:09:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEHksHrLE2PpvWOnbtX7hlrGHoTfroO0FAqGL5rZQCu6hSubUcWRQYGBbISC2drAq/ens5 X-Received: by 2002:a63:6a05:: with SMTP id f5mr4270980pgc.398.1634990977101; Sat, 23 Oct 2021 05:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634990977; cv=none; d=google.com; s=arc-20160816; b=MDv2Qw6SppUzbhYvFB7awmN1YcdQ5gLvqwBBatixOg5eWJKw3ugeI+9YmLFBaISRKl oNXIdR9XOq1gi7rUq+XMaxrNUqZOOYaC6lsPZGMZdq+RufWqozFsinf0MJkYan/wYr/S mpP/2lm34eBEWSVENHZMz/8vWWjLkYMwA+i6Lk/SWeADfgvk10g9b3mHQnyHvGxqhjX+ 328G42nyFkGqFGCcdPywPI57oUUAu0sbaT8zOXLRGd0RcfBy26140wGB0/ULPARtP48l h1/xKeEFd3etZzeXGqYTBadofq5Gbgbm2Z6iYvHzZuTofxIkP+sqwkECTHIbU9dc3go7 IJcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ErAW/X3g3mdIGm45W28oxjGpfAPlYGs204PyMQZgS2Y=; b=LCf5rQWIr2ckguwUWqMy8SEQ17h2xlOOpWaFsJv2pfXKZvn+8fPpCZUCGSvc6PuRSn 3gevCy+UeOG2G2YOAKPAlD7I0kdcIVJJfjf4ecGREM6I7fUTDYNTcMIKrtwK7eakjS+L AMe/PjCH/8kWGPhcq3MRewO/4giQV1GnzPytbVr+UEUU+3fhlohq3xCKvQJod1An+ad+ N1JvLh6/ZWK13JGvdKPwAToD+MJRXnB/c7cAMeYu0BQocM28L10vFBAvJjk3P4R07TxN v1Zwe9OVDmVYP9T37vkNUs8qYHnQGTFAuGhKH0kslkV83V4rcwSJpC6axzKkKfFvhn5g X86A== 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nu16si16612679pjb.75.2021.10.23.05.09.23; Sat, 23 Oct 2021 05:09:37 -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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230359AbhJWMIw (ORCPT + 99 others); Sat, 23 Oct 2021 08:08:52 -0400 Received: from foss.arm.com ([217.140.110.172]:33434 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbhJWMIw (ORCPT ); Sat, 23 Oct 2021 08:08:52 -0400 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 C2B5CD6E; Sat, 23 Oct 2021 05:06:32 -0700 (PDT) Received: from [10.57.28.205] (unknown [10.57.28.205]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 266E83F70D; Sat, 23 Oct 2021 05:06:27 -0700 (PDT) Subject: Re: [PATCH 09/15] irq: arm: perform irqentry in entry code To: Marc Zyngier , Mark Rutland Cc: 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 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> From: Vladimir Murzin Message-ID: Date: Sat, 23 Oct 2021 13:06:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <87tuh8uchn.wl-maz@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: >>> On 10/22/21 4:36 PM, Mark Rutland wrote: >>>> On Fri, Oct 22, 2021 at 04:18:18PM +0100, Vladimir Murzin wrote: >>>>> Hi Mark, >>>>> >>>>> On 10/21/21 7:02 PM, Mark Rutland wrote: >>>>>> +/* >>>>>> + * TODO: restructure the ARMv7M entry logic so that this entry logic can live >>>>>> + * in arch code. >>>>>> + */ >>>>>> +asmlinkage void __exception_irq_entry >>>>>> +static void nvic_handle_irq(irq_hw_number_t hwirq, struct pt_regs *regs) >>>>> >>>>> I'm seeing build time failure... >>>>> >>>>> drivers/irqchip/irq-nvic.c:50:8: error: two or more data types in declaration specifiers >>>>> static void nvic_handle_irq(irq_hw_number_t hwirq, struct pt_regs *regs) >>>>> ^~~~ >>>>> drivers/irqchip/irq-nvic.c:50:13: warning: 'nvic_handle_irq' defined but not used [-Wunused-function] >>>>> static void nvic_handle_irq(irq_hw_number_t hwirq, struct pt_regs *regs) >>>>> >>>>> I've fixed that locally and planing to give it a go... >>>> >>>> Ah, whoops. I've removed the extraneous `static void` from >>>> nvic_handle_irq() and build tested that as part of stm32_defconfig. >>>> >>>> The updated version is in my irq/handle-domain-irq branch at: >>>> >>>> git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git >>>> >>> >>> $ cat /proc/interrupts >>> CPU0 >>> 16: 24 nvic_irq 4 Edge mps2-clkevt >>> 17: 0 nvic_irq 32 Edge mps2-uart-rx >>> 18: 6 nvic_irq 33 Edge mps2-uart-tx >>> 19: 0 nvic_irq 47 Edge mps2-uart-overrun >>> Err: 0 >>> >>> So if it helps feel free to add my >>> >>> Tested-by: Vladimir Murzin # ARMv7M >> >> Thanks! >> >> I've folded that in and uppdated the branch. >> >>> 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? Cheers Vladimir > > Thanks, > > M. >