From b17693453ef4d06f732295c2e70128a7cf20bf30 Mon Sep 17 00:00:00 2001 From: Claudio Fontana Date: Thu, 14 Mar 2024 18:22:18 +0100 Subject: [PATCH 1/4] docs/s390: clarify even more that cpu-topology is KVM-only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At least for now cpu-topology is implemented only for KVM. We already say this, but this tries to be more explicit, and also show it in the examples. This adds a new reference in the introduction that we can point to, whenever we need to reference accelerators and how to select them. Signed-off-by: Claudio Fontana Message-ID: <20240314172218.16478-1-cfontana@suse.de> Reviewed-by: Nina Schoetterl-Glausch Tested-by: Nina Schoetterl-Glausch Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- docs/system/introduction.rst | 2 ++ docs/system/s390x/cpu-topology.rst | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/system/introduction.rst b/docs/system/introduction.rst index 51ac132d6c..746707eb00 100644 --- a/docs/system/introduction.rst +++ b/docs/system/introduction.rst @@ -1,6 +1,8 @@ Introduction ============ +.. _Accelerators: + Virtualisation Accelerators --------------------------- diff --git a/docs/system/s390x/cpu-topology.rst b/docs/system/s390x/cpu-topology.rst index 5133fdc362..d5b506ee5c 100644 --- a/docs/system/s390x/cpu-topology.rst +++ b/docs/system/s390x/cpu-topology.rst @@ -25,17 +25,19 @@ monitor polarization changes, see ``docs/devel/s390-cpu-topology.rst``. Prerequisites ------------- -To use the CPU topology, you need to run with KVM on a s390x host that -uses the Linux kernel v6.0 or newer (which provide the so-called +To use the CPU topology, you currently need to choose the KVM accelerator. +See :ref:`Accelerators` for more details about accelerators and how to select them. + +The s390x host needs to use a Linux kernel v6.0 or newer (which provides the so-called ``KVM_CAP_S390_CPU_TOPOLOGY`` capability that allows QEMU to signal the CPU topology facility via the so-called STFLE bit 11 to the VM). Enabling CPU topology --------------------- -Currently, CPU topology is only enabled in the host model by default. +Currently, CPU topology is enabled by default only in the "host" CPU model. -Enabling CPU topology in a CPU model is done by setting the CPU flag +Enabling CPU topology in another CPU model is done by setting the CPU flag ``ctop`` to ``on`` as in: .. code-block:: bash @@ -132,7 +134,7 @@ In the following machine we define 8 sockets with 4 cores each. .. code-block:: bash - $ qemu-system-s390x -m 2G \ + $ qemu-system-s390x -accel kvm -m 2G \ -cpu gen16b,ctop=on \ -smp cpus=5,sockets=8,cores=4,maxcpus=32 \ -device host-s390x-cpu,core-id=14 \ @@ -227,7 +229,7 @@ with vertical high entitlement. .. code-block:: bash - $ qemu-system-s390x -m 2G \ + $ qemu-system-s390x -accel kvm -m 2G \ -cpu gen16b,ctop=on \ -smp cpus=1,sockets=8,cores=4,maxcpus=32 \ \ From ff7c98a9415f3d61d026002921dfc836ce232bcf Mon Sep 17 00:00:00 2001 From: Claudio Fontana Date: Thu, 14 Mar 2024 22:37:46 +0100 Subject: [PATCH 2/4] target/s390x: improve cpu compatibility check error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit some users were confused by this message showing under TCG: Selected CPU generation is too new. Maximum supported model in the configuration: 'xyz' Clarify that the maximum can depend on the accel, and add a hint to try a different one. Also add a hint for features mismatch to suggest trying different accel, QEMU and kernel versions. Signed-off-by: Claudio Fontana Message-ID: <20240314213746.27163-1-cfontana@suse.de> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Nina Schoetterl-Glausch Signed-off-by: Thomas Huth --- target/s390x/cpu_models.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 1a1c096122..8ed3bb6a27 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -500,6 +500,16 @@ static void error_prepend_missing_feat(const char *name, void *opaque) error_prepend((Error **) opaque, "%s ", name); } +static void check_compat_model_failed(Error **errp, + const S390CPUModel *max_model, + const char *msg) +{ + error_setg(errp, "%s. Maximum supported model in the current configuration: \'%s\'", + msg, max_model->def->name); + error_append_hint(errp, "Consider a different accelerator, try \"-accel help\"\n"); + return; +} + static void check_compatibility(const S390CPUModel *max_model, const S390CPUModel *model, Error **errp) { @@ -507,15 +517,11 @@ static void check_compatibility(const S390CPUModel *max_model, S390FeatBitmap missing; if (model->def->gen > max_model->def->gen) { - error_setg(errp, "Selected CPU generation is too new. Maximum " - "supported model in the configuration: \'%s\'", - max_model->def->name); + check_compat_model_failed(errp, max_model, "Selected CPU generation is too new"); return; } else if (model->def->gen == max_model->def->gen && model->def->ec_ga > max_model->def->ec_ga) { - error_setg(errp, "Selected CPU GA level is too new. Maximum " - "supported model in the configuration: \'%s\'", - max_model->def->name); + check_compat_model_failed(errp, max_model, "Selected CPU GA level is too new"); return; } @@ -537,7 +543,9 @@ static void check_compatibility(const S390CPUModel *max_model, error_setg(errp, " "); s390_feat_bitmap_to_ascii(missing, errp, error_prepend_missing_feat); error_prepend(errp, "Some features requested in the CPU model are not " - "available in the configuration: "); + "available in the current configuration: "); + error_append_hint(errp, + "Consider a different accelerator, QEMU, or kernel version\n"); } S390CPUModel *get_max_cpu_model(Error **errp) From 47833f817cc597db124c690bd14600bb5d00e824 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 7 Mar 2024 18:43:32 +0100 Subject: [PATCH 3/4] target/sparc/cpu: Improve the CPU help text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the unnecessary "Sparc" at the beginning of the line and put the chip information into parentheses so that it is clearer which part of the line have to be passed to "-cpu" to specify a different CPU. Message-ID: <20240307174334.130407-4-thuth@redhat.com> Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- target/sparc/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index dc9ead21fc..e820f50acf 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -574,9 +574,10 @@ void sparc_cpu_list(void) { unsigned int i; + qemu_printf("Available CPU types:\n"); for (i = 0; i < ARRAY_SIZE(sparc_defs); i++) { - qemu_printf("Sparc %16s IU " TARGET_FMT_lx - " FPU %08x MMU %08x NWINS %d ", + qemu_printf(" %-20s (IU " TARGET_FMT_lx + " FPU %08x MMU %08x NWINS %d) ", sparc_defs[i].name, sparc_defs[i].iu_version, sparc_defs[i].fpu_version, From aebe0a8552e8d419c8103e60e593f2778eab41c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 13 Mar 2024 22:33:29 +0100 Subject: [PATCH 4/4] travis-ci: Rename SOFTMMU -> SYSTEM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we *might* have user emulation with softmmu, rename MAIN_SOFTMMU_TARGETS as MAIN_SYSTEM_TARGETS to express 'system emulation targets'. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240313213339.82071-3-philmd@linaro.org> Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 76859d48da..597d151b80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ env: - TEST_BUILD_CMD="" - TEST_CMD="make check V=1" # This is broadly a list of "mainline" system targets which have support across the major distros - - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" + - MAIN_SYSTEM_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" - CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime" - CCACHE_MAXSIZE=1G - G_MESSAGES_DEBUG=error @@ -114,7 +114,7 @@ jobs: env: - TEST_CMD="make check check-tcg V=1" - CONFIG="--disable-containers --enable-fdt=system - --target-list=${MAIN_SOFTMMU_TARGETS} --cxx=/bin/false" + --target-list=${MAIN_SYSTEM_TARGETS} --cxx=/bin/false" - UNRELIABLE=true - name: "[ppc64] GCC check-tcg" @@ -185,7 +185,7 @@ jobs: env: - TEST_CMD="make check check-tcg V=1" - CONFIG="--disable-containers --enable-fdt=system - --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user" + --target-list=${MAIN_SYSTEM_TARGETS},s390x-linux-user" - UNRELIABLE=true script: - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$? @@ -226,7 +226,7 @@ jobs: - genisoimage env: - CONFIG="--disable-containers --enable-fdt=system --audio-drv-list=sdl - --disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}" + --disable-user --target-list-exclude=${MAIN_SYSTEM_TARGETS}" - name: "[s390x] GCC (user)" arch: s390x