tests: Silence various warnings with pseries
authorGreg Kurz <groug@kaod.org>
Sat, 1 Feb 2020 22:46:16 +0000 (23:46 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 3 Feb 2020 00:33:11 +0000 (11:33 +1100)
Some default features of the pseries machine are only available with
KVM. Warnings are printed when the pseries machine is used with another
accelerator:

qemu-system-ppc64: warning: TCG doesn't support requested feature,
cap-ccf-assist=on
qemu-system-ppc64: warning: Firmware Assisted Non-Maskable
Interrupts(FWNMI) not supported in TCG
qemu-system-ppc64: warning: TCG doesn't support requested feature,
cap-ccf-assist=on
qemu-system-ppc64: warning: Firmware Assisted Non-Maskable
Interrupts(FWNMI) not supported in TCG
qemu-system-ppc64: warning: TCG doesn't support requested feature,
cap-ccf-assist=on
qemu-system-ppc64: warning: Firmware Assisted Non-Maskable
Interrupts(FWNMI) not supported in TCG

This is annoying for CI since it usually runs without KVM. We already
disable features that emit similar warnings thanks to properties of
the pseries machine, but this is open-coded in various
places. Consolidate the set of properties in a single place. Extend it
to silence the above warnings. And use it in the various tests that
start pseries machines.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <158059697130.1820292.7823434132030453110.stgit@bahia.lan>
Reviewed-by: Thomas Huth <thuth@redhat.com>
[dwg: Correct minor grammatical error]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
tests/qtest/boot-serial-test.c
tests/qtest/libqos/libqos-spapr.h
tests/qtest/prom-env-test.c
tests/qtest/pxe-test.c

index 8e8c5b0a0f0c90e4fd3135eb8e5f8aa239119b4f..85a361428697706545614f588dab095af080b87a 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
+#include "libqos/libqos-spapr.h"
 
 static const uint8_t kernel_mcf5208[] = {
     0x41, 0xf9, 0xfc, 0x06, 0x00, 0x00,     /* lea 0xfc060000,%a0 */
@@ -112,7 +113,7 @@ static testdef_t tests[] = {
     { "ppc64", "40p", "-m 192", "Memory: 192M" },
     { "ppc64", "mac99", "", "PowerPC,970FX" },
     { "ppc64", "pseries",
-      "-machine cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken",
+      "-machine " PSERIES_DEFAULT_CAPABILITIES,
       "Open Firmware" },
     { "ppc64", "powernv8", "", "OPAL" },
     { "ppc64", "powernv9", "", "OPAL" },
index dcb5c43ad37dd69b7316192a02e9ff11b591a33e..d9c4c223431090b1fc52f42e8873082e2f55a75d 100644 (file)
@@ -7,4 +7,12 @@ QOSState *qtest_spapr_vboot(const char *cmdline_fmt, va_list ap);
 QOSState *qtest_spapr_boot(const char *cmdline_fmt, ...);
 void qtest_spapr_shutdown(QOSState *qs);
 
+/* List of capabilities needed to silence warnings with TCG */
+#define PSERIES_DEFAULT_CAPABILITIES             \
+    "cap-cfpc=broken,"                           \
+    "cap-sbbc=broken,"                           \
+    "cap-ibs=broken,"                            \
+    "cap-ccf-assist=off,"                        \
+    "cap-fwnmi-mce=off"
+
 #endif
index 9be52c766fe3820b2e965210707a408f578fbd26..60e6ec315335ce59890c54cb62343ee3ec87ad9c 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "qemu/osdep.h"
 #include "libqtest.h"
+#include "libqos/libqos-spapr.h"
 
 #define MAGIC   0xcafec0de
 #define ADDRESS 0x4000
@@ -54,7 +55,7 @@ static void test_machine(const void *machine)
      */
     if (strcmp(machine, "pseries") == 0) {
         extra_args = "-nodefaults"
-            " -machine cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken";
+            " -machine " PSERIES_DEFAULT_CAPABILITIES;
     }
 
     qts = qtest_initf("-M %s -accel tcg %s -prom-env 'use-nvramrc?=true' "
index f68d0aadbb4d2c180952cfca17d3b3a91021503f..1161a773a4a77b429c8887dc913d731e4cf2cda9 100644 (file)
@@ -17,6 +17,7 @@
 #include "qemu-common.h"
 #include "libqtest.h"
 #include "boot-sector.h"
+#include "libqos/libqos-spapr.h"
 
 #define NETNAME "net0"
 
@@ -46,15 +47,15 @@ static testdef_t x86_tests_slow[] = {
 
 static testdef_t ppc64_tests[] = {
     { "pseries", "spapr-vlan",
-      "-machine cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken,vsmt=8" },
+      "-machine vsmt=8," PSERIES_DEFAULT_CAPABILITIES },
     { "pseries", "virtio-net-pci",
-      "-machine cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken,vsmt=8" },
+      "-machine vsmt=8," PSERIES_DEFAULT_CAPABILITIES },
     { NULL },
 };
 
 static testdef_t ppc64_tests_slow[] = {
     { "pseries", "e1000",
-      "-machine cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken,vsmt=8" },
+      "-machine vsmt=8," PSERIES_DEFAULT_CAPABILITIES },
     { NULL },
 };