All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Laurent Vivier" <lvivier@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Li Qiang" <liq3ea@gmail.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Laszlo Ersek" <lersek@redhat.com>
Subject: [PATCH 7/7] tests/fw_cfg: Run the tests on big-endian targets
Date: Fri,  4 Oct 2019 00:54:37 +0200	[thread overview]
Message-ID: <20191003225437.16651-8-philmd@redhat.com> (raw)
In-Reply-To: <20191003225437.16651-1-philmd@redhat.com>

We have been restricting our fw_cfg tests to the PC machine,
which is a little-endian architecture.
The fw_cfg device is also used on the SPARC and PowerPC
architectures, which can run in big-endian configuration.

Since we want to be sure our device does not regress
regardless the endianess used, enable this test one
these targets.

The NUMA selector is X86 specific, restrict it to this arch.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/Makefile.include |  2 ++
 tests/fw_cfg-test.c    | 18 +++++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 3543451ed3..322bdb36ff 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -242,6 +242,7 @@ check-qtest-ppc64-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
 check-qtest-ppc64-y += tests/numa-test$(EXESUF)
 check-qtest-ppc64-$(CONFIG_IVSHMEM_DEVICE) += tests/ivshmem-test$(EXESUF)
 check-qtest-ppc64-y += tests/cpu-plug-test$(EXESUF)
+check-qtest-ppc64-y += tests/fw_cfg-test$(EXESUF)
 
 check-qtest-sh4-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF)
 
@@ -250,6 +251,7 @@ check-qtest-sh4eb-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF)
 check-qtest-sparc-y += tests/prom-env-test$(EXESUF)
 check-qtest-sparc-y += tests/m48t59-test$(EXESUF)
 check-qtest-sparc-y += tests/boot-serial-test$(EXESUF)
+check-qtest-sparc-y += tests/fw_cfg-test$(EXESUF)
 
 check-qtest-sparc64-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF)
 check-qtest-sparc64-y += tests/prom-env-test$(EXESUF)
diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c
index 12dbaf4e67..39bbc9647e 100644
--- a/tests/fw_cfg-test.c
+++ b/tests/fw_cfg-test.c
@@ -209,13 +209,22 @@ static void test_fw_cfg_splash_time(const void *opaque)
 
 int main(int argc, char **argv)
 {
+    const char *arch = qtest_get_arch();
     QTestCtx *ctx = g_new(QTestCtx, 1);
     int ret;
 
     g_test_init(&argc, &argv, NULL);
 
-    ctx->machine_name = "pc";
-    ctx->fw_cfg = pc_fw_cfg_init();
+    if (g_str_equal(arch, "i386") || g_str_equal(arch, "x86_64")) {
+        ctx->machine_name = "pc";
+        ctx->fw_cfg = pc_fw_cfg_init();
+    } else if (g_str_equal(arch, "sparc")) {
+        ctx->machine_name = "SS-5";
+        ctx->fw_cfg = mm_fw_cfg_init(0xd00000510ULL);
+    } else if (g_str_equal(arch, "ppc64")) {
+        ctx->machine_name = "mac99";
+        ctx->fw_cfg = mm_fw_cfg_init(0xf0000510);
+    }
 
     qtest_add_data_func("fw_cfg/signature", ctx, test_fw_cfg_signature);
     qtest_add_data_func("fw_cfg/id", ctx, test_fw_cfg_id);
@@ -230,12 +239,15 @@ int main(int argc, char **argv)
     qtest_add_func("fw_cfg/boot_device", test_fw_cfg_boot_device);
 #endif
     qtest_add_data_func("fw_cfg/max_cpus", ctx, test_fw_cfg_max_cpus);
-    qtest_add_data_func("fw_cfg/numa", ctx, test_fw_cfg_numa);
     qtest_add_data_func("fw_cfg/boot_menu", ctx, test_fw_cfg_boot_menu);
     qtest_add_data_func("fw_cfg/reboot_timeout", ctx,
                         test_fw_cfg_reboot_timeout);
     qtest_add_data_func("fw_cfg/splash_time", ctx, test_fw_cfg_splash_time);
 
+    if (g_str_equal(arch, "i386") || g_str_equal(arch, "x86_64")) {
+        qtest_add_data_func("fw_cfg/numa", ctx, test_fw_cfg_numa);
+    }
+
     ret = g_test_run();
 
     g_free(ctx->fw_cfg);
-- 
2.20.1



  parent reply	other threads:[~2019-10-03 23:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 22:54 [PATCH 0/7] fw_cfg: Run tests on big-endian Philippe Mathieu-Daudé
2019-10-03 22:54 ` [PATCH 1/7] tests/libqos/fw_cfg: Document io_fw_cfg_init to drop io_fw_cfg_uninit Philippe Mathieu-Daudé
2019-10-04 18:39   ` Laszlo Ersek
2019-10-03 22:54 ` [PATCH 2/7] tests/libqos/fw_cfg: Document mm_fw_cfg_init to drop mm_fw_cfg_uninit Philippe Mathieu-Daudé
2019-10-04 18:40   ` Laszlo Ersek
2019-10-03 22:54 ` [PATCH 3/7] tests/libqos/fw_cfg: Document pc_fw_cfg_init to drop pc_fw_cfg_uninit Philippe Mathieu-Daudé
2019-10-04 18:42   ` Laszlo Ersek
2019-10-03 22:54 ` [PATCH 4/7] tests/fw_cfg: Let the tests use a context Philippe Mathieu-Daudé
2019-10-04 18:50   ` Laszlo Ersek
2019-10-03 22:54 ` [PATCH 5/7] tests/libqos/fw_cfg: Pass QTestState as argument Philippe Mathieu-Daudé
2019-10-04 18:57   ` Laszlo Ersek
2019-10-03 22:54 ` [PATCH 6/7] tests/fw_cfg: Declare one QFWCFG for all tests Philippe Mathieu-Daudé
2019-10-04 19:04   ` Laszlo Ersek
2019-10-03 22:54 ` Philippe Mathieu-Daudé [this message]
2019-10-04  8:05   ` [PATCH 7/7] tests/fw_cfg: Run the tests on big-endian targets Laurent Vivier
2019-10-04  8:53     ` Philippe Mathieu-Daudé
2019-10-04  8:59       ` Laurent Vivier
2019-10-04  9:03         ` Philippe Mathieu-Daudé
2019-10-04  9:14           ` Laurent Vivier
2019-10-04  9:18             ` Philippe Mathieu-Daudé
2019-10-07  6:17     ` Thomas Huth
2019-10-04  0:12 ` [PATCH 0/7] fw_cfg: Run tests on big-endian no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191003225437.16651-8-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=liq3ea@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.