From patchwork Wed Apr 19 22:55:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13217630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3D62C77B73 for ; Wed, 19 Apr 2023 22:58:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dvlcv7er6Er6NRcBZ7Y7vgsmzND+0/WYH+KmJaCXxeY=; b=jeil2P71Y2cnea U3Jf3vWUzGvqu+1WOLlVTaHcuIoIiobwvoFSNOFpnCPqKdeyCtWgY8fHUBcad5cRyjRj6dlWah7ra VvVVMTS+v6GTkCdI+0RP0M33WvJuXpIgEwUAm0LsplHTQyVvliVhbW4Ts7oce28BWRvAarDSicyBf D76ZPe63+7/XGa2369HE6YKe/LYf/YNYvr4YtuJeFwBY4+GsS4KBclSXGV9r8n0zMYs/JbWKfyQxl ShEIGx2TGmqugcKF8lUVX0LDC24eL2j/I0O7P60b89rpSFmJCUE8WIJc/k6GOrPEexf8opheLf9zm Y4x0YiJfUSeRdBGYsD0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ppGjf-006Ywd-0x; Wed, 19 Apr 2023 22:57:11 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ppGja-006YuW-26 for linux-arm-kernel@lists.infradead.org; Wed, 19 Apr 2023 22:57:07 +0000 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-517bdd9957dso246917a12.1 for ; Wed, 19 Apr 2023 15:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1681945026; x=1684537026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I4TtHmnmxTTT3fwHdqQt/qizkftz4ebAquvrklnKCnk=; b=Mhapfz67dud/UPYR/b2X8gVw2yIFMGkiX9WzO2I8lOvtUkKjVGclmVzUHesl1qROMi uxsGqYpJWpSjdakU/B06nIplczCqDKXZ92yevVbeoNxLSa13ncLI+TFY595u8TEVWFZv allcMlzSiJtUFfs1zHgHW75GQu9ntw/w2Os7U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681945026; x=1684537026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I4TtHmnmxTTT3fwHdqQt/qizkftz4ebAquvrklnKCnk=; b=V1eoxMgQZWVUOJTYoiOY7bxA05gY78EB6Q1cJ6T3dbBlgpGYr7z2SMnn7eRlbjXR9F rRZdDLoxhG8mJSRp6GlbKTDzpdUOo5aB7UIfkewcA8MgZMpiOMMqcvt1txcqT1NTahZJ SMvVQ0qFZKf7FLI011rswsJpuBHBR8VFNM5BgCfGcRTBzR1xwpAuscfbOkDNhpGMQezw UCyQA5PzWdSADLX9JThGj7O8WI7TLBkdj2jouypSnUHHulHQ8UseTgj9NfYHRscZLcx5 fDzZum5RBqPD5pQ3lnI44AD4NKIn0tl9xMIW28oeS16NyPkclE0Mv5pRABWX30CkQYoi YPUQ== X-Gm-Message-State: AAQBX9fx5qiICJYs5VhDa4MKFmPkfNDdjrBvDhi3Ogc+ppKFt9sXocds w1Vxl0SvEmIKEglfkq+YVAZByA== X-Google-Smtp-Source: AKy350b31hKFXuPuDEwurP1haUg/kmKABno9CTcx0NTyRaIS7gBQqk+Fl95MtSp5XkH6F/eDr8jp1Q== X-Received: by 2002:a17:90a:72c8:b0:246:9bad:2354 with SMTP id l8-20020a17090a72c800b002469bad2354mr4196693pjk.43.1681945025926; Wed, 19 Apr 2023 15:57:05 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:8b1:fa03:670e:b784]) by smtp.gmail.com with ESMTPSA id h15-20020a17090aea8f00b00246ea338c96sm1847101pjz.53.2023.04.19.15.57.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 15:57:05 -0700 (PDT) From: Douglas Anderson To: Catalin Marinas , Will Deacon , Sumit Garg , Daniel Thompson , Marc Zyngier , Mark Rutland Cc: ito-yuichi@fujitsu.com, kgdb-bugreport@lists.sourceforge.net, Chen-Yu Tsai , Masayoshi Mizuma , Peter Zijlstra , Ard Biesheuvel , "Rafael J . Wysocki" , linux-arm-kernel@lists.infradead.org, Stephen Boyd , Lecopzer Chen , Thomas Gleixner , linux-perf-users@vger.kernel.org, Masayoshi Mizuma , Douglas Anderson , Ben Dooks , Pierre Gondois , linux-kernel@vger.kernel.org Subject: [PATCH v8 03/10] arm64: smp: Assign and setup an IPI as NMI Date: Wed, 19 Apr 2023 15:55:57 -0700 Message-ID: <20230419155341.v8.3.I6d7f7d5fa0aa293c8c3374194947254b93114d37@changeid> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog In-Reply-To: <20230419225604.21204-1-dianders@chromium.org> References: <20230419225604.21204-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230419_155706_686996_A9598F63 X-CRM114-Status: GOOD ( 14.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Sumit Garg 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 Reviewed-by: Masayoshi Mizuma Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson --- Changes in v8: - dynamic_ipi_setup() and dynamic_ipi_teardown() no longer take cpu param 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 4e8327264255..94ff063527c6 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -938,6 +939,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(); } #ifdef CONFIG_HOTPLUG_CPU @@ -950,6 +953,8 @@ static void ipi_teardown(int cpu) for (i = 0; i < nr_ipi; i++) disable_percpu_irq(ipi_irq_base + i); + + dynamic_ipi_teardown(); } #endif @@ -971,6 +976,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 */