Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp424177pxa; Fri, 14 Aug 2020 07:54:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDOO4uKfN7EwgrZ5KQUmNBq/J2djQBfpJZHlLuBjWN9K8kMSGFi6l6C44DbbOiN9PBIS34 X-Received: by 2002:a17:906:3e4f:: with SMTP id t15mr2918877eji.368.1597416856743; Fri, 14 Aug 2020 07:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597416856; cv=none; d=google.com; s=arc-20160816; b=nGIBk8fY2FCKB+gtp2WE1bNRjc165Mk4DX5L9APRsb8PuR4ziyuqt7qqbevsQVLPAB 7FEqVU1dkxgothw7uYAV0axIwI5LCbjwidTHxKv9gi2NTmrKCOYKBAfoWD1/8eb6TubJ Gqe0pIBudlnXyA88Uh5T+W+vIVWeN6jYlChtEfd9D4BmbZIrJ6JpjSegFg2kZLFarM3i 4DA4NAHnzhQ0WrjfpAi/f3vjyijh+neYzsRQ4G8mYqnnKL2mRdm5nnxZKAdbPcwA7MOf fCDqd52emAmWahrXRclYRukaSTsJim6vzrMYZcLLkkeAz64s0NOm9oeU10S0SdYvO1yr RGaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=YYYrjEgMAA4u8RoHDSiUNVuFlpaGFObMWit7kqQR9vU=; b=WotsN65PSlF+oHiSA1UE0S2bEtehADAvlVPZ/RsWZYzGCiNZaPwUDt0K+ljIaPJrWC EP7mRBkTYoBNwj4NOJwLXNeR7NnJ6uTkpzwhHtcMOWFyWwpzbQjh4Vt5uHXxBegTgA39 u4+izcmzahYUJG7K6VRAieKfQ3Z+eaG2jOeXuUYFjbzqy7ep0HodxBK+yFBSfUoqdfI3 aEExgh/auqeWhViiWnWBKCoUquHYyOufOOMOZr0QTB4JNWiDKTOdOxst6dJAt5iN1yFx +ZO6wccSBZ4CJY1fzWWRmaJiNCNeBox1qQZG2FC2Yt2k/8SDZje7fWInLDq7sWALYOJ+ e22Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="fOhW/yhl"; 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 q10si5943328eji.361.2020.08.14.07.53.53; Fri, 14 Aug 2020 07:54:16 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b="fOhW/yhl"; 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 S1728808AbgHNOeR (ORCPT + 99 others); Fri, 14 Aug 2020 10:34:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbgHNOeP (ORCPT ); Fri, 14 Aug 2020 10:34:15 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E23EC061384; Fri, 14 Aug 2020 07:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YYYrjEgMAA4u8RoHDSiUNVuFlpaGFObMWit7kqQR9vU=; b=fOhW/yhl8mj63z46HaCxzt/X5J XNcVszm1/6jzcRI4Dhj9LUdZHuvb0F+XA2jTy+xBujD5/Nh1TgIz6YWlOsIlxLnJ3fJSAC356go8F cMKV9QxC7Q/z7/mwZjCU11Dg/P4PvZqxnYrHHtMP6/4EUNA0RnAAIx3qdSsscPP6C2LeXkHTayD0R bmITOvcic+ZbcOMCEUfGWQrhWsuAWrbFySHWUA0EHRy/ScEbQnPG4QId4HvJnhGBdlCGKQHdE9wmI /tfPaJEK/mUWwSXPyudzMHgV0qBNTOFnFLugzmiJdSn0og5NQ3rsUupcnSGKsQtcYbm2D2NnXR7tH PJ2+EN7A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k6amT-0008I7-PU; Fri, 14 Aug 2020 14:34:05 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 3DDBC300238; Fri, 14 Aug 2020 16:34:00 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2258C2C36C972; Fri, 14 Aug 2020 16:34:00 +0200 (CEST) Date: Fri, 14 Aug 2020 16:34:00 +0200 From: peterz@infradead.org To: Sumit Garg Cc: Doug Anderson , Greg Kroah-Hartman , Daniel Thompson , linux-serial@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Jiri Slaby , Russell King - ARM Linux , Jason Wessel , LKML , Linux ARM Subject: Re: [RFC 1/5] tty/sysrq: Make sysrq handler NMI aware Message-ID: <20200814143400.GB165568@hirez.programming.kicks-ass.net> References: <1595333413-30052-1-git-send-email-sumit.garg@linaro.org> <1595333413-30052-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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 14, 2020 at 12:54:35PM +0530, Sumit Garg wrote: > On Thu, 13 Aug 2020 at 05:30, Doug Anderson wrote: > > On Tue, Jul 21, 2020 at 5:10 AM Sumit Garg wrote: > > Wishful thinking, but (as far as I can tell) irq_work_queue() only > > queues work on the CPU running the NMI. I don't have lots of NMI > > experience, but any chance there is a variant that will queue work on > > any CPU? Then sysrq handlers that aren't NMI aware will be more > > likely to work. > > > > Unfortunately, queuing work on other CPUs isn't safe in NMI context, > see this warning [1]. The comment mentions: > > /* Arch remote IPI send/receive backend aren't NMI safe */ > > Peter, > > Can you throw some light here as to why it isn't considered NMI-safe > to send remote IPI in NMI context? Is it an arch specific limitation? Yeah, remote irq_work uses __smp_call_single_queue() / send_call_function_single_ipi() which isn't safe to be used from NMI context in general. arch_irq_work_raise() is very carefully implemented on a number of platforms to be able to (self) IPI from NMI context.