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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 39006C433E2 for ; Thu, 3 Sep 2020 16:38:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 08DD320578 for ; Thu, 3 Sep 2020 16:38:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zw98hTTw"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="2ePBIcj4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08DD320578 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=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bMZoU1B4mV2QOrKWSGR0tyJ3JabCqqtu0/1+gb4rtkc=; b=zw98hTTwq0ZtLsSE/sIk27Qz/ 2nR0Bh9iFdlWeuB+5g/k5ZNDZ9DaGSxTjEoVc1aSOJB2DUf4u0dJFKMWf/6nNFZ+4Dj6Mc4qHnXpQ pC+B+lRqEIFEYBfWk75Q1TKBckytuzQV8PGzhr9Q6SD8RflE+epyrUp4E/zTr7Frqtp6hCoTvgeeI pv0c7Wjtn3Ij8hOPobk5NIIAHocEBDcXeHQRyU3pxBJtwddOBXODii3nJaknUfCsgeYW1AQttdWj+ D537axG0TEnEivjXlOqQtOflYqjlh8qIFSS1DDP0Uay1/bAEXI67z0WsH1wn+TTJfbSeFlRRDHS/I fUPygA64Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDsEJ-0000hD-NN; Thu, 03 Sep 2020 16:36:55 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDsEG-0000gY-TF for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 16:36:53 +0000 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 31F8620578; Thu, 3 Sep 2020 16:36:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599151011; bh=vrhYPevSt11z/cQhMR2H+wze7oJ1VbX2mNSDSoxY0I4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=2ePBIcj4J6W1l9OFj3I6TJHpFk157TRhgtvCd+h3XP8SHKzY4usGEs51A2xaDxQDI cGArV6cO+Td7NSU0LA944rOnnIf5hKP3dyLXoIPhDzSC3r3clqfRFxbJGRrbW9YDV1 4W3k2q0PqUeTOsUf6TMGXhzJ0cyjtUcM3uR7PHdA= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kDsED-008wYU-Im; Thu, 03 Sep 2020 17:36:49 +0100 MIME-Version: 1.0 Date: Thu, 03 Sep 2020 17:36:49 +0100 From: Marc Zyngier To: Sumit Garg Subject: Re: [PATCH v3 1/4] arm64: smp: Introduce a new IPI as IPI_CALL_NMI_FUNC In-Reply-To: <1599134712-30923-2-git-send-email-sumit.garg@linaro.org> References: <1599134712-30923-1-git-send-email-sumit.garg@linaro.org> <1599134712-30923-2-git-send-email-sumit.garg@linaro.org> User-Agent: Roundcube Webmail/1.4.8 Message-ID: <05a195374cc81008e95e258221fe7d2b@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: sumit.garg@linaro.org, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, tglx@linutronix.de, jason@lakedaemon.net, julien.thierry.kdev@gmail.com, dianders@chromium.org, daniel.thompson@linaro.org, jason.wessel@windriver.com, kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_123653_063479_B30BC3FA X-CRM114-Status: GOOD ( 22.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: daniel.thompson@linaro.org, jason@lakedaemon.net, catalin.marinas@arm.com, dianders@chromium.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jason.wessel@windriver.com, kgdb-bugreport@lists.sourceforge.net, tglx@linutronix.de, will@kernel.org, julien.thierry.kdev@gmail.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-09-03 13:05, Sumit Garg wrote: > Introduce a new inter processor interrupt as IPI_CALL_NMI_FUNC that > can be invoked to run special handlers in NMI context. One such handler > example is kgdb_nmicallback() which is invoked in order to round up > CPUs > to enter kgdb context. > > As currently pseudo NMIs are supported on specific arm64 platforms > which > incorporates GICv3 or later version of interrupt controller. In case a > particular platform doesn't support pseudo NMIs, IPI_CALL_NMI_FUNC will > act as a normal IPI which can still be used to invoke special handlers. > > Signed-off-by: Sumit Garg > --- > arch/arm64/include/asm/smp.h | 1 + > arch/arm64/kernel/smp.c | 11 +++++++++++ > 2 files changed, 12 insertions(+) > > diff --git a/arch/arm64/include/asm/smp.h > b/arch/arm64/include/asm/smp.h > index 2e7f529..e85f5d5 100644 > --- a/arch/arm64/include/asm/smp.h > +++ b/arch/arm64/include/asm/smp.h > @@ -89,6 +89,7 @@ extern void secondary_entry(void); > > extern void arch_send_call_function_single_ipi(int cpu); > extern void arch_send_call_function_ipi_mask(const struct cpumask > *mask); > +extern void arch_send_call_nmi_func_ipi_mask(const struct cpumask > *mask); > > #ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL > extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask); > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c > index b6bde26..1b4c07c 100644 > --- a/arch/arm64/kernel/smp.c > +++ b/arch/arm64/kernel/smp.c > @@ -74,6 +74,7 @@ enum ipi_msg_type { > IPI_TIMER, > IPI_IRQ_WORK, > IPI_WAKEUP, > + IPI_CALL_NMI_FUNC, > NR_IPI > }; > > @@ -793,6 +794,7 @@ static const char *ipi_types[NR_IPI] > __tracepoint_string = { > S(IPI_TIMER, "Timer broadcast interrupts"), > S(IPI_IRQ_WORK, "IRQ work interrupts"), > S(IPI_WAKEUP, "CPU wake-up interrupts"), > + S(IPI_CALL_NMI_FUNC, "NMI function call interrupts"), > }; > > static void smp_cross_call(const struct cpumask *target, unsigned int > ipinr); > @@ -840,6 +842,11 @@ void arch_irq_work_raise(void) > } > #endif > > +void arch_send_call_nmi_func_ipi_mask(const struct cpumask *mask) > +{ > + smp_cross_call(mask, IPI_CALL_NMI_FUNC); > +} > + > static void local_cpu_stop(void) > { > set_cpu_online(smp_processor_id(), false); > @@ -932,6 +939,10 @@ static void do_handle_IPI(int ipinr) > break; > #endif > > + case IPI_CALL_NMI_FUNC: > + /* nop, IPI handlers for special features can be added here. */ > + break; > + > default: > pr_crit("CPU%u: Unknown IPI message 0x%x\n", cpu, ipinr); > break; I'm really not keen on adding more IPIs to the SMP code. One of the main reasons for using these SGIs as normal IRQs was to make them "requestable" from non-arch code as if they were standard percpu interrupts. What prevents you from moving that all the way to the kgdb code? M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel