tests/unit/test-smp-parse: Test the full 7-levels topology hierarchy
commitef88e1e875289aaa5e6645fc0038fa1c82b750e2
authorZhao Liu <zhao1.liu@intel.com>
Fri, 8 Mar 2024 16:01:46 +0000 (9 00:01 +0800)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Sat, 9 Mar 2024 18:17:01 +0000 (9 19:17 +0100)
tree7df9804c66c6136d8bc435b41a69ebdebce3790b
parent3f90fb089eb0cb02bd40257c5176f2ad0874e02b
tests/unit/test-smp-parse: Test the full 7-levels topology hierarchy

Currently, -smp supports up to 7-levels topology hierarchy:
  -drawers/books/sockets/dies/clusters/cores/threads.

Though no machine supports all these 7 levels yet, these 7 levels have
the strict containment relationship and together form the generic CPU
topology representation of QEMU.

Also, note that the maxcpus is calculated by multiplying all 7 levels:

  maxcpus = drawers * books * sockets * dies * clusters *
            cores * threads.

To cover this code path, it is necessary to test the full topology case
(with all 7 levels). This also helps to avoid introducing new issues by
further expanding the CPU topology in the future.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Tested-by: Xiaoling Song <xiaoling.song@intel.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20240308160148.3130837-12-zhao1.liu@linux.intel.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
tests/unit/test-smp-parse.c