From patchwork Mon Nov 2 11:44:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 11873687 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 48309C00A89 for ; Mon, 2 Nov 2020 11:47:05 +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 ADDC721556 for ; Mon, 2 Nov 2020 11:47:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BBBDvULl"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ha5Oh0/y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADDC721556 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=BBBDvULl4UekG0g8PU0+7Q7ot3 Zc0goM9VECdteCV7jriWwYM0NcUg5lfwrDtriChWEAP7hSV/cbCtETEE3ciCmhwx6qjrdpBw/ts32 yGyRS/D21nZxbFAnQGJYHAw6BT5be1JWOS5JXzopvAT3+x6FYQ9LWFsSpg34dLSa9uskjOc0w4xmT 2GSSjZcYVqT7DiMOZGSAhAvAcWtzKv1nvf022EkEubk+4OLV1rEM7WImYJklRqFsNXeBUs5+OAokm 2vdNyzz7CF6dj8qh0grjJVlZrHtGUUXfTSNHlkFn2ciLrJlB+cAdShY/OyLGThPaA3gik4RgRR8p3 CQipMNWA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZYIA-0007LY-NU; Mon, 02 Nov 2020 11:46:32 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZYHp-0007EI-Bw for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2020 11:46:10 +0000 Received: by mail-pf1-x441.google.com with SMTP id w65so10901173pfd.3 for ; Mon, 02 Nov 2020 03:46:08 -0800 (PST) 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=ha5Oh0/yhwqxHYqeV2xZYGNZplQTwHBBADatw0eeG45ZZoigfIGoiJvN6h/BlE8LyJ D3wjSjKFh5pBsUJ8H/tdFo7x5DNFMUeiTbC+6i/Y4qSByeviCKuXNBo0wv8LXjAk236J 11byt/UYRUypr9OWtDMsLG/JvZAsueXssqR2zD/ndCPX1qvrB6pz06lSqlA34SzlHjFt JM+jXLycY1kYGYlc7ONLsn3wiRKXpJFulqZdXJmBqCbhgZqtFSM1fNWsd72mB/hQWkK6 +JVzv6M2lFVlGa6xgfEzE8mGb2TNkrxlW2sgIiWGSsWxseIr5bPLPEuf3e7I8WETSzaL a0jw== 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=IsmUoerbK0qIxqJCA5lW+HCO/1jcbu+FmHPOh+2BNW+/K70jgo0e+Sej0WWn2mdIcy mqHA3mvhrWxYVGEPGyEIduZh8MGsSMA/Fc8dvMmar1vD6oUMD6FAJZ7wHv0SQGJmVs7q O0m+11shiB5h3IZM3BdcQUlJDCpw8kPz1ywS+TaEHZJgKS9ZgKwWlM7Y2xfsnEpcKI2Z ZXzF/03r3J+D75BsIgiZOu56U5p7RSgLkmPcIkF/0QfuP4C1K5MHPdT8KqBCItc5BRma 3PVlSUf017famOOj3StrUVddONdMSekSaW0WXAC8GuNKJPXOPCUAGU9UA1x0TeHn3mih 7UtQ== X-Gm-Message-State: AOAM5321tqaY3/3zxhRnZuVoG7KJGkrQuBcgPcyWyjs/2jz1rIPUXewW vMX5RX3pThwOnEhmZ2HBnXACQg== X-Google-Smtp-Source: ABdhPJzuTgLuJa5NAjhe4lsISCMZZ15d16sBXJrpQCV0RydcHlai82EJu+jYTzX8/Ljhe8k6GBnDog== X-Received: by 2002:a63:ff5b:: with SMTP id s27mr13157734pgk.383.1604317566593; Mon, 02 Nov 2020 03:46:06 -0800 (PST) Received: from localhost.localdomain ([122.173.169.225]) by smtp.gmail.com with ESMTPSA id y5sm14276184pfq.79.2020.11.02.03.45.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Nov 2020 03:46:05 -0800 (PST) From: Sumit Garg To: maz@kernel.org, catalin.marinas@arm.com, will@kernel.org, daniel.thompson@linaro.org Subject: [PATCH v7 3/7] arm64: smp: Assign and setup an IPI as NMI Date: Mon, 2 Nov 2020 17:14:43 +0530 Message-Id: <1604317487-14543-4-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604317487-14543-1-git-send-email-sumit.garg@linaro.org> References: <1604317487-14543-1-git-send-email-sumit.garg@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201102_064609_569136_7F9D54EB X-CRM114-Status: GOOD ( 15.98 ) 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 , 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 */