Received: by 2002:a19:6a18:0:0:0:0:0 with SMTP id u24csp30761lfu; Mon, 4 Apr 2022 01:38:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhtpqVdpaiY2iJy38bdQ9My8f4TB9oq5Wqsdd2VRMWcSx9ScvrU1Rt2xXxTLpsjTpErVw4 X-Received: by 2002:ac8:5f0d:0:b0:2e1:ee49:36c1 with SMTP id x13-20020ac85f0d000000b002e1ee4936c1mr16574686qta.589.1649061481305; Mon, 04 Apr 2022 01:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649061481; cv=none; d=google.com; s=arc-20160816; b=pNJsNiqFDMxsVHfmD6Ht+1dV3+fSS4Ft6RCFX4KAiuwl28iKaN1NSpQajWUWugKBa8 X0tN0NVcKdYIPbv5UxS76YeiCgU1e6avT2bylYNVJEDpPRf3SLvmulW/3U4WKNyxJ0kY W2maXW109owgyyejegqunOlimRhqcHFRBq5NC+kDqltsTqNWZsJypAHDT2LESaYFnGfd SFynE5OaYUXtNq4P20Vo9olvI8urbrkMWxX7VQgDbOH++IIQIeE4yUzK19KhvzIsmEJU nJo/Z607aPGZ+93c2IQ4Bf8ipgaDezxvcGycBvR8C6GrscSIE0jl+7SUn9hYih2lo+Qc sjvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:user-agent:in-reply-to:mime-version:references :message-id:subject:to:from:date:dkim-signature; bh=Xx2Wy6O0aYPQc7DLC8PHO3NTb6/z7sfgmtqvOWkqdQ8=; b=N3xKnCUSh/A8VRpgAe26umTJKBQB7UAhHlKFsmxpBAE+VoidpLbKXu1oozAWAwTTcc TGWgApMtunLfz1E4Yh9s83kCkfPvCInJ4l9H1AlExhEkiWv08vyPjW2l+B87qh8GTw6j kHX8pdTaxm1aDJbhNCAVfFCPQadlVlUVN/c5kQCOlEV/6dLsv8SjzSnYP1vXVg15U+G5 JNzf9m8/pECb5nEBUrJr8rNwC3/6BdTi+3dk0301r0yTYLnUvtYJVr6mfa4lmjCNLbSl SVKmE13Jv0nEJKV6Xf+IgLtJIkOKCmOhYxF61bZEg5b+ASinvbCpmsd/cqYMHMBGq3XG DJaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=BHcrG50w; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y8-20020ac87088000000b002e1fbf3c04esi2698933qto.575.2022.04.04.01.38.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Apr 2022 01:38:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=BHcrG50w; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:53688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbIDo-00041B-P8 for alex.bennee@linaro.org; Mon, 04 Apr 2022 04:38:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbIDN-000400-Lf for qemu-arm@nongnu.org; Mon, 04 Apr 2022 04:37:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24785) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbIDH-0008W1-3o for qemu-arm@nongnu.org; Mon, 04 Apr 2022 04:37:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649061446; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=Xx2Wy6O0aYPQc7DLC8PHO3NTb6/z7sfgmtqvOWkqdQ8=; b=BHcrG50wSEZ9nhtMSwjB+m0Nigm8ADAd1qnv/8AYqgiqQ6z88WG/XlAt1BvF1a2Xiannro ammC9bIbS7ZtzqqcDE14uGDFjcheeg5fdWSMNxtX1Pfrncpu6hbms3pfm+HthrbuSqu9Iu ecvTN/IpFqvgjsnc03PchfNxtJQVOKk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-669-jngQAXLDO72Qx4HxsQtbyw-1; Mon, 04 Apr 2022 04:37:23 -0400 X-MC-Unique: jngQAXLDO72Qx4HxsQtbyw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 378E8833961; Mon, 4 Apr 2022 08:37:22 +0000 (UTC) Received: from redhat.com (unknown [10.33.36.158]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1F4B5361C3; Mon, 4 Apr 2022 08:37:15 +0000 (UTC) Date: Mon, 4 Apr 2022 09:37:10 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Gavin Shan Subject: Re: [PATCH v5 1/4] qapi/machine.json: Add cluster-id Message-ID: References: <20220403145953.10522-1-gshan@redhat.com> <20220403145953.10522-2-gshan@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220403145953.10522-2-gshan@redhat.com> User-Agent: Mutt/2.1.5 (2021-12-30) X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=berrange@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Cc: peter.maydell@linaro.org, drjones@redhat.com, richard.henderson@linaro.org, qemu-devel@nongnu.org, zhenyzha@redhat.com, wangyanan55@huawei.com, qemu-arm@nongnu.org, shan.gavin@gmail.com, imammedo@redhat.com Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: 3jlT3pwleZ04 On Sun, Apr 03, 2022 at 10:59:50PM +0800, Gavin Shan wrote: > This adds cluster-id in CPU instance properties, which will be used > by arm/virt machine. Besides, the cluster-id is also verified or > dumped in various spots: > > * hw/core/machine.c::machine_set_cpu_numa_node() to associate > CPU with its NUMA node. > > * hw/core/machine.c::machine_numa_finish_cpu_init() to associate > CPU with NUMA node when no default association isn't provided. > > * hw/core/machine-hmp-cmds.c::hmp_hotpluggable_cpus() to dump > cluster-id. > > Signed-off-by: Gavin Shan > --- > hw/core/machine-hmp-cmds.c | 4 ++++ > hw/core/machine.c | 16 ++++++++++++++++ > qapi/machine.json | 6 ++++-- > 3 files changed, 24 insertions(+), 2 deletions(-) Missing changes to hw/core/machine-smp.c similar to 'dies' in that file. When 'dies' was added we added a 'dies_supported' flag, so we could reject use of 'dies' when it was not supported - which is everywhere except i386 target. We need the same for 'clusters_supported' machine property since AFAICT only the arm 'virt' machine is getting supported in this series. > > diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c > index 4e2f319aeb..5cb5eecbfc 100644 > --- a/hw/core/machine-hmp-cmds.c > +++ b/hw/core/machine-hmp-cmds.c > @@ -77,6 +77,10 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict) > if (c->has_die_id) { > monitor_printf(mon, " die-id: \"%" PRIu64 "\"\n", c->die_id); > } > + if (c->has_cluster_id) { > + monitor_printf(mon, " cluster-id: \"%" PRIu64 "\"\n", > + c->cluster_id); > + } > if (c->has_core_id) { > monitor_printf(mon, " core-id: \"%" PRIu64 "\"\n", c->core_id); > } > diff --git a/hw/core/machine.c b/hw/core/machine.c > index d856485cb4..8748b64657 100644 > --- a/hw/core/machine.c > +++ b/hw/core/machine.c > @@ -677,6 +677,11 @@ void machine_set_cpu_numa_node(MachineState *machine, > return; > } > > + if (props->has_cluster_id && !slot->props.has_cluster_id) { > + error_setg(errp, "cluster-id is not supported"); > + return; > + } > + > if (props->has_socket_id && !slot->props.has_socket_id) { > error_setg(errp, "socket-id is not supported"); > return; > @@ -696,6 +701,11 @@ void machine_set_cpu_numa_node(MachineState *machine, > continue; > } > > + if (props->has_cluster_id && > + props->cluster_id != slot->props.cluster_id) { > + continue; > + } > + > if (props->has_die_id && props->die_id != slot->props.die_id) { > continue; > } > @@ -990,6 +1000,12 @@ static char *cpu_slot_to_string(const CPUArchId *cpu) > } > g_string_append_printf(s, "die-id: %"PRId64, cpu->props.die_id); > } > + if (cpu->props.has_cluster_id) { > + if (s->len) { > + g_string_append_printf(s, ", "); > + } > + g_string_append_printf(s, "cluster-id: %"PRId64, cpu->props.cluster_id); > + } > if (cpu->props.has_core_id) { > if (s->len) { > g_string_append_printf(s, ", "); > diff --git a/qapi/machine.json b/qapi/machine.json > index 9c460ec450..ea22b574b0 100644 > --- a/qapi/machine.json > +++ b/qapi/machine.json > @@ -868,10 +868,11 @@ > # @node-id: NUMA node ID the CPU belongs to > # @socket-id: socket number within node/board the CPU belongs to > # @die-id: die number within socket the CPU belongs to (since 4.1) > -# @core-id: core number within die the CPU belongs to > +# @cluster-id: cluster number within die the CPU belongs to > +# @core-id: core number within cluster/die the CPU belongs to > # @thread-id: thread number within core the CPU belongs to > # > -# Note: currently there are 5 properties that could be present > +# Note: currently there are 6 properties that could be present > # but management should be prepared to pass through other > # properties with device_add command to allow for future > # interface extension. This also requires the filed names to be kept in > @@ -883,6 +884,7 @@ > 'data': { '*node-id': 'int', > '*socket-id': 'int', > '*die-id': 'int', > + '*cluster-id': 'int', > '*core-id': 'int', > '*thread-id': 'int' > } > -- > 2.23.0 > > With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|