From patchwork Thu Oct 29 14:56:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 11866595 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 4F574C4363A for ; Thu, 29 Oct 2020 14:59:34 +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 B8C782067C for ; Thu, 29 Oct 2020 14:59:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NHaVABqa"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="I5prQNYU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8C782067C 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+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-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=WBLn9txQ+9Qcn162Ro7mqjWsOlETAN0QOxqTc7Q3rIU=; b=NHaVABqaPOzeGbA+4rd5SP/zIq dwhbCHiOFZ/IqHmdWU7eyhUQl+6jyKFfsBIuKiqgSntCoDz6A1ZLosn/2Qd6Q9RZVG3JebR+6Reqp pw/l8VMnWsdWC6kJJilOhSjJ1IjJ4DbVq7s2wYILff4z79oKrVxYoaxHQJN4aK599ilA9eCB5U3u6 JE3ZihYCxoGLLD+/px0sttTP83PzBbCdumjw9Vin/2xSmphQczXNyI5yHR8RrTF3KcuCxUfegw2gi 5lM65/lYw0TmOlk5etGhkA6s/6nlWmYhLfzL/Vaq59d4/CXe5DzZXM/iVw+NRM35ciFCUYVQnJbV5 pxpDOcXA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kY9OB-0004Mr-Sk; Thu, 29 Oct 2020 14:58:55 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kY9Ns-0004HQ-4T for linux-arm-kernel@lists.infradead.org; Thu, 29 Oct 2020 14:58:42 +0000 Received: by mail-pl1-x643.google.com with SMTP id r10so1422540plx.3 for ; Thu, 29 Oct 2020 07:58:35 -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=MUHxFreF4fdTU7bboIWPPhRLi/D8nJxSl4ZDICONfD4=; b=I5prQNYU5tqab1IAfmZ0Npzyxgasjwchz+CCyq076+/YxECJ9irL5REQHWRDrYdShV jM2Y9CHbIKhcjSTBzw49Xd7cj0kjYmyK6qSFFodBZuF0Vw/gVdCgm2pRnigrLwoaikAM NfPhzzzlvNCLa6OnTOdYnw7RyWOUzfu5Xaj5f9LVIb3Kea34JJqKoDVQwQzZDIiBfxvg hbK3AjBepCXhJ+bQPSwLFS9LeRaGFvViqvSWt4d0+hWKSKdGYSM06UStkCFRe22FTcL3 jWEwctUzQpa7fU1nexbrqOK4C0QbYl1lx2kdPLoTUaKtFJIQjZeJCKZrav9GONuYdtTv Jjug== 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=MUHxFreF4fdTU7bboIWPPhRLi/D8nJxSl4ZDICONfD4=; b=SnaQY99mjWk4FYusNrb1QE3Fb85tiKx4OFXmiv7FJ7YxiaevsV+31ENU9Xh6T/0z8f te2dm/6Y2d6xctfU1zekyFeMmTwH1k90bG0T38mNL2002vnwtrHOclC6+kNHkQe2JsG4 obZZqmC5EILFw65jHFkCe/bzg7thZCjnhsDhVU5G/83MImixylw6KWZfmGkxq1bQnzbf Kq3/KsyVHGvYaDbhOaW7Ee7o82K4dFMPOtisONTQYQF5PmYbY1fLica7a4M5ZpLT3N4q HOnHICHAiObWs+m8ZFm0WpAFUhfqDNon9PCthT3C3o/Y3ChMeg2cJEtXkFdlZ7uIb0sp 9lTA== X-Gm-Message-State: AOAM532bO4yDQ7C4o3FWw876inNNlq81n2IWi8PLdqIa8iJVY9/FC2wY DtGR3SG7FytR57Ei8iA/6YmGOA== X-Google-Smtp-Source: ABdhPJwqp0xpo/eiBJyVtR3vcK/b8J0sVo6R8J+CU3LZlp/xmNnniW8nrAxtjB/bf7UgrPh+AotL+w== X-Received: by 2002:a17:902:7d89:b029:d5:cfb6:e44 with SMTP id a9-20020a1709027d89b02900d5cfb60e44mr4658355plm.28.1603983513751; Thu, 29 Oct 2020 07:58:33 -0700 (PDT) Received: from localhost.localdomain ([117.252.71.231]) by smtp.gmail.com with ESMTPSA id j11sm3085082pfc.64.2020.10.29.07.58.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2020 07:58:33 -0700 (PDT) From: Sumit Garg To: maz@kernel.org, catalin.marinas@arm.com, will@kernel.org Subject: [PATCH v6 3/7] arm64: smp: Assign and setup an IPI as NMI Date: Thu, 29 Oct 2020 20:26:23 +0530 Message-Id: <1603983387-8738-4-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603983387-8738-1-git-send-email-sumit.garg@linaro.org> References: <1603983387-8738-1-git-send-email-sumit.garg@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201029_105836_306805_634C5A89 X-CRM114-Status: GOOD ( 15.36 ) 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, tsbogend@alpha.franken.de, linux-kernel@vger.kernel.org, jason@lakedaemon.net, ito-yuichi@fujitsu.com, mpe@ellerman.id.au, x86@kernel.org, linux@armlinux.org.uk, dianders@chromium.org, mingo@redhat.com, bp@alien8.de, julien.thierry.kdev@gmail.com, jason.wessel@windriver.com, kgdb-bugreport@lists.sourceforge.net, tglx@linutronix.de, msys.mizuma@gmail.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Assign an unused IPI which can be turned as NMI using ipi_nmi framework. Also, invoke corresponding dynamic IPI 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..2e118e2 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); + + dynamic_ipi_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); + + dynamic_ipi_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_dynamic_ipi(ipi_base + nr_ipi); + ipi_irq_base = ipi_base; /* Setup the boot CPU immediately */