OSDN Git Service

hw/arm/virt: Add cpu-map to device tree
authorAndrew Jones <drjones@redhat.com>
Wed, 20 Oct 2021 14:21:20 +0000 (22:21 +0800)
committerRichard Henderson <richard.henderson@linaro.org>
Thu, 21 Oct 2021 01:17:54 +0000 (18:17 -0700)
commit72b0527ff6ab09502e0b320050eb086fc4d61d26
treeb785430e45cdb565daff66f55a5575dae61b2782
parentb863f0b75852dfd62b3f31b08eeddd3b03694fc2
hw/arm/virt: Add cpu-map to device tree

Support device tree CPU topology descriptions.

In accordance with the Devicetree Specification, the Linux Doc
"arm/cpus.yaml" requires that cpus and cpu nodes in the DT are
present. And we have already met the requirement by generating
/cpus/cpu@* nodes for members within ms->smp.cpus. Accordingly,
we should also create subnodes in cpu-map for the present cpus,
each of which relates to an unique cpu node.

The Linux Doc "cpu/cpu-topology.txt" states that the hierarchy
of CPUs in a SMP system is defined through four entities and
they are socket/cluster/core/thread. It is also required that
a socket node's child nodes must be one or more cluster nodes.
Given that currently we are only provided with information of
socket/core/thread, we assume there is one cluster child node
in each socket node when creating cpu-map.

Co-developed-by: Yanan Wang <wangyanan55@huawei.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
Message-Id: <20211020142125.7516-4-wangyanan55@huawei.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
hw/arm/virt.c