v2 -> v3 (range-diff below): * pick up tags (thanks Janosch, thanks Nico, thanks Thomas) * fix ordering test * get rid of duplicate reports v1 -> v2: * patch 1, introducing enums (Janosch) * add comment explaining 8 alignment of stsi block length * unsigned cpu_in_masks, iteration (Nico) * fix copy paste error when checking ordering (thanks Nina) * don't escape newline when \\ at end of line in multiline string * change commit messages (thanks Janosch, thanks Nico) * pick up tags (thanks Janosch, thanks Nico) Fix a number of issues as well as rewrite and extend the topology list checking. Add a test case with a complex topology configuration. In order to keep the unittests.cfg file readable, implement multiline strings for extra_params. Nina Schoetterl-Glausch (10): s390x: topology: Introduce enums for polarization & cpu type s390x: topology: Fix report message s390x: topology: Use function parameter in stsi_get_sysib s390x: topology: Fix parsing loop s390x: topology: Make some report messages unique s390x: topology: Refine stsi header test s390x: topology: Rename topology_core to topology_cpu s390x: topology: Rewrite topology list test scripts: Implement multiline strings for extra_params s390x: topology: Add complex topology test scripts/common.bash | 16 +++ scripts/runtime.bash | 4 +- lib/s390x/stsi.h | 47 ++++++--- s390x/topology.c | 244 +++++++++++++++++++++++++++---------------- s390x/unittests.cfg | 133 +++++++++++++++++++++++ 5 files changed, 335 insertions(+), 109 deletions(-) Range-diff against v2: 1: 334fec11 ! 1: c9bf5572 s390x: topology: Introduce enums for polarization & cpu type @@ Commit message Thereby get rid of magic values. + Reviewed-by: Nico Boehr <nrb@xxxxxxxxxxxxx> + Reviewed-by: Janosch Frank <frankja@xxxxxxxxxxxxx> Signed-off-by: Nina Schoetterl-Glausch <nsg@xxxxxxxxxxxxx> ## lib/s390x/stsi.h ## 2: e3fabae5 ! 2: 038330af s390x: topology: Fix report message @@ Commit message A polarization value of 0 means horizontal polarization. Reviewed-by: Nico Boehr <nrb@xxxxxxxxxxxxx> + Reviewed-by: Janosch Frank <frankja@xxxxxxxxxxxxx> Signed-off-by: Nina Schoetterl-Glausch <nsg@xxxxxxxxxxxxx> ## s390x/topology.c ## 3: 95c652d4 = 3: 37cc2bb5 s390x: topology: Use function parameter in stsi_get_sysib 4: c3d2eabb ! 4: d4fcb174 s390x: topology: Fix parsing loop @@ Commit message Without a comparison the loop is infinite. Reviewed-by: Nico Boehr <nrb@xxxxxxxxxxxxx> + Reviewed-by: Janosch Frank <frankja@xxxxxxxxxxxxx> Signed-off-by: Nina Schoetterl-Glausch <nsg@xxxxxxxxxxxxx> ## s390x/topology.c ## 5: 3bab8b7a = 5: ac883c6c s390x: topology: Make some report messages unique 6: 3aac2b2d ! 6: 744a15b7 s390x: topology: Refine stsi header test @@ Commit message Also minor refactor. Reviewed-by: Nico Boehr <nrb@xxxxxxxxxxxxx> + Reviewed-by: Janosch Frank <frankja@xxxxxxxxxxxxx> Signed-off-by: Nina Schoetterl-Glausch <nsg@xxxxxxxxxxxxx> ## s390x/topology.c ## 7: c2cdd5ff = 7: f6eea5d1 s390x: topology: Rename topology_core to topology_cpu 8: 95e9a32f ! 8: 55eb47bf s390x: topology: Rewrite topology list test @@ Commit message This improves comprehension and allows for more tests. We now also test for ordering of CPU TLEs and number of child entries. + Acked-by: Janosch Frank <frankja@xxxxxxxxxxxxx> Signed-off-by: Nina Schoetterl-Glausch <nsg@xxxxxxxxxxxxx> ## lib/s390x/stsi.h ## @@ s390x/topology.c: static int stsi_get_sysib(struct sysinfo_15_1_x *info, int sel +{ + void *last = ((void *)info) + info->length; + union topology_cpu *prev_cpu = NULL; ++ bool correct_ordering = true; + unsigned int cpus = 0; + int i; + -+ for (i = 0; (void *)&child[i] < last && child[i].nl == 0; i++) { ++ for (i = 0; (void *)&child[i] < last && child[i].nl == 0; prev_cpu = &child[i++]) { + cpus += check_cpu(&child[i], cont); + if (prev_cpu) { -+ report(prev_cpu->type <= child[i].type, "Correct ordering wrt type"); ++ if (prev_cpu->type > child[i].type) { ++ report_info("Incorrect ordering wrt type for child %d", i); ++ correct_ordering = false; ++ } + if (prev_cpu->type < child[i].type) + continue; -+ report(prev_cpu->pp >= child[i].pp, "Correct ordering wrt polarization"); ++ if (prev_cpu->pp < child[i].pp) { ++ report_info("Incorrect ordering wrt polarization for child %d", i); ++ correct_ordering = false; ++ } + if (prev_cpu->pp > child[i].pp) + continue; -+ report(prev_cpu->d || !child[i].d, "Correct ordering wrt dedication"); ++ if (!prev_cpu->d && child[i].d) { ++ report_info("Incorrect ordering wrt dedication for child %d", i); ++ correct_ordering = false; ++ } + if (prev_cpu->d && !child[i].d) + continue; -+ report(prev_cpu->origin <= child[i].origin, "Correct ordering wrt origin"); ++ if (prev_cpu->origin > child[i].origin) { ++ report_info("Incorrect ordering wrt origin for child %d", i); ++ correct_ordering = false; ++ } + } -+ prev_cpu = &child[i]; + } ++ report(correct_ordering, "children correctly ordered"); + report(cpus <= expected_topo_lvl[0], "%d children <= max of %d", + cpus, expected_topo_lvl[0]); + *cpus_in_masks += cpus; 9: d7317d8b ! 9: 8099ad07 scripts: Implement multiline strings for extra_params @@ Commit message The command string built with extra_params is eval'ed by the runtime script, so the newlines need to be escaped with \. + Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx> Signed-off-by: Nina Schoetterl-Glausch <nsg@xxxxxxxxxxxxx> ## scripts/common.bash ## 10: fe527ddb = 10: 5e667461 s390x: topology: Add complex topology test base-commit: bfe5d7d0e14c8199d134df84d6ae8487a9772c48 -- 2.41.0