Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2844787rwb; Mon, 7 Aug 2023 04:37:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGn3mBUa6HmOKOZWmjGOSaWp86f/DxtGBmVMvSXIr5+TkmRCVTlM+uNIRnpgC6ZxdPb2f4+ X-Received: by 2002:a17:90b:4ad0:b0:268:18e:9dfa with SMTP id mh16-20020a17090b4ad000b00268018e9dfamr9314777pjb.5.1691408273767; Mon, 07 Aug 2023 04:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691408273; cv=none; d=google.com; s=arc-20160816; b=Cni/Z1GZ8llcQsTQKbqe+ikI+S4DNiiMVVpPUQ8jRS0/HQ+17NDYfrg0CyVAOd0Uk8 8JCOL2lBQ0b6n6Hz9PWD6k0D+hJn2WZGFvF0XuMG2NMXqkRHQdup/hg9y/S4c6aiVjCP aY/R9dLwI/jNtK/YZ2pS1bqqiXA8BMIW8KCLgneGKTUmRP+gbNx53CvAjKC7zxxlweqh ywAG+tGVDwnfhaXO48WNgPDwOMJRiL5ykY/Sr5iMETMkag6DEhKJpGpEAdKjr89+h2IW Aaxoc9eJUtaug3BeVeeEXP6Sm4rwp0TuI2TScMVJabIBcRsGauNa+WqeJQY8CxE58C/Y 6cwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=BSN44Z314FXh5F1aARKvod5eVSF2oyeFMWeobqxHtW4=; fh=SK5Itg49Qd3eAPVC5Fp2XpUHle09ehKRlydxl7jJmLI=; b=f89rC8m38UPTQ1fEfuhMhRQ3NH4H2WbQk4xTSVReIhwVplgYg5/DGQPg+TzWXg4IRT XPfRDNAQPdHgvBTnhY7qEcNb7C0NKv1JFWbjgoX2/tSAc4P1c8dzNSA8KItWAjEpNCFI sl4DI+iN5kISY7Ii7TDhw+Xykt9T4j+XzPBj+PKynAwnO2V3+z4Brp8QQ01PAbIUF5Wp bM/1J1dGRtvNedakCYTHTzHYDBxlmHaAqlQWrP4KHJu9NzM2w5iI3wJb4n4sMRC6F26T eHdtZJWjFoAKyivcc9Xoqyj71L4LSQiWKayuNU5zRMLUo0k8etnUSj6pm/xtXq+l4R77 nrPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bqTc+RgI; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kj16-20020a17090306d000b001b9d5e34e57si5544541plb.415.2023.08.07.04.37.36; Mon, 07 Aug 2023 04:37:53 -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=@kernel.org header.s=k20201202 header.b=bqTc+RgI; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231234AbjHGLI1 (ORCPT + 99 others); Mon, 7 Aug 2023 07:08:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230403AbjHGLI0 (ORCPT ); Mon, 7 Aug 2023 07:08:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1657DB3; Mon, 7 Aug 2023 04:08:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A8D456174C; Mon, 7 Aug 2023 11:08:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC366C433C8; Mon, 7 Aug 2023 11:08:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691406489; bh=hdXUL/3D92Z9yQpqL5wt/vJLONqXakCcF546+DOh+4U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bqTc+RgIYDzXvN/ub1XcWMo75DJ473j6Le/czK/fcaloPVJ0mkaEJJsgVVKkZYoOL p6iSlOJxz1bloA/USJIUET+SyQ3pd049jLEnWIjHZzhQLwLWeBTw1MtQhS0tXGbGqL UF8KYn/EFViz3h/Kp6oa068ofm5bUsgq1QeIUMNen4Q6GmkHMz4A31vQgjgg8Ncyxh Qch7XTyieVT0fX3uZXiWqtP7owdtTa5zZBRBlIg76RJwYy0b5b/ba6AZGYrnfgf+Xd QkuhNkwf2sDNSwcgn2zFoveyBoCF2qNKxtfg3Hz77vsdrDUHWYfdAVv09u2hc618Vq gslGUGqmNFhCQ== Received: from disco-boy.misterjones.org ([217.182.43.188] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qSy5m-002ncO-Bw; Mon, 07 Aug 2023 12:08:06 +0100 MIME-Version: 1.0 Date: Mon, 07 Aug 2023 12:08:06 +0100 From: Marc Zyngier To: Mark Rutland Cc: Douglas Anderson , Catalin Marinas , Will Deacon , Sumit Garg , Daniel Thompson , linux-perf-users@vger.kernel.org, ito-yuichi@fujitsu.com, Chen-Yu Tsai , Ard Biesheuvel , Stephen Boyd , Peter Zijlstra , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, kgdb-bugreport@lists.sourceforge.net, Masayoshi Mizuma , "Rafael J . Wysocki" , Lecopzer Chen , Wei Li , linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 7/7] arm64: kgdb: Roundup cpus using the debug IPI In-Reply-To: References: <20230601213440.2488667-1-dianders@chromium.org> <20230601143109.v9.7.I2ef26d1b3bfbed2d10a281942b0da7d9854de05e@changeid> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <7a295fcb4ff02542ff6835a77182fce8@kernel.org> X-Sender: maz@kernel.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 217.182.43.188 X-SA-Exim-Rcpt-To: mark.rutland@arm.com, dianders@chromium.org, catalin.marinas@arm.com, will@kernel.org, sumit.garg@linaro.org, daniel.thompson@linaro.org, linux-perf-users@vger.kernel.org, ito-yuichi@fujitsu.com, wens@csie.org, ardb@kernel.org, swboyd@chromium.org, peterz@infradead.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, kgdb-bugreport@lists.sourceforge.net, msys.mizuma@gmail.com, rafael.j.wysocki@intel.com, lecopzer.chen@mediatek.com, liwei391@huawei.com, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 On 2023-08-07 11:54, Mark Rutland wrote: > On Mon, Aug 07, 2023 at 11:47:04AM +0100, Marc Zyngier wrote: >> On 2023-08-07 11:28, Mark Rutland wrote: >> > On Thu, Jun 01, 2023 at 02:31:51PM -0700, Douglas Anderson wrote: >> > > From: Sumit Garg >> > > >> > > Let's use the debug IPI for rounding up CPUs in kgdb. When the debug >> > > IPI is backed by an NMI (or pseudo NMI) then this will let us debug >> > > even hard locked CPUs. When the debug IPI isn't backed by an NMI then >> > > this won't really have any huge benefit but it will still work. >> > > >> > > Signed-off-by: Sumit Garg >> > > Signed-off-by: Douglas Anderson >> > > --- >> > > >> > > Changes in v9: >> > > - Remove fallback for when debug IPI isn't available. >> > > - Renamed "NMI IPI" to "debug IPI" since it might not be backed by >> > > NMI. >> > > >> > > arch/arm64/kernel/ipi_debug.c | 5 +++++ >> > > arch/arm64/kernel/kgdb.c | 14 ++++++++++++++ >> > > 2 files changed, 19 insertions(+) >> > >> > This looks fine to me, but I'd feel a bit happier if we had separate >> > SGIs for >> > the backtrace and the KGDB callback as they're logically unrelated. >> >> Well, we're a bit stuck here. >> >> We have exactly *one* spare SGI with GICv3, as we lose 8 of them >> to the secure side. One possibility would be to mux some of the >> lesser used IPIs onto two SGIs (one with standard priority, and >> one with NMI priority). > > Understood; Doug and I suggested two options for that: > > 1) Unify/mux the IPI_CPU_STOP and IPI_CPU_CRASH_STOP IPIs > > The only *intended* difference between the two is that > IPI_CPU_CRASH_STOP > calls crash_save_cpu() before trying to stop the CPU, but the > implementations have diverged significantly for unrelated reasons. > > 2) Remove IPI_WAKEUP > > We only use IPI_WAKEUP for the ACPI parking protocol, and we could > reuse > another IPI (e.g. IPI_RESCHEDULE) to achieve the same thing witout a > dedicated IPI. Sure. My concern is that we're papering over the fundamental problem, which is that IPIs are limited resource, and that we're bound to pile more stuff on them. I'm all for reclaiming the ones that can be merged, but we may ultimately need a real fix for this. M. -- Jazz is not dead. It just smells funny...