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: 85646 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp723647vqo; Wed, 19 Apr 2023 16:13:26 -0700 (PDT) X-Google-Smtp-Source: AKy350ZIj8oO4YFHjyeSnO3S9jCUtQQX4EXR/7FuDsbXeKWYAwZhfG46HbXmivJ4RMfAqH1c8FlY X-Received: by 2002:a05:6a20:3c86:b0:f1:bf92:51d4 with SMTP id b6-20020a056a203c8600b000f1bf9251d4mr211259pzj.45.1681946006358; Wed, 19 Apr 2023 16:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681946006; cv=none; d=google.com; s=arc-20160816; b=YJXbJYULf/sc5mwTzyOyghaq2MEwB96drLX3YgcokPPlQIwWzY68XF8ABkPjYUthSV lnevHHybM715AV1/xWfJHPe+x+Y4dKphadi5XwYGON4CV3tPcSB6ROzC5K8mk6ah4gr3 DYzsD+H/SkuUhQQbi7EzPmmm515TMMO+t/pziRoBsYgS5CatWrerdO1e20QGEbM8IKBT 19YFucVELxi8IT9EVqrBz5p/0BpQIAl2D/8xJaqEJsAJQedvY3OpQDRV05RWD+QC/fC9 mz6h/NdacVJukKIOtmYBsG4+FbslhN8dOdpIOs8VrFZlfFW9XXVgUhwgXouLy2Q611jL HtIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I4TtHmnmxTTT3fwHdqQt/qizkftz4ebAquvrklnKCnk=; b=mDFr9I7gG5gMQ0vwudJQmDdP1oGr8ZkuhQJ5gCqbKOjp2zhcbqcNedx4QwEDeoe+Yy zz4f1iVgokxKHW7aDNjzjsIxNEI6XEABguNDmE7gfZ6BZIJf7ffG6QCcgg3C9kocKlGo q8LDJgHo1UTs0L0TlaEcWySGLqVpI88S53LP2g+I3EC1EZGrIIktl16MHip2tW+QhTpI LMGQKNDGsfjjcC/cgB/QQjwleef//01UvRplCuyG/71CIB0tDo1rRaB0NiJxmx9EKmf1 wqNJvUKRZ+5tLEcT9SkkWRVw7nnt9aI+RxkBuI04UPAG3OcEDl7XS4Fp6WeKeduOuw9g 5Viw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Mhapfz67; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020a63db58000000b0051b6a773204si15164021pgi.374.2023.04.19.16.13.14; Wed, 19 Apr 2023 16:13:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Mhapfz67; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233635AbjDSW5S (ORCPT + 99 others); Wed, 19 Apr 2023 18:57:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233271AbjDSW5I (ORCPT ); Wed, 19 Apr 2023 18:57:08 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A701F113 for ; Wed, 19 Apr 2023 15:57:06 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-52160f75920so239009a12.2 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=QfbhA7Fwadjv+80uJXQNjRBmcRkiOIL0EnBPd3ViJtpTaKjSzr4lpPXeEX0GSsG8bC 0wrij7yS2jbl8uIh5KLDXEmo+jvoJF4xES2tU+tElUeCuOJ5MtRO3k9PrQ0mbShWfWel d4KxS2Q0V6q944+lef4yMuNiHR9jjz0NkiUXZeES/caiZdMnsVyVKe5alNgh7zwSn3fy 0sCuieOLXZ3cM9juLjb0G3cTSiRsu1ynS6zZEex5KRGd4VSUaAhd7wq+FAGVeN/rbOol uxrrLv9iB1Q4Y8kG69h5aRnGxdD7v+8sp5QKsqSUsk9bmm882KsCVNPFNnBo7qr5Eh7Z q2JQ== X-Gm-Message-State: AAQBX9enbaNRfvf0d02It9VP5A7wPjM6wR2UMCzcRjii5CI6nDni9Izj ZK7Q7sc4vXewRlE7zrJ6OW7x8g== 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763648215551085095?= X-GMAIL-MSGID: =?utf-8?q?1763648215551085095?= 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 */