From nobody Sat Feb 7 07:41:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1640683645; cv=none; d=zohomail.com; s=zohoarc; b=MZoCZfnaf93LxOaZ7RXyzjOWeyFcUDmuJ96Nlf1Fu2VbCnmLrgudwjIP8PEAPlLltvxV9Q3rZ++3ErXp6ejBWay/NDibYMtTKDRyRmg/iz7MP7bTqMfNsrXgDDu/PppX27CqGXPTjsHDIf9h9XnrAp4oqSsXcNv5qlKRn3WJL5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640683645; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=FXYiiXD5ERzmHZVnk8OaIEFOH1pIB5aphae5eBBBpCE=; b=nfl3KNoQeY5TuqSZMNnLOrWTNNXqzp4LE2sAHaV+VWSPbLO4EC0GmH/SN2b+Q6MnuS4Tg2MUiu2RA3Wj+bJeTyfq61w5BKTFI31xGAMWbaVJ7wrDgrYvuOyxOPkiE7yIPelTG5L7JS/t/lZmT9nuPGB+9/SRSUROheJs0PqZKJc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1640683645870340.70586179831867; Tue, 28 Dec 2021 01:27:25 -0800 (PST) Received: from localhost ([::1]:49194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n28lR-0007rf-2b for importer@patchew.org; Tue, 28 Dec 2021 04:27:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n28h7-0007y2-Vr; Tue, 28 Dec 2021 04:22:58 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:3061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n28h5-0007BC-Tx; Tue, 28 Dec 2021 04:22:57 -0500 Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4JNTZm46Y7zQj8F; Tue, 28 Dec 2021 17:22:24 +0800 (CST) Received: from DESKTOP-TMVL5KK.china.huawei.com (10.174.187.128) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 28 Dec 2021 17:22:51 +0800 To: , CC: Peter Maydell , Andrew Jones , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Paolo Bonzini , "Michael S . Tsirkin" , Igor Mammedov , Shannon Zhao , Ani Sinha , Markus Armbruster , Eric Blake , , Yanan Wang Subject: [PATCH v5 09/14] hw/arm/virt: Support cluster level in DT cpu-map Date: Tue, 28 Dec 2021 17:22:16 +0800 Message-ID: <20211228092221.21068-10-wangyanan55@huawei.com> X-Mailer: git-send-email 2.8.4.windows.1 In-Reply-To: <20211228092221.21068-1-wangyanan55@huawei.com> References: <20211228092221.21068-1-wangyanan55@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.187.128] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500023.china.huawei.com (7.185.36.83) X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.188; envelope-from=wangyanan55@huawei.com; helo=szxga02-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reply-to: Yanan Wang From: Yanan Wang via X-ZM-MESSAGEID: 1640683647817000001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Support one cluster level between core and physical package in the cpu-map of Arm/virt devicetree. This is also consistent with Linux Doc "Documentation/devicetree/bindings/cpu/cpu-topology.txt". Signed-off-by: Yanan Wang --- hw/arm/virt.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index f413e146d9..fc5eea8c8c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -430,9 +430,8 @@ static void fdt_add_cpu_nodes(const VirtMachineState *v= ms) * can contain several layers of clustering within a single physic= al * package and cluster nodes can be contained in parent cluster no= des. * - * Given that cluster is not yet supported in the vCPU topology, - * we currently generate one cluster node within each socket node - * by default. + * Note: currently we only support one layer of clustering within + * each physical package. */ qemu_fdt_add_subnode(ms->fdt, "/cpus/cpu-map"); =20 @@ -442,14 +441,16 @@ static void fdt_add_cpu_nodes(const VirtMachineState = *vms) =20 if (ms->smp.threads > 1) { map_path =3D g_strdup_printf( - "/cpus/cpu-map/socket%d/cluster0/core%d/thread%d", - cpu / (ms->smp.cores * ms->smp.threads), + "/cpus/cpu-map/socket%d/cluster%d/core%d/thread%d", + cpu / (ms->smp.clusters * ms->smp.cores * ms->smp.thre= ads), + (cpu / (ms->smp.cores * ms->smp.threads)) % ms->smp.cl= usters, (cpu / ms->smp.threads) % ms->smp.cores, cpu % ms->smp.threads); } else { map_path =3D g_strdup_printf( - "/cpus/cpu-map/socket%d/cluster0/core%d", - cpu / ms->smp.cores, + "/cpus/cpu-map/socket%d/cluster%d/core%d", + cpu / (ms->smp.clusters * ms->smp.cores), + (cpu / ms->smp.cores) % ms->smp.clusters, cpu % ms->smp.cores); } qemu_fdt_add_path(ms->fdt, map_path); --=20 2.27.0