[PATCH] i386/cpu: Don't emulate L3 cache on 8000_001D if l3-cache is disabled

2023-05-31 Thread Yanan Wang via
f4202fb108 ("i386: Populate AMD Processor Cache Information for cpuid 0x801D") Signed-off-by: Yanan Wang --- target/i386/cpu.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 1242bd541a..17c367c5ba 100644 --- a/tar

[PATCH] softmmu/device_tree: Remove redundant pointer assignment

2022-01-10 Thread Yanan Wang via
The pointer assignment "const char *p = path;" in function qemu_fdt_add_path is unnecessary. Let's remove it and just use the "path" passed in. No functional change. Suggested-by: Richard Henderson Signed-off-by: Yanan Wang --- Based on: softmmu/device_tree: Sile

[PATCH v7 3/6] hw/acpi/aml-build: Improve scalability of PPTT generation

2022-01-07 Thread Yanan Wang via
Use g_queue APIs to reduce the nested loops and code indentation with the processor hierarchy levels increasing. Consenquently, it's more scalable to add new topology level to build_pptt. No functional change intended. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones --- hw/acp

[PATCH v7 4/6] tests/acpi/bios-tables-test: Allow changes to virt/PPTT file

2022-01-07 Thread Yanan Wang via
List test/data/acpi/virt/PPTT as the expected files allowed to be changed in tests/qtest/bios-tables-test-allowed-diff.h Signed-off-by: Yanan Wang Acked-by: Ani Sinha --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables

[PATCH v7 6/6] tests/acpi/bios-table-test: Update expected virt/PPTT file

2022-01-07 Thread Yanan Wang via
-0040: 24 00 00 00 00 00 00 00 00 00 00 00 // $... +0030: 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // +0040: 24 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 // $... +0050: 0A 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 /

[PATCH v7 1/6] hw/arm/virt: Support CPU cluster on ARM virt machine

2022-01-07 Thread Yanan Wang via
scheduling performance improvement from cache affinity of CPU cluster. So let's enable the support for this new parameter on ARM virt machines. After this patch, we can define a 4-level CPU hierarchy like: cpus=*,maxcpus=*,sockets=*,clusters=*, cores=*,threads=*. Signed-off-by: Yanan

[PATCH v7 5/6] hw/acpi/aml-build: Support cluster level in PPTT generation

2022-01-07 Thread Yanan Wang via
Support CPU cluster topology level in generation of ACPI Processor Properties Topology Table (PPTT). Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones --- hw/acpi/aml-build.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c

[PATCH v7 2/6] hw/arm/virt: Support cluster level in DT cpu-map

2022-01-07 Thread Yanan Wang via
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 Reviewed-by: Andrew Jones --- hw/arm/virt.c | 15 -

[PATCH v7 0/6] ARM virt: Support CPU cluster topology

2022-01-07 Thread Yanan Wang via
part which is in upstream now - rebased on latest master - v5: https://patchew.org/QEMU/20211228092221.21068-1-wangyana...@huawei.com/ Yanan Wang (6): hw/arm/virt: Support CPU cluster on ARM virt machine hw/arm/virt: Support cluster level in DT cpu-map hw/acpi/aml-build: Improve scalability of

[PATCH v6 6/7] hw/arm/virt-acpi-build: Support cluster level in PPTT generation

2022-01-03 Thread Yanan Wang via
Support cluster level in generation of ACPI Processor Properties Topology Table (PPTT) for ARM virt machines. Signed-off-by: Yanan Wang --- hw/arm/virt-acpi-build.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index

[PATCH v6 5/7] tests/acpi/bios-tables-test: Allow changes to virt/PPTT file

2022-01-03 Thread Yanan Wang via
List test/data/acpi/virt/PPTT as the expected files allowed to be changed in tests/qtest/bios-tables-test-allowed-diff.h Signed-off-by: Yanan Wang --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b

[PATCH v6 7/7] tests/acpi/bios-table-test: Update expected virt/PPTT file

2022-01-03 Thread Yanan Wang via
0 00 00 00 00 00 00 00 00 00 00 14 00 00 // $... +0050: 0A 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 // ....8... Signed-off-by: Yanan Wang --- tests/data/acpi/virt/PPTT | Bin 76 -> 96 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-

[PATCH v6 2/7] hw/arm/virt: Support cluster level in DT cpu-map

2022-01-03 Thread Yanan Wang via
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

[PATCH v6 3/7] hw/acpi/aml-build: Improve scalability of PPTT generation

2022-01-03 Thread Yanan Wang via
of build_pptt by reducing the loops, and intends to make no functional change. Signed-off-by: Yanan Wang --- hw/acpi/aml-build.c | 50 + 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index

[PATCH v6 0/7] ARM virt: Support CPU cluster topology

