Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3014368pxu; Sat, 10 Oct 2020 16:08:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcFX463de9BsfoE09NAkWIxnWKbtEshFGHW5ZNc4dxAUdCqYzVsOQKWo6a38kVPccj+g45 X-Received: by 2002:a05:6402:709:: with SMTP id w9mr6489610edx.326.1602371338346; Sat, 10 Oct 2020 16:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602371338; cv=none; d=google.com; s=arc-20160816; b=uQ7tGAgL6wLZ7aBIamdbU2MzvAxo1/i5J8Aov1Z8EmhYswIrTCeNtGdaZzZiysAqBF PRCR2IcKY6151OdZDnOa8g/WQ4twmHNAhzaSLb8QoPvLNgm09JRgXQi+FqO7R/W/hlmz KyYDzfdpF6Ye0VAvuLcw3atu67ks5I7Bkld/856HUVZcKPcrV4YFI36Nnkuc+sV3cvMQ wyd5bs8cEmqetd2NfQeKFvSeJv9lX3Frq2XuLF3jpb8SDczI1AC9sR3v7XPRsj/xZwpa lSVz1+ijlA0BYyIP9ia8e7C9Wikv7Gm0A3nosE0Ryh0DtLgHOol6EApv0QvWWFG7lFc+ y3Tg== 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:dkim-signature; bh=jwr2TVVIxuVbQiXTePtCe0IP2hAh32vyOwpHKJSDTxM=; b=TrgkamTKBylAKFIn70OyqSGRjeU/70dBALDGbDsfpJa19V2aURz7vo8zfFew/bVFFF tRPLXv4MUim7RnFJUmVt/bBnllk73ztnPgJIIWY/mBfQNcmV9iZSYrCHJLkJsUScx8HZ nAr2m2ipyKPwv4eRW+i7Dp1XWHaCIFwxsK6kTdPglnCuOok6BZ5yTos+BDwG7i95HTuF CxWQy47EwxeAfwwSNyMvPBgn9Nc2d9jk8SNuYzCsT7LyDupT6HebEWPHa4pF1OBaN2DA sm4bTmDQIXEQZ0c83YwUI0Ww9Lw8c5dVBNb/A4JHymfpuYCIANAHyPfgfiR3yFewI1rF sJ4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=C2qzrFwQ; 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 m11si7316925edl.188.2020.10.10.16.08.35; Sat, 10 Oct 2020 16:08:58 -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=@kernel.org header.s=default header.b=C2qzrFwQ; 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 S1731977AbgJJW7G (ORCPT + 99 others); Sat, 10 Oct 2020 18:59:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:57040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732256AbgJJTyJ (ORCPT ); Sat, 10 Oct 2020 15:54:09 -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 300442083B; Sat, 10 Oct 2020 09:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602322453; bh=WLVv8CvFvUSELyadEZBT+16ZDWG3WBn4ipBP0xto/UI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=C2qzrFwQ4NGh6/r2VdskQK5E6p3UUaAAAJbND3+98N866PwxsItCbqLVe0OZ5vURN Cws/paLlMbQLPhoflox7jxIpofiMkcDX5PL8QNmutaJGWXjfSaP5qix3va/qGANLsi uzlMj5VQvOrZ6ofV32j9e7L7TYoF2pZ0pSjrpGf4= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kRBGU-001GJz-Tk; Sat, 10 Oct 2020 10:34:11 +0100 Date: Sat, 10 Oct 2020 10:34:04 +0100 Message-ID: <877drypgqb.wl-maz@kernel.org> From: Marc Zyngier To: Masayoshi Mizuma Cc: Sumit Garg , catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, daniel.thompson@linaro.org, jason@lakedaemon.net, kgdb-bugreport@lists.sourceforge.net, dianders@chromium.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jason.wessel@windriver.com, tglx@linutronix.de, julien.thierry.kdev@gmail.com Subject: Re: [PATCH v4 1/5] arm64: Add framework to turn IPI as NMI In-Reply-To: <20201010015855.vksetnj4luft5enc@gabell> References: <1599830924-13990-1-git-send-email-sumit.garg@linaro.org> <1599830924-13990-2-git-send-email-sumit.garg@linaro.org> <20201010015855.vksetnj4luft5enc@gabell> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (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: 62.31.163.78 X-SA-Exim-Rcpt-To: msys.mizuma@gmail.com, sumit.garg@linaro.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, daniel.thompson@linaro.org, jason@lakedaemon.net, kgdb-bugreport@lists.sourceforge.net, dianders@chromium.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jason.wessel@windriver.com, tglx@linutronix.de, julien.thierry.kdev@gmail.com 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, 10 Oct 2020 02:58:55 +0100, Masayoshi Mizuma wrote: [...] > > +void ipi_nmi_setup(int cpu) > > +{ > > + if (!ipi_desc) > > + return; > > ipi_nmi_setup() may be called twice for CPU0: > > set_smp_ipi_range => set_smp_ipi_nmi => ipi_nmi_setup > => ipi_setup => ipi_nmi_setup > > Actually, I got the following error message via the second ipi_nmi_setup(): > > GICv3: Pseudo-NMIs enabled using relaxed ICC_PMR_EL1 synchronisation > GICv3: Cannot set NMI property of enabled IRQ 8 > genirq: Failed to setup NMI delivery: irq 8 > > Why don't we have a check to prevent that? Like as: > > if (cpumask_test_cpu(cpu, ipi_desc->percpu_enabled)) > return; That's definitely the wrong thing to do. prepare_nmi_setup() shouldn't be called twice, and papering over it isn't acceptable. M. -- Without deviation from the norm, progress is not possible.