Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4476728pxu; Tue, 20 Oct 2020 19:22:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoZ3J11RMxBnW753KHps/BQTA4SqGdlhsHdgFgcZgjE0hZPK6jd3mzWhLqbL70miLtj/Af X-Received: by 2002:aa7:c683:: with SMTP id n3mr851355edq.146.1603246976585; Tue, 20 Oct 2020 19:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603246976; cv=none; d=google.com; s=arc-20160816; b=ikdiccQOkrr0m7U4HpQqUkqtq0CsvzAMZRWFlDgGjhUyJOJTqAkKJ8KbCf+xudpN3I rfuv9zq9xIzIdS3SDawAoh85tDXZSDnSld6VuA5zTfPh3SafMyOYAcXxszSPHO2ZceKj EtKHwA5sDWabIMWyC/nEPccFXtbCf1GG2B8p57A9xWFb1UjI30ktLtV8PMU2iKXM0A94 p2i7TgBWNX+sbzFG2+ILgAU02iGwl07OkVIFjRjGgL6FE0d8WJCQMJWbXE/0dyQ22EQp 37HmKWyZi2DLJEMjwLS+fhKndIjRA78GgJK9wwm8lienmcC/Jwc8XooX7+mJK6by2zkm uvJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3072bhtqw85ZZ5q7Kctyban1EX+IQGqUQ7FPQjYg1z4=; b=OMu0HqniJv2xX6TMpnFjHiQdqbJiw6063zvN/GZOw1cNuELsQP72q4V4A9UVry5xnU MIseap/H9Bl8hXKuctX4T24M0GdYXyUL5kVCitNDtzzind3yju6+M4guAglbM6up6uwk t0RaBE1Urfg5Q0G1sEclfmlDyM6c7r6k/mDMWGqtdcE7la3kneBbyw8bycx8poKSn4OZ pFCA79VFjvFJaZtwMl5Pt0Um9CX51Ny5SongvGvZ/KFszpwjt7FekUYe0Gr2pPHk0cyf qn0sW8TZbVV89psfMHPxpXRfWA11xzzHMSw1UAbWnIimiNrN4xM2xESldRtIhExmj4WB khQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wHX2QGkn; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si434935edv.525.2020.10.20.19.22.34; Tue, 20 Oct 2020 19:22:56 -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; dkim=pass header.i=@linaro.org header.s=google header.b=wHX2QGkn; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405891AbgJTMZk (ORCPT + 99 others); Tue, 20 Oct 2020 08:25:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405883AbgJTMZj (ORCPT ); Tue, 20 Oct 2020 08:25:39 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B05AC061755 for ; Tue, 20 Oct 2020 05:25:39 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id f21so1576632wml.3 for ; Tue, 20 Oct 2020 05:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3072bhtqw85ZZ5q7Kctyban1EX+IQGqUQ7FPQjYg1z4=; b=wHX2QGknolq+aCKeuj9TVr+qoMxLXBjgtUghPnFszojrsW6EbHc/uowWZr3oiQOZTF wjj9SooPyLN4foolShHgoIU2Q0GySZDa5dv2BW8l21yX96A/9E5/k3OkANImPibS1JcH 6KD4pO3CacnW64Re+l4bsoTJRDdfvpDYMWmoq2recYkWijVKuGWxmYmDJWrW0L+h5Ewv mkDfIdFx/pREKABAM+ROXjidtORbC3FSPmjaxRt790Qq8su4y3VMtXlkYqC0AY7s5NYf 5fJ/6vD/5hRywuOIrq/quCtoMLWNY9AIK5nSc3sHeHpf3sUabKHwHBke+muGJJAfA2MA HycA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3072bhtqw85ZZ5q7Kctyban1EX+IQGqUQ7FPQjYg1z4=; b=mMKryIGXzrsFcQf4d8vJ2AkVuTJw6mCrIz+UDr5nrrOILQ3iG+QmdfgvVboW3yEU1E Ij4Mz7n+8ZAFEQcL/rUdq1Oq8zft5CYBgEZM2JBmqmz9xUg7/z8NzkmcPAO3MdUpOWw3 ofZYVwlojO4kzNOALuJXXbaxIVuFOmTE0Fs7PpebrjP7Y2wDHnSsiEJDbgYqpLWqP+Pp PJqV9Tr2Ct03fRVn9hVizbiyDfJ/23quUP1wAQUm+o33JN0hqTsXLsoVDBdfEaV036ip TP7sq1q+FySzQ+yJb26SuGHDPhARwhAJJZDkT6tl8RFW8AZrL0DoSce+L+tO9oLmbd8m ioCw== X-Gm-Message-State: AOAM530MSKZ6NNGZtnQtucZKkryIm8ALn8GDh7+ajtZiSZRZ3EiCrlQi kc1101uGWkmvK9koKvL0niZdsw== X-Received: by 2002:a1c:de8a:: with SMTP id v132mr860371wmg.173.1603196737971; Tue, 20 Oct 2020 05:25:37 -0700 (PDT) Received: from holly.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id z11sm2739295wrh.70.2020.10.20.05.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 05:25:37 -0700 (PDT) Date: Tue, 20 Oct 2020 13:25:35 +0100 From: Daniel Thompson To: Sumit Garg Cc: Marc Zyngier , Catalin Marinas , Will Deacon , linux-arm-kernel , Thomas Gleixner , Jason Cooper , Mark Rutland , julien.thierry.kdev@gmail.com, Douglas Anderson , Jason Wessel , Masayoshi Mizuma , ito-yuichi@fujitsu.com, kgdb-bugreport@lists.sourceforge.net, Linux Kernel Mailing List Subject: Re: [PATCH v5 1/5] arm64: Add framework to turn IPI as NMI Message-ID: <20201020122535.paym32gksuhcqtwq@holly.lan> References: <1602673931-28782-1-git-send-email-sumit.garg@linaro.org> <1602673931-28782-2-git-send-email-sumit.garg@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 20, 2020 at 04:52:43PM +0530, Sumit Garg wrote: > On Tue, 20 Oct 2020 at 15:38, Marc Zyngier wrote: > > > > On 2020-10-20 07:43, Sumit Garg wrote: > > > On Mon, 19 Oct 2020 at 17:07, Marc Zyngier wrote: > > > > [...] > > > > >> > +{ > > >> > + if (!ipi_desc) > > >> > + return; > > >> > + > > >> > + if (is_nmi) { > > >> > + if (!prepare_percpu_nmi(ipi_id)) > > >> > + enable_percpu_nmi(ipi_id, IRQ_TYPE_NONE); > > >> > + } else { > > >> > + enable_percpu_irq(ipi_id, IRQ_TYPE_NONE); > > >> > > >> I'm not keen on this. Normal IRQs can't reliably work, so why do you > > >> even bother with this? > > > > > > Yeah I agree but we need to support existing functionality for kgdb > > > roundup and sysrq backtrace using normal IRQs as well. > > > > When has this become a requirement? I don't really see the point in > > implementing something that is known not to work. > > > > For kgdb: > > Default implementation [1] uses smp_call_function_single_async() which > in turn will invoke IPI as a normal IRQ to roundup CPUs. > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/debug/debug_core.c#n244 > > For sysrq backtrace: > > Default implementation [2] fallbacks to smp_call_function() (IPI as a > normal IRQ) to print backtrace in case architecture doesn't provide > arch_trigger_cpumask_backtrace() hook. > > [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/sysrq.c#n250 > > So in general, IPI as a normal IRQ is still useful for debugging but > it can't debug a core which is stuck in deadlock with interrupts > disabled. > > And since we choose override default implementations for pseudo NMI > support, we need to be backwards compatible for platforms which don't > possess pseudo NMI support. Do the fallback implementations require a new IPI? The fallbacks could rely on existing mechanisms such as the smp_call_function family. Daniel.