2022-01-03 Thread Yanan Wang via
el through ACPI PPTT and DT cpu-map. Changelog: v5->v6: - drop the generic part which is in upstream now - rebased on latest master - v5: https://patchew.org/QEMU/20211228092221.21068-1-wangyana...@huawei.com/ Yanan Wang (7): hw/arm/virt: Support CPU cluster on ARM virt machine hw/arm/

[PATCH v6 4/7] hw/arm/virt-acpi-build: Make an ARM specific PPTT generator

2022-01-03 Thread Yanan Wang via
ently only used by ARM, let's just move build_pptt() from aml-build.c to virt-acpi-build.c with minor update. Signed-off-by: Yanan Wang --- hw/acpi/aml-build.c | 80 ++--- hw/arm/virt-acpi-build.c| 77 ++- include/hw/a

[PATCH v6 1/7] hw/arm/virt: Support CPU cluster on ARM virt machine

2022-01-03 Thread Yanan Wang via
scheduling performance improvement from cache affinity of CPU cluster. So let's enable the support for this new parameter on ARM virt machines. After this patch, we can define a 4-level CPU hierarchy like: cpus=*,maxcpus=*,sockets=*,clusters=*, cores=*,threads=*. Signed-off-by: Yanan Wang --

[PATCH v5 12/14] tests/acpi/bios-tables-test: Allow changes to virt/PPTT file

2021-12-28 Thread Yanan Wang via
List test/data/acpi/virt/PPTT as the expected files allowed to be changed in tests/qtest/bios-tables-test-allowed-diff.h Signed-off-by: Yanan Wang --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b

[PATCH v5 14/14] tests/acpi/bios-table-test: Update expected virt/PPTT file

2021-12-28 Thread Yanan Wang via
0 00 00 00 00 00 00 00 00 00 00 14 00 00 // $... +0050: 0A 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 // ....8... Signed-off-by: Yanan Wang --- tests/data/acpi/virt/PPTT | Bin 76 -> 96 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-

[PATCH v5 13/14] hw/arm/virt-acpi-build: Support cluster level in PPTT generation

2021-12-28 Thread Yanan Wang via
Support cluster level in generation of ACPI Processor Properties Topology Table (PPTT) for ARM virt machines. Signed-off-by: Yanan Wang --- hw/arm/virt-acpi-build.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index

[PATCH v5 11/14] hw/arm/virt-acpi-build: Make an ARM specific PPTT generator

2021-12-28 Thread Yanan Wang via
ently only used by ARM, let's just move build_pptt() from aml-build.c to virt-acpi-build.c with minor update. Signed-off-by: Yanan Wang --- hw/acpi/aml-build.c | 80 ++--- hw/arm/virt-acpi-build.c| 77 ++- include/hw/a

[PATCH v5 08/14] hw/arm/virt: Support clusters on ARM virt machines

2021-12-28 Thread Yanan Wang via
upport this new parameter on ARM virt machines. After this, we can define a 4-level CPU topology hierarchy like: cpus=*,maxcpus=*,sockets=*,clusters=*,cores=*,threads=*. Signed-off-by: Yanan Wang --- hw/arm/virt.c | 1 + qemu-options.hx | 10 ++ 2 files changed, 11 insertions(+) diff

[PATCH v5 10/14] hw/acpi/aml-build: Improve scalability of PPTT generation

2021-12-28 Thread Yanan Wang via
of build_pptt by reducing the loops, and intends to make no functional change. Signed-off-by: Yanan Wang --- hw/acpi/aml-build.c | 50 + 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index

[PATCH v5 05/14] tests/unit/test-smp-parse: No need to explicitly zero MachineClass members

2021-12-28 Thread Yanan Wang via
The default value of the MachineClass members is 0, which means we don't have to explicitly zero them. Also the value of "mc->smp_props.prefer_sockets" will be taken care of by smp_parse_test(), we don't necessarily need the statement in machine_base_class_init() either. Si

[PATCH v5 07/14] MAINTAINERS: Self-recommended as reviewer of "Machine core"

2021-12-28 Thread Yanan Wang via
I've built interests in the generic machine subsystem and have also been working on projects related to this part, self-recommand myself as a reviewer so that I can help to review some patches familiar to me, and have a chance to learn more continuously. Signed-off-by: Yanan

[PATCH v5 09/14] hw/arm/virt: Support cluster level in DT cpu-map

2021-12-28 Thread Yanan Wang via
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

[PATCH v5 06/14] tests/unit/test-smp-parse: Keep default MIN/MAX CPUs in machine_base_class_init

2021-12-28 Thread Yanan Wang via
zation function. Signed-off-by: Yanan Wang --- tests/unit/test-smp-parse.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 72d83d1bbc..fdc39a846c 100644 --- a/tests/unit/test-smp-parse.c +++ b/test

