From patchwork Wed Oct 14 11:12:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 11837515 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A2D8921 for ; Wed, 14 Oct 2020 11:13:25 +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 37A8420878 for ; Wed, 14 Oct 2020 11:13:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vbvBvsv7"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FYmcxhvH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37A8420878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dWbMJo90S18uVqQHMxOwXWsp2Z0S4pZ7GtCqREZWUt0=; b=vbvBvsv7FZ3YLuH5U4SpUdGWHo fX98wGE2rK27rGYzOomGRDFcaCXOF88PTdHf7LsPlAsdwlnV5q7ts5rrmctZ76vWLCxEjllvBi9jY 040nNr9lmqO50k8j1953TfkvshIu82Zd0y6DaUXCXL51UjdzBU8dgNaGmutvGd98N3UKA/0n2NJM9 W8npi/vT/TE8BsXoxmlMySaBr6HZSn/bHM6z0kqN1Ej+NLf8A/LJufyRbgh6ANci+D9V4x1NhgEoW UwsPSFVU5IV5l5PI1A5BHTnR57EFRE517v7nVN3mDf7m2/a7MK0LfZ53gM5tfZYw3xvDrDkW/j63/ fgP+DeDA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSeiU-0005Xd-QZ; Wed, 14 Oct 2020 11:13:10 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSeiQ-0005Vd-Tj for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2020 11:13:08 +0000 Received: by mail-pj1-x1042.google.com with SMTP id j8so1460557pjy.5 for ; Wed, 14 Oct 2020 04:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EUkHDvfGVE/Mcc9y3ck7YoAw/1fhaX3NtNSY/g0jhfY=; b=FYmcxhvH0YuLvemO1AyMtpefAmnRpXGpQXtcK0AOZ7sP5KXApkDaiAxscIbi25/JS7 oub8Nuu9A7q/RCNQ4DsUKWc+34EOV/1Eekj5w/Oxz5qL3/jAJjrpVCKWi8dCbv6jVjo/ 3loFSiCsh4GLzrebFVrFKst9Afli9pXjJ7VsPDNN/L/6oSpaWDtwSHxhGKl3D9l6HLLV ruPFCUKH/09wjzTZn+a2Z0CpJy0lxl6UnKDYkRPE7TRtWvgBMKFB4K8k7pKeFDLz7Len R4887268UA0WpU6UxYBP5N99gQrZHa96GMl6+Jy7F88LVtmVll9z5F384pI/oSbI+7mZ xecw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EUkHDvfGVE/Mcc9y3ck7YoAw/1fhaX3NtNSY/g0jhfY=; b=FiLXxY0AKj7toLAKVPWDcMEb/vwz2hwWZrcJIXYzySzpdXgRLagcvF+W/x4pNPHQWf z/QN7vzqfiBP6eIby5uFJTs4kLZnzNYNie02vkrrhlqlJicy0csk8LfspGPHA7cpOSK+ CyrFjsLXKYVd4ZpL+XGd/GHhXdGm8N54SaJ4Sf4TKI7s5/+QYLwuhxVFmrnF9JSOA/V2 QbPGjnYzn3SUPIrxpEFeQbSeXu4sJ5GroASTFCsBihQyi17fm7SLiPe+uja1PcAfKBSf 5deDRWujogw6gRroED8hAAcqMQiM12pwUDX0lgL4GkJ+DJ52wANNk5ho8mXqVl/yWSua 16fA== X-Gm-Message-State: AOAM531HXBOXFTifwclLbsb7tka89Ve1y2wstpgQbYLo5SHGlKMI/BYf J4h/ZaxuaB7lyI//PbFjquzcWA== X-Google-Smtp-Source: ABdhPJw/CZvq+k4z2trU3PIw1LtcMHYqbyozAmkwTA7XP6H6ZXN05RSuiZF6PfflggOwwVnj6abBpQ== X-Received: by 2002:a17:90b:305:: with SMTP id ay5mr3083885pjb.129.1602673984880; Wed, 14 Oct 2020 04:13:04 -0700 (PDT) Received: from localhost.localdomain ([117.252.65.235]) by smtp.gmail.com with ESMTPSA id f21sm3060102pfk.169.2020.10.14.04.12.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2020 04:13:04 -0700 (PDT) From: Sumit Garg To: maz@kernel.org, catalin.marinas@arm.com, will@kernel.org Subject: [PATCH v5 3/5] arm64: smp: Allocate and setup IPI as NMI Date: Wed, 14 Oct 2020 16:42:09 +0530 Message-Id: <1602673931-28782-4-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1602673931-28782-1-git-send-email-sumit.garg@linaro.org> References: <1602673931-28782-1-git-send-email-sumit.garg@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_071307_353221_6037DD26 X-CRM114-Status: GOOD ( 15.39 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1042 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: mark.rutland@arm.com, Sumit Garg , daniel.thompson@linaro.org, jason@lakedaemon.net, kgdb-bugreport@lists.sourceforge.net, ito-yuichi@fujitsu.com, dianders@chromium.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jason.wessel@windriver.com, tglx@linutronix.de, msys.mizuma@gmail.com, julien.thierry.kdev@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Allocate an unused IPI that can be turned as NMI using ipi_nmi framework. Also, invoke corresponding NMI setup/teardown APIs. Signed-off-by: Sumit Garg --- arch/arm64/kernel/smp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 82e75fc..129ebfb 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -962,6 +963,8 @@ static void ipi_setup(int cpu) for (i = 0; i < nr_ipi; i++) enable_percpu_irq(ipi_irq_base + i, 0); + + ipi_nmi_setup(cpu); } #ifdef CONFIG_HOTPLUG_CPU @@ -974,6 +977,8 @@ static void ipi_teardown(int cpu) for (i = 0; i < nr_ipi; i++) disable_percpu_irq(ipi_irq_base + i); + + ipi_nmi_teardown(cpu); } #endif @@ -995,6 +1000,9 @@ void __init set_smp_ipi_range(int ipi_base, int n) irq_set_status_flags(ipi_base + i, IRQ_HIDDEN); } + if (n > nr_ipi) + set_smp_ipi_nmi(ipi_base + nr_ipi); + ipi_irq_base = ipi_base; /* Setup the boot CPU immediately */