From patchwork Thu Oct 3 22:54:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1171473 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46kpjx1zh9z9sCJ for ; Fri, 4 Oct 2019 09:14:29 +1000 (AEST) Received: from localhost ([::1]:40946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGAIk-0006n0-EH for incoming@patchwork.ozlabs.org; Thu, 03 Oct 2019 19:14:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41211) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGA0o-0004BE-Vg for qemu-devel@nongnu.org; Thu, 03 Oct 2019 18:55:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iGA0n-0008TN-Im for qemu-devel@nongnu.org; Thu, 03 Oct 2019 18:55:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45248) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iGA0k-0008QZ-1N for qemu-devel@nongnu.org; Thu, 03 Oct 2019 18:55:52 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5EFBFC057F23; Thu, 3 Oct 2019 22:55:42 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-21.brq.redhat.com [10.40.204.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC4AD600C4; Thu, 3 Oct 2019 22:55:37 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 7/7] tests/fw_cfg: Run the tests on big-endian targets Date: Fri, 4 Oct 2019 00:54:37 +0200 Message-Id: <20191003225437.16651-8-philmd@redhat.com> In-Reply-To: <20191003225437.16651-1-philmd@redhat.com> References: <20191003225437.16651-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 03 Oct 2019 22:55:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Li Qiang , Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , Laszlo Ersek Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é --- 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);