[PATCH v5 03/14] hw/core/machine: Wrap target specific parameters together

2021-12-28 Thread Yanan Wang via
Wrap the CPU target specific parameters together into a single variable except generic sockets/cores/threads, to make related code lines shorter and more concise. No functional change intended. Signed-off-by: Yanan Wang --- hw/core/machine-smp.c | 17 ++--- 1 file changed, 10

[PATCH v5 01/14] qemu-options: Improve readability of SMP related Docs

2021-12-28 Thread Yanan Wang via
all the sub-hierarchies currently supported in QEMU, and correspondingly give an example of -smp configuration for each of them. Signed-off-by: Yanan Wang --- qemu-options.hx | 76 ++--- 1 file changed, 59 insertions(+), 17 deletions(-) dif

[PATCH v5 04/14] tests/unit/test-smp-parse: Add testcases for CPU clusters

2021-12-28 Thread Yanan Wang via
Add testcases for parsing of the four-level CPU topology hierarchy, ie sockets/clusters/cores/threads, which will be supported on ARM virt machines. Signed-off-by: Yanan Wang --- tests/unit/test-smp-parse.c | 130 ++-- 1 file changed, 123 insertions(+), 7

[PATCH v5 02/14] hw/core/machine: Introduce CPU cluster topology support

2021-12-28 Thread Yanan Wang via
ned-off-by: Yanan Wang --- hw/core/machine-smp.c | 26 +++--- hw/core/machine.c | 3 +++ include/hw/boards.h | 6 +- qapi/machine.json | 5 - qemu-options.hx | 7 --- softmmu/vl.c | 3 +++ 6 files changed, 38 insertions(+), 12 deletion

[PATCH v5 00/14] ARM virt: Introduce CPU clusters topology support

2021-12-28 Thread Yanan Wang via
1121122502.9844-1-wangyana...@huawei.com/ Yanan Wang (14): qemu-options: Improve readability of SMP related Docs hw/core/machine: Introduce CPU cluster topology support hw/core/machine: Wrap target specific parameters together tests/unit/test-smp-parse: Add testcases for CPU clusters tests/unit/

[PATCH for-6.2] qapi/machine.json: Fix incorrect description for die-id

2021-11-21 Thread Yanan Wang via
In terms of scope, die-id should mean "the die number within socket the CPU belongs to" instead of "the die number within node/board the CPU belongs to". Fix it to avoid confusing the Doc reader. Fixes: 176d2cda0d ("i386/cpu: Consolidate die-id validity in smp context&qu

[PATCH v4 06/10] hw/acpi/aml-build: Improve scalability of PPTT generation

2021-11-21 Thread Yanan Wang via
of build_pptt by reducing the loops, and intends to make no functional change. Signed-off-by: Yanan Wang --- hw/acpi/aml-build.c | 50 + 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index

[PATCH v4 07/10] hw/arm/virt-acpi-build: Make an ARM specific PPTT generator

2021-11-21 Thread Yanan Wang via
ently only used by ARM, let's just move build_pptt() from aml-build.c to virt-acpi-build.c with minor update. Signed-off-by: Yanan Wang --- hw/acpi/aml-build.c | 80 ++--- hw/arm/virt-acpi-build.c| 77 ++- include/hw/a

[PATCH v4 08/10] tests/acpi/bios-tables-test: Allow changes to virt/PPTT file

2021-11-21 Thread Yanan Wang via
List test/data/acpi/virt/PPTT as the expected files allowed to be changed in tests/qtest/bios-tables-test-allowed-diff.h Signed-off-by: Yanan Wang --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b

[PATCH v4 01/10] qemu-options: Improve readability of SMP related Docs

2021-11-21 Thread Yanan Wang via
all the sub-hierarchies currently supported in QEMU, and correspondingly give an example of -smp configuration for each of them. Signed-off-by: Yanan Wang --- qemu-options.hx | 76 ++--- 1 file changed, 59 insertions(+), 17 deletions(-) dif

[PATCH v4 10/10] tests/acpi/bios-table-test: Update expected virt/PPTT file

2021-11-21 Thread Yanan Wang via
0 00 00 00 00 00 00 00 00 00 00 14 00 00 // $... +0050: 0A 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 // ....8... Signed-off-by: Yanan Wang --- tests/data/acpi/virt/PPTT | Bin 76 -> 96 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-

[PATCH v4 03/10] hw/core/machine: Wrap target specific parameters together

2021-11-21 Thread Yanan Wang via
Wrap the CPU target specific parameters together into a single variable, so that we don't need to update the other lines but a single line when new topology parameters are introduced. No functional change intended. Signed-off-by: Yanan Wang --- hw/core/machine-smp.c | 17 ++-

[PATCH v4 02/10] hw/core/machine: Introduce CPU cluster topology support

2021-11-21 Thread Yanan Wang via
ned-off-by: Yanan Wang --- hw/core/machine-smp.c | 26 +++--- hw/core/machine.c | 3 +++ include/hw/boards.h | 6 +- qapi/machine.json | 5 - qemu-options.hx | 7 --- softmmu/vl.c | 3 +++ 6 files changed, 38 insertions(+), 12 deletion

[PATCH v4 00/10] ARM virt: Introduce CPU clusters topology support

2021-11-21 Thread Yanan Wang via
PTT and DT cpu-map. Changelog: v3->v4: - Significant change from v3 to v4, since the whole series is reworked based on latest QEMU SMP frame. - v3: https://lore.kernel.org/qemu-devel/20210516103228.37792-1-wangyana...@huawei.com/ Yanan Wang (10): qemu-options: Improve readability of SMP rela

[PATCH v4 05/10] hw/arm/virt: Support cluster level in DT cpu-map

2021-11-21 Thread Yanan Wang via
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

[PATCH v4 09/10] hw/acpi/virt-acpi-build: Support cluster level in PPTT generation

2021-11-21 Thread Yanan Wang via
Support cluster level in generation of ACPI Processor Properties Topology Table (PPTT) for ARM virt machines. Signed-off-by: Yanan Wang --- hw/arm/virt-acpi-build.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index

[PATCH v4 04/10] hw/arm/virt: Support clusters on ARM virt machines

2021-11-21 Thread Yanan Wang via
upport this new parameter on ARM virt machines. After this, we can define a 4-level CPU topology hierarchy like: cpus=*,maxcpus=*,sockets=*,clusters=*,cores=*,threads=*. Signed-off-by: Yanan Wang --- hw/arm/virt.c | 1 + qemu-options.hx | 10 ++ 2 files changed, 11 insertions(+) diff

[PATCH v2 2/2] tests/unit/test-smp-parse: Fix a check-patch complain

2021-11-10 Thread Yanan Wang
Checkpatch.pl reports errors like below for commit 9e8e393bb7. Let's fix it with a simpler format. ERROR: space required after that close brace '}' +SMPTestData *data = &(SMPTestData){{ }}; Fixes: 9e8e393bb7 ("tests/unit: Add an unit test for smp parsing&quo

