From patchwork Thu Jul 7 22:04:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12910290 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 D4CF7C433EF for ; Thu, 7 Jul 2022 22:06:22 +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: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:In-Reply-To:References: List-Owner; bh=Wk9L9ANzlGwzHC8MfJFp18g15BL/g3LVhlNW38nf3hM=; b=1JJuQ3UhNF4zI/ se8XH44Jc48+7BqyycMsAfgvVwXlIAAcyAiQMlLz6rGy5IZC9BXnohvo3LT59pmdubyPv+yldLYSk Yp+CBRDXraYxftBYNIHDntZflMJ/+OGmuy5ZbXF7XQXJutIbtj4yLdxHSEj83ixlB/lzas4rUKbWH IkQOgCXhf0JHnqWA6keYeg9Tt2IDy3NQoec6fsGHdJZFegq9vAjIq8XQDCbk9+47V/Bk71MZe0PHg LSkyB+Lncv8U+h2WUHKBuj0G5ceXilLb2k2aiKf85UXj5f43QJiw/yG8OwzoF3dhKgUCZtgkxDH2S RgTdj3C78UPVa+p+9Xkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9ZcO-000Rkz-Ew; Thu, 07 Jul 2022 22:05:04 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9ZcK-000RgX-Es for linux-arm-kernel@lists.infradead.org; Thu, 07 Jul 2022 22:05:02 +0000 Received: by mail-wm1-x32b.google.com with SMTP id l40-20020a05600c1d2800b003a18adff308so72629wms.5 for ; Thu, 07 Jul 2022 15:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7wEvKldrbzSpzvzf7cF/tBIG4OcicbyZqv1HMnAM6uU=; b=I1/2ncRqvqMJy+BGVzbQhxi6htaIzb4VhybmgmPLzthBnhtOWa1dhgLto1BEsgTICP AhL5XT89aMYm1DAtXKmKWwE9NBPz1eY4PLcSWiH2q0mJJAmuFjZlwEEz9Y43xPBsUINp sR7ZWsa5kDlUPQNe4RjdPPWrjh/FqAF0bf0ektOZ3IjdibERqs9szNiKFFiqJ3qUHKuO 9YOIl2Rih4qq0W54K/de/mjzekiUFVRWxhN7ISo2MUFJ3Dq9O3BVE9S7FZogDMX/4iUB SnhQaaxBQuBfbaRfIgreoD3oo3bWKSwL0QYZC+iRtn9RlCZni3w7odpZ4TwEHyEKzB17 7mjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7wEvKldrbzSpzvzf7cF/tBIG4OcicbyZqv1HMnAM6uU=; b=BUwA8maZwUS/gQRy3Mu1e5MzU5iE6YvJOvbe7SHJsA3gHInzsCswh7zR8vdwGwmS6b VCEtYu/C6y3UhUm0Mtp14u3dVF5FYMxxy6+4JIE8oqmh6QMbdf1ksylSWv2Rs+dVbpU8 WRvDYdfftaQvnAlfszAftntCJG82XUOlgBNCIfDHAwpF7QjrCVTpoo+aCG2h33AE3wzY BtHnltBKVLUZVuoTY1po3Go7wXOV05MSGm82HGiyImAv7eUyNXxOoACDtR+6moRBT52l 6L/b6QPw4HYxPEr1JIxFDAAsLROd8eIxhR8Ic8s+mswjxhl5bQyorcTbsRaqkmBVJcjV G8ug== X-Gm-Message-State: AJIora+ZLXq7J8kjpJ89dfLKAeTSIOSQ+ErNH4+XSd+mOsbOf7zzvXyI 2QiYMcwj2xkPpoCSPC/+dQa9cA== X-Google-Smtp-Source: AGRyM1stTlaaZ8PDLMgVyLk3b3v8YtrUwDb/ZvBcVWXgdsJfv7RfAopcWzGfUfqfzcky8NyVUR+nfA== X-Received: by 2002:a05:600c:1d03:b0:3a1:7ab1:8dc6 with SMTP id l3-20020a05600c1d0300b003a17ab18dc6mr6641236wms.103.1657231496073; Thu, 07 Jul 2022 15:04:56 -0700 (PDT) Received: from henark71.. ([51.37.234.167]) by smtp.gmail.com with ESMTPSA id bn24-20020a056000061800b0020fe35aec4bsm38625743wrb.70.2022.07.07.15.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 15:04:55 -0700 (PDT) From: Conor Dooley To: Paul Walmsley , Palmer Dabbelt , Palmer Dabbelt , Albert Ou , Sudeep Holla , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , "Rafael J . Wysocki" Cc: Daire McNamara , Conor Dooley , Niklas Cassel , Damien Le Moal , Geert Uytterhoeven , Zong Li , Emil Renner Berthing , Jonas Hahnfeld , Guo Ren , Anup Patel , Atish Patra , Changbin Du , Heiko Stuebner , Philipp Tomsich , Rob Herring , Marc Zyngier , Viresh Kumar , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Brice Goglin Subject: [PATCH/RFC 0/4] Fix RISC-V's arch-topology reporting Date: Thu, 7 Jul 2022 23:04:33 +0100 Message-Id: <20220707220436.4105443-1-mail@conchuod.ie> X-Mailer: git-send-email 2.37.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220707_150500_584783_EE63D8F1 X-CRM114-Status: GOOD ( 17.09 ) 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: Conor Dooley Hey all, It's my first time messing around with arch/ code at all, let alone more than one arch, so forgive me if I have screwed up how to do a migration like this. The goal here is the fix the incorrectly reported arch topology on RISC-V which seems to have been broken since it was added. cpu, package and thread IDs are all currently reported as -1, so tools like lstopo think systems have multiple threads on the same core when this is not true: https://github.com/open-mpi/hwloc/issues/536 Because I want to backport that fix, I implemented store_cpu_topology for RISC-V before migrating to the generic version which seems to have just complicated things, but was Sudeep's preferred way of doing it. Palmer, I have not marked the first patch as RFC because I would like it to be taken as a fix for 5.19-rc(late) independently of the rest if possible. The rest of the series is RFC b/c I don't know what I am doing ;) I only built tested for arm64, so hopefully it is not broken when used. Thanks, Conor. Conor Dooley (4): riscv: arch-topology: fix default topology reporting arch-topology: add a default implementation of store_cpu_topology() riscv: arch-topology: move riscv to the generic store_cpu_topology() arm64: arch-topology move arm64 to the generic store_cpu_topology() arch/arm64/kernel/smp.c | 16 ++++++++++++-- arch/arm64/kernel/topology.c | 40 ----------------------------------- arch/riscv/Kconfig | 2 +- arch/riscv/kernel/smpboot.c | 4 +++- drivers/base/arch_topology.c | 19 +++++++++++++++++ include/linux/arch_topology.h | 1 + 6 files changed, 38 insertions(+), 44 deletions(-) base-commit: b6f1f2fa2bddd69ff46a190b8120bd440fd50563