Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2228979rwl; Thu, 13 Apr 2023 03:38:31 -0700 (PDT) X-Google-Smtp-Source: AKy350bqfYJBIIxFIc2WD/bKM2oWpD08EKYyXQ2kHLaXAf77aKJnTPto+hc5HqOka+gxQAK20kbW X-Received: by 2002:a05:6a00:18a6:b0:63a:fb40:891a with SMTP id x38-20020a056a0018a600b0063afb40891amr3176866pfh.2.1681382311390; Thu, 13 Apr 2023 03:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681382311; cv=none; d=google.com; s=arc-20160816; b=bmCDEsXyKxnzT44bKia2YPVEwC0cBqIVPqar/aX3ChMBkstA/SkD7Pbve9rbPghJZH Pg1XXpy73LBXKeSLX01w4WjANoWhlf23ewe1Zhn3FSvua8eqqPOznvQAS+HB8wHC8GS4 hVJ0rO0omXRwMwVHE39oR+2g4wb0INJzfdMqlK6WGnMoFXDODXxU83OZjwv9GXhjiNQo l9b5T493+gxw+4K5q2Po9gDq2d+Zd0ih6m1IZPWO8EfZR2nOYauDcJOvSJ6TMajnh0np Jdjvx7QSAAJd2sEuyTAIHKaDthzTB/qwOkWrFbU/Lr3UradEJYXOrAmyGV+/WdunAi+V azVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=joSNvTghmgIEG9qWcoBwi8u0IG2RVSPPSBb0cwN2Yxs=; b=mvQ4zhLX8vaSqOov7AGGI8bqESbETgbodSlV+EIguT5heULix1pwk0YLxEx5NZtJFU CPOnLr+dapENxFEeLzZRX0zE3oMeKyz66KcXVdoUKdxnXTG+pDPrkcu05dyXsyI30/BL oj1VpuE9riiH0hguGRFrVEW8zNDGO1U04GY/zBcw3t9ihqifWKwujIVioJTv8ZqT5xdA wHTRH+STHSaWn+b0zy0zxLwpBZ1Gn236FMAw3S+8rqBMcu5Fl8rqd8Y4trro+ej0YfTw CaydcraIZEXNgE4RZyaJ4FZ5fIK6BTTq2WZhexraaB4Jdz8FeGV6Mr6vKmSkQu2kbJb6 bVdw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a630f46000000b005135d3abc6asi1800191pgp.90.2023.04.13.03.37.56; Thu, 13 Apr 2023 03:38:31 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230271AbjDMKWd (ORCPT + 99 others); Thu, 13 Apr 2023 06:22:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjDMKWc (ORCPT ); Thu, 13 Apr 2023 06:22:32 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4B9ADE8 for ; Thu, 13 Apr 2023 03:22:30 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 82FE2153B; Thu, 13 Apr 2023 03:23:14 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2E3B73F6C4; Thu, 13 Apr 2023 03:22:29 -0700 (PDT) Date: Thu, 13 Apr 2023 11:22:26 +0100 From: Sudeep Holla To: Radu Rendec , Will Deacon Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Pierre Gondois , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 2/3] cacheinfo: Add arm64 early level initializer implementation Message-ID: <20230413102226.yzzd6iccqeamheas@bogus> References: <20230412185759.755408-1-rrendec@redhat.com> <20230412185759.755408-3-rrendec@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230412185759.755408-3-rrendec@redhat.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 Hi Will, On Wed, Apr 12, 2023 at 02:57:58PM -0400, Radu Rendec wrote: > This patch adds an architecture specific early cache level detection > handler for arm64. This is basically the CLIDR_EL1 based detection that > was previously done (only) in init_cache_level(). > > This is part of a patch series that attempts to further the work in > commit 5944ce092b97 ("arch_topology: Build cacheinfo from primary CPU"). > Previously, in the absence of any DT/ACPI cache info, architecture > specific cache detection and info allocation for secondary CPUs would > happen in non-preemptible context during early CPU initialization and > trigger a "BUG: sleeping function called from invalid context" splat on > an RT kernel. > > This patch does not solve the problem completely for RT kernels. It > relies on the assumption that on most systems, the CPUs are symmetrical > and therefore have the same number of cache leaves. The cacheinfo memory > is allocated early (on the primary CPU), relying on the new handler. If > later (when CLIDR_EL1 based detection runs again on the secondary CPU) > the initial assumption proves to be wrong and the CPU has in fact more > leaves, the cacheinfo memory is reallocated, and that still triggers a > splat on an RT kernel. > > In other words, asymmetrical CPU systems *must* still provide cacheinfo > data in DT/ACPI to avoid the splat on RT kernels (unless secondary CPUs > happen to have less leaves than the primary CPU). But symmetrical CPU > systems (the majority) can now get away without the additional DT/ACPI > data and rely on CLIDR_EL1 based detection. > If you are okay with the change, can I have your Acked-by, so that I can route this via Greg's tree ? -- Regards, Sudeep