[PATCH v2 1/2] tests/unit/test-smp-parse: Make an unified name for the tested machine

2021-11-10 Thread Yanan Wang
et's rename the tested machine with an unified string and tweak the expected error messages accordingly. Fixes: 9e8e393bb7 ("tests/unit: Add an unit test for smp parsing") Reported-by: Philippe Mathieu-Daudé Signed-off-by: Yanan Wang --- tests/unit/test-smp-parse.c | 38

[PATCH v2 0/2] tests/unit/test-smp-parse: Two fixes for test-smp-parse

2021-11-10 Thread Yanan Wang
/5823855357853696 History: v1->v2: - tweak the structure zero-initialization format from { {0} } to {} as Markus suggested (patch #2). Thanks, Yanan Yanan Wang (2): tests/unit/test-smp-parse: Make an unified name for the tested machine tests/unit/test-smp-parse: Fix a check-patch compl

[PATCH 0/2] tests/unit/test-smp-parse: Two fixes for test-smp-parse

2021-11-10 Thread Yanan Wang
/5823855357853696 Thanks, Yanan Yanan Wang (2): tests/unit/test-smp-parse: Make an unified name for the tested machine tests/unit/test-smp-parse: Fix a check-patch complain tests/unit/test-smp-parse.c | 42 + 1 file changed, 29 insertions(+), 13 deletions

[PATCH 2/2] tests/unit/test-smp-parse: Fix a check-patch complain

2021-11-10 Thread Yanan Wang
Checkpatch.pl reports errors like below for commit 9e8e393bb7. Fix it. ERROR: space required after that close brace '}' +SMPTestData *data = &(SMPTestData){{ }}; Fixes: 9e8e393bb7 ("tests/unit: Add an unit test for smp parsing") Signed-off-by: Yanan Wang --- tests/u

[PATCH 1/2] tests/unit/test-smp-parse: Make an unified name for the tested machine

2021-11-10 Thread Yanan Wang
et's rename the tested machine with an unified string and tweak the expected error messages accordingly. Fixes: 9e8e393bb7 ("tests/unit: Add an unit test for smp parsing") Reported-by: Philippe Mathieu-Daudé Signed-off-by: Yanan Wang --- tests/unit/test-smp-parse.c | 38

[PATCH v3 2/2] tests/unit: Add an unit test for smp parsing

2021-10-25 Thread Yanan Wang
Now that we have a generic parser smp_parse(), let's add an unit test for the code. All possible valid/invalid SMP configurations that the user can specify are covered. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones --- MAINTAINERS | 1 + tests/unit/meson.

[PATCH v3 1/2] hw/core/machine: Split out the smp parsing code

2021-10-25 Thread Yanan Wang
separate file, i.e., machine-smp.c and build it in common field. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones --- MAINTAINERS | 1 + hw/core/machine-smp.c | 181 ++ hw/core/machine.c | 159 - hw/core

[PATCH v3 0/2] hw/core/machine: Add an unit test for smp_parse

2021-10-25 Thread Yanan Wang
ry function and add Andrew's R-b (patch #2) - v1: https://lore.kernel.org/qemu-devel/20211010103954.20644-1-wangyana...@huawei.com/ Yanan Wang (2): hw/core/machine: Split out the smp parsing code tests/unit: Add an unit test for smp parsing MAINTAINERS | 2 + hw/co

[PATCH v9 0/8] hw/arm/virt: Introduce cpu topology support

2021-10-20 Thread Yanan Wang
m/virt: Add cpu-map to device tree hw/acpi/aml-build: Add PPTT table Yanan Wang (6): hw/arm/virt: Only describe cpu topology since virt-6.2 device_tree: Add qemu_fdt_add_path hw/acpi/aml-build: Add Processor hierarchy node structure tests/data/acpi/virt: Add an empty expected file for

[PATCH v9 1/8] hw/arm/virt: Only describe cpu topology since virt-6.2

2021-10-20 Thread Yanan Wang
sible that an user application has a dependency on the default topology and if the default one gets changed it will probably behave differently. Based on above consideration we'd better only describe topology information to the guest on 6.2 and later machine types. Signed-off-by: Yanan Wang R

[PATCH v9 3/8] hw/arm/virt: Add cpu-map to device tree

2021-10-20 Thread Yanan Wang
ndrew Jones Co-developed-by: Yanan Wang Signed-off-by: Yanan Wang --- hw/arm/virt.c | 70 +++ 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 15e8d8cf4a..ca433adb5b 100644 --- a/hw/arm/virt.c ++

[PATCH v9 5/8] hw/acpi/aml-build: Add PPTT table

2021-10-20 Thread Yanan Wang
loped-by: Yanan Wang Signed-off-by: Yanan Wang Reviewed-by: Michael S. Tsirkin --- hw/acpi/aml-build.c | 59 + include/hw/acpi/aml-build.h | 3 ++ 2 files changed, 62 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 51

[PATCH v9 6/8] tests/data/acpi/virt: Add an empty expected file for PPTT

2021-10-20 Thread Yanan Wang
Add a generic empty binary file for the new introduced PPTT table under tests/data/acpi/virt, and list it as files to be changed in tests/qtest/bios-tables-test-allowed-diff.h Signed-off-by: Yanan Wang Reviewed-by: Eric Auger --- tests/data/acpi/virt/PPTT | 0 tests/qtest

[PATCH v9 8/8] tests/data/acpi/virt: Update the empty expected file for PPTT

2021-10-20 Thread Yanan Wang
0 00 00 00 00 00 00 14 00 00 0A 00 00 00 // 0040: 24 00 00 00 00 00 00 00 00 00 00 00 // $... Signed-off-by: Yanan Wang --- tests/data/acpi/virt/PPTT | Bin 0 -> 76 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-

[PATCH v9 4/8] hw/acpi/aml-build: Add Processor hierarchy node structure

2021-10-20 Thread Yanan Wang
Wang Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones Reviewed-by: Michael S. Tsirkin Reviewed-by: Eric Auger --- hw/acpi/aml-build.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 76af0ebaf9..5195324585

[PATCH v9 7/8] hw/arm/virt-acpi-build: Generate PPTT table

2021-10-20 Thread Yanan Wang
Generate the Processor Properties Topology Table (PPTT) for ARM virt machines supporting it (>= 6.2). Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones Reviewed-by: Eric Auger --- hw/arm/virt-acpi-build.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/arm/v

[PATCH v9 2/8] device_tree: Add qemu_fdt_add_path

2021-10-20 Thread Yanan Wang
ancis Co-developed-by: Andrew Jones Signed-off-by: Yanan Wang Reviewed-by: David Gibson Reviewed-by: Andrew Jones --- include/sysemu/device_tree.h | 1 + softmmu/device_tree.c| 44 ++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/in

[PATCH v8 8/8] tests/data/acpi/virt: Update the empty expected file for PPTT

2021-10-14 Thread Yanan Wang
0 00 00 00 00 00 00 14 00 00 0A 00 00 00 // 0040: 24 00 00 00 00 00 00 00 00 00 00 00 // $... Signed-off-by: Yanan Wang --- tests/data/acpi/virt/PPTT | Bin 0 -> 76 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-

[PATCH v8 0/8] hw/arm/virt: Introduce cpu topology support

2021-10-14 Thread Yanan Wang
u-devel/20210824122016.144364-1-wangyana...@huawei.com/ Andrew Jones (2): hw/arm/virt: Add cpu-map to device tree hw/acpi/aml-build: Add PPTT table Yanan Wang (6): hw/arm/virt: Only describe cpu topology since virt-6.2 device_tree: Add qemu_fdt_add_path hw/acpi/aml-build: Add Processor hierar

[PATCH v8 2/8] device_tree: Add qemu_fdt_add_path

2021-10-14 Thread Yanan Wang
ancis Co-developed-by: Andrew Jones Signed-off-by: Yanan Wang Reviewed-by: David Gibson Reviewed-by: Andrew Jones --- include/sysemu/device_tree.h | 1 + softmmu/device_tree.c| 44 ++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/in

[PATCH v8 6/8] tests/data/acpi/virt: Add an empty expected file for PPTT

2021-10-14 Thread Yanan Wang
Add a generic empty binary file for the new introduced PPTT table under tests/data/acpi/virt, and list it as files to be changed in tests/qtest/bios-tables-test-allowed-diff.h Signed-off-by: Yanan Wang --- tests/data/acpi/virt/PPTT | 0 tests/qtest/bios-tables-test-allowed

[PATCH v8 1/8] hw/arm/virt: Only describe cpu topology since virt-6.2

2021-10-14 Thread Yanan Wang
sible that an user application has a dependency on the default topology and if the default one gets changed it will probably behave differently. Based on above consideration we'd better only describe topology information to the guest on 6.2 and later machine types. Signed-off-by: Yanan Wang R

[PATCH v8 4/8] hw/acpi/aml-build: Add Processor hierarchy node structure

2021-10-14 Thread Yanan Wang
Wang Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones Reviewed-by: Michael S. Tsirkin --- hw/acpi/aml-build.c | 26 ++ include/hw/acpi/aml-build.h | 4 2 files changed, 30 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index

[PATCH v8 5/8] hw/acpi/aml-build: Add PPTT table

2021-10-14 Thread Yanan Wang
h the ID-valid flag set, which will be consistent with MADT. Signed-off-by: Andrew Jones Co-developed-by: Yanan Wang Signed-off-by: Yanan Wang Reviewed-by: Michael S. Tsirkin --- hw/acpi/aml-build.c | 60 + include/hw/acpi/aml-build.h | 3 ++

[PATCH v8 3/8] hw/arm/virt: Add cpu-map to device tree

2021-10-14 Thread Yanan Wang
ndrew Jones Co-developed-by: Yanan Wang Signed-off-by: Yanan Wang --- hw/arm/virt.c | 70 +++ 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index d241516523..f80af19cd3 100644 --- a/hw/arm/virt.c ++

[PATCH v8 7/8] hw/arm/virt-acpi-build: Generate PPTT table

2021-10-14 Thread Yanan Wang
Generate PPTT table for Arm virt machines. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones --- hw/arm/virt-acpi-build.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 6cec97352b..658a0a5d39 100644 --- a

[PATCH v2 0/2] hw/core/machine: Add an unit test for smp_parse

2021-10-13 Thread Yanan Wang
/ Changelog: v1->v2: - split smp_parse out into a separate .c file instead of a header (patch #1) - dropped an unnecessary function and add Andrew's R-b (patch #2) - v1: https://lore.kernel.org/qemu-devel/20211010103954.20644-1-wangyana...@huawei.com/ Yanan Wang (2): hw/core/machine: Split out

[PATCH v2 2/2] tests/unit: Add an unit test for smp parsing

2021-10-13 Thread Yanan Wang
Now that we have a generic parser smp_parse(), let's add an unit test for the code. All possible valid/invalid SMP configurations that the user can specify are covered. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones --- MAINTAINERS | 1 + tests/unit/meson.

[PATCH v2 1/2] hw/core/machine: Split out the smp parsing code

2021-10-13 Thread Yanan Wang
separate file, i.e., machine-smp.c and build it in common field. Signed-off-by: Yanan Wang --- MAINTAINERS | 1 + hw/core/machine-smp.c | 181 ++ hw/core/machine.c | 159 - hw/core/meson.build | 2

[PATCH 1/2] hw/core/machine: Split out smp_parse as an inline API

2021-10-10 Thread Yanan Wang
e out into a separate header as an inline API. Signed-off-by: Yanan Wang --- MAINTAINERS | 1 + hw/core/machine.c | 160 +--- include/hw/core/smp.h | 185 ++ 3 files changed, 187 insertions(+), 159 deletions(-) c

[PATCH 0/2] hw/core/machine: An an unit test for smp_parse

2021-10-10 Thread Yanan Wang
originally posted test is here [2]: [2] https://lore.kernel.org/qemu-devel/20210910073025.16480-17-wangyana...@huawei.com/ Compared to [2], the test in this series is reworked and more brief. Yanan Wang (2): hw/core/machine: Split out smp_parse as an inline API tests/unit: Add an unit test

[PATCH 2/2] tests/unit: Add an unit test for smp parsing

2021-10-10 Thread Yanan Wang
Now that we have a generic parser smp_parse(), let's add an unit test for the code. All possible valid/invalid SMP configurations that the user can specify are covered. Signed-off-by: Yanan Wang --- MAINTAINERS | 1 + tests/unit/meson.build | 1 + tests/unit/tes

[PATCH] hw/core/machine: Add the missing delimiter in cpu_slot_to_string()

2021-10-08 Thread Yanan Wang
id validity in smp context") Signed-off-by: Yanan Wang --- hw/core/machine.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index b8d95eec32..0a23ae3106 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1157,6 +1157,9 @@ static char

[RFC PATCH 1/3] qemu-options: Improve scalability of the -smp documentation

2021-10-07 Thread Yanan Wang
Rewrite part of the -smp documentation in qemu-option.hx, so that we can easily/clearly extend it with more target specific CPU topology members introduced in the future. Signed-off-by: Yanan Wang --- qemu-options.hx | 90 +++-- 1 file changed, 73

[RFC PATCH 3/3] qapi/machine.json: Improve scalability of the SMP related comments

2021-10-07 Thread Yanan Wang
Rewrite the comments related to SMP in qapi/machine.json, so that we can easily/clearly extend it with more target specific CPU topology members introduced in the future. Signed-off-by: Yanan Wang --- qapi/machine.json | 47 ++- 1 file changed, 38

[RFC PATCH 0/3] Improve scalability of the SMP related Docs

2021-10-07 Thread Yanan Wang
ested in having a look at this. Comments welcome! Thanks, Yanan . Yanan Wang (3): qemu-options: Improve scalability of the -smp documentation include/hw/boards: Improve scalability of the CpuTopology comment qapi/machine.json: Improve scalability of the SMP related comments include/hw/boa

[RFC PATCH 2/3] include/hw/boards: Improve scalability of the CpuTopology comment

2021-10-07 Thread Yanan Wang
Rewrite the comment of struct CpuTopology in include/hw/boards.h, so that we can easily/clearly extend it with more target specific CPU topology members introduced in the future. Signed-off-by: Yanan Wang --- include/hw/boards.h | 26 ++ 1 file changed, 22 insertions

[PATCH v7 5/8] hw/acpi/aml-build: Add PPTT table

2021-10-06 Thread Yanan Wang
h the ID-valid flag set, which will be consistent with MADT. Signed-off-by: Andrew Jones Co-developed-by: Yanan Wang Signed-off-by: Yanan Wang Reviewed-by: Michael S. Tsirkin --- hw/acpi/aml-build.c | 60 + include/hw/acpi/aml-build.h | 3 ++

[PATCH v7 8/8] tests/data/acpi/virt: Update binary files for PPTT

2021-10-06 Thread Yanan Wang
0 00 00 00 00 00 00 14 00 00 0A 00 00 00 // 0040: 24 00 00 00 00 00 00 00 00 00 00 00 // $... Signed-off-by: Yanan Wang --- tests/data/acpi/virt/PPTT | Bin 0 -> 76 bytes tests/data/acpi/virt/PPTT.memhp | Bin 0 -> 76 bytes tests/data/

[PATCH v7 3/8] hw/arm/virt: Add cpu-map to device tree

2021-10-06 Thread Yanan Wang
ndrew Jones Co-developed-by: Yanan Wang Signed-off-by: Yanan Wang --- hw/arm/virt.c | 70 +++ 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index d241516523..f80af19cd3 100644 --- a/hw/arm/virt.c ++

[PATCH v7 7/8] hw/arm/virt-acpi-build: Generate PPTT table

2021-10-06 Thread Yanan Wang
Generate PPTT table for Arm virt machines. Signed-off-by: Yanan Wang --- hw/arm/virt-acpi-build.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 6cec97352b..658a0a5d39 100644 --- a/hw/arm/virt-acpi-build.c

[PATCH v7 6/8] tests/data/acpi/virt: Add empty binary files for PPTT

2021-10-06 Thread Yanan Wang
Add empty binary files for the new introduced PPTT table under tests/data/acpi/virt, and list them as files to be changed in tests/qtest/bios-tables-test-allowed-diff.h Signed-off-by: Yanan Wang --- tests/data/acpi/virt/PPTT | 0 tests/data/acpi/virt/PPTT.memhp | 0

[PATCH v7 4/8] hw/acpi/aml-build: Add Processor hierarchy node structure

2021-10-06 Thread Yanan Wang
Wang Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones Reviewed-by: Michael S. Tsirkin --- hw/acpi/aml-build.c | 26 ++ include/hw/acpi/aml-build.h | 4 2 files changed, 30 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index

[PATCH v7 1/8] hw/arm/virt: Only describe cpu topology since virt-6.2

2021-10-06 Thread Yanan Wang
sible that an user application has a dependency on the default topology and if the default one gets changed it will probably behave differently. Based on above consideration we'd better only describe topology information to the guest on 6.2 and later machine types. Signed-off-by: Yanan Wang R

[PATCH v7 0/8] hw/arm/virt: Introduce cpu topology support

2021-10-06 Thread Yanan Wang
files for PPTT to fix broken bios-table-test for Aarch64 virt machine (patch #6-#8 added) - v6: https://lore.kernel.org/qemu-devel/20210824122016.144364-1-wangyana...@huawei.com/ Andrew Jones (2): hw/arm/virt: Add cpu-map to device tree hw/acpi/aml-build: Add PPTT table Yanan Wang (6):

[PATCH v7 2/8] device_tree: Add qemu_fdt_add_path

2021-10-06 Thread Yanan Wang
ancis Co-developed-by: Andrew Jones Signed-off-by: Yanan Wang Reviewed-by: David Gibson Reviewed-by: Andrew Jones --- include/sysemu/device_tree.h | 1 + softmmu/device_tree.c| 44 ++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/in

[PATCH v12 14/16] machine: Move smp_prefer_sockets to struct SMPCompatProps

2021-09-28 Thread Yanan Wang
Now we have a common structure SMPCompatProps used to store information about SMP compatibility stuff, so we can also move smp_prefer_sockets there for cleaner code. No functional change intended. Signed-off-by: Yanan Wang Acked-by: David Gibson Reviewed-by: Andrew Jones Reviewed-by: Daniel P

[PATCH v12 11/16] machine: Tweak the order of topology members in struct CpuTopology

2021-09-28 Thread Yanan Wang
Now that all the possible topology parameters are integrated in struct CpuTopology, tweak the order of topology members to be "cpus/sockets/ dies/cores/threads/maxcpus" for readability and consistency. We also tweak the comment by adding explanation of dies parameter. Signed-off-by:

[PATCH v12 12/16] machine: Make smp_parse generic enough for all arches

2021-09-28 Thread Yanan Wang
d. Making smp_parse() generic enough can reduce code duplication and ease the code maintenance, and also allows extending the topology with more arch specific members (e.g., clusters) in the future. Suggested-by: Andrew Jones Suggested-by: Daniel P. Berrangé Signed-off-by: Yanan Wang Reviewed-by

[PATCH v12 16/16] machine: Make smp_parse return a boolean

2021-09-28 Thread Yanan Wang
e can more laconically check whether the parsing has succeeded without touching the errp. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Yanan Wang --- hw/core/machine.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machi

[PATCH v12 13/16] machine: Remove smp_parse callback from MachineClass

2021-09-28 Thread Yanan Wang
Now we have a generic smp parser for all arches, and there will not be any other arch specific ones, so let's remove the callback from MachineClass and call the parser directly. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones Reviewed-by: Daniel P. Berrangé --- hw/core/machine.c

[PATCH v12 03/16] machine: Minor refactor/fix for the smp parsers

2021-09-28 Thread Yanan Wang
fix a hidden defect by avoiding directly using the provided *zero value* in the calculation, which could cause a segment fault (e.g. using dies=0 in the calculation). Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones Reviewed-by: Daniel P. Berrangé --- hw/core/machine.c |

[PATCH v12 05/16] machine: Set the value of cpus to match maxcpus if it's omitted

2021-09-28 Thread Yanan Wang
igs to be valid. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones Reviewed-by: Daniel P. Berrangé --- hw/core/machine.c | 29 - hw/i386/pc.c | 29 - qemu-options.hx | 11 --- 3 files changed, 40 insertions(+), 29 deletions(-

[PATCH v12 09/16] machine: Prefer cores over sockets in smp parsing since 6.2

2021-09-28 Thread Yanan Wang
patch, a boolean "smp_prefer_sockets" is added, and we only enable the old preference on older machines and enable the new one since type 6.2 for all arches by using the machine compat mechanism. Suggested-by: Daniel P. Berrange Signed-off-by: Yanan Wang Acked-by: David Gibson Acked-by

[PATCH v12 15/16] machine: Put all sanity-check in the generic SMP parser

2021-09-28 Thread Yanan Wang
Put both sanity-check of the input SMP configuration and sanity-check of the output SMP configuration uniformly in the generic parser. Then machine_set_smp() will become cleaner, also all the invalid scenarios can be tested only by calling the parser. Signed-off-by: Yanan Wang Reviewed-by

  1   2   3   4   >