From nobody Mon Apr 29 01:36:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518439695651908.4143874099872; Mon, 12 Feb 2018 04:48:15 -0800 (PST) Received: from localhost ([::1]:54351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elDWo-00027s-Kz for importer@patchew.org; Mon, 12 Feb 2018 07:48:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elDTd-00005D-Ql for qemu-devel@nongnu.org; Mon, 12 Feb 2018 07:44:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elDTa-0003OR-Cm for qemu-devel@nongnu.org; Mon, 12 Feb 2018 07:44:57 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57164 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1elDTa-0003NR-6l; Mon, 12 Feb 2018 07:44:54 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 86F2F4040073; Mon, 12 Feb 2018 12:44:53 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-132.ams2.redhat.com [10.36.116.132]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62DEA2166BAE; Mon, 12 Feb 2018 12:44:51 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 12 Feb 2018 13:44:46 +0100 Message-Id: <1518439489-2724-2-git-send-email-thuth@redhat.com> In-Reply-To: <1518439489-2724-1-git-send-email-thuth@redhat.com> References: <1518439489-2724-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 12 Feb 2018 12:44:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 12 Feb 2018 12:44:53 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 1/4] tests/m48t59: Fix and re-enable the test for sparc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The m48t59 test has been disabled in commit baeddded5fe6fa37d13fb94bf8d ("sparc: disable qtest in make check"), likely due to some timing issues in the bcd_check_time tests which might fail if it gets interrupted for too long. It should be OK to re-enable this test if we make sure that we do not run it on timing-sensitive machines, thus it should be OK if we only run it in the g_test_slow() mode. Additionally, there are two other issues: First, the test can not run so easily on sparc64 anymore, since commit f3b18f35a23c60edbda6420cd ("sun4u: switch m48t59 NVRAM to MMIO access") moved the m48t59 device to the ebus instead, and for this you first have to set up the corresponding PCI device (which is currently not possible from within the m48t59 test). So we can only re-enable this test on sparc, but not the sparc64 target. Second, the fuzzing test is executed before the bcd-check-time test (due to the naming of the tests), without having the base address set up properly, so the fuzzing test does not really check anything at all. Fix it by setting up the base address from the main function already and by moving the qtest_start() to the tests themselves, so that each test starts with a clean environment (since after the fuzzing, the clock is unusable for the bcd-check-time test). Signed-off-by: Thomas Huth --- tests/Makefile.include | 6 ++---- tests/m48t59-test.c | 58 ++++++++++++++++++++++++++++------------------= ---- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 5d430e5..78bd163 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -350,13 +350,11 @@ check-qtest-sh4-y =3D tests/endianness-test$(EXESUF) check-qtest-sh4eb-y =3D tests/endianness-test$(EXESUF) =20 check-qtest-sparc-y =3D tests/prom-env-test$(EXESUF) -#check-qtest-sparc-y +=3D tests/m48t59-test$(EXESUF) -#gcov-files-sparc-y =3D hw/timer/m48t59.c +check-qtest-sparc-y +=3D tests/m48t59-test$(EXESUF) +gcov-files-sparc-y =3D hw/timer/m48t59.c check-qtest-sparc-y +=3D tests/boot-serial-test$(EXESUF) =20 check-qtest-sparc64-y =3D tests/endianness-test$(EXESUF) -#check-qtest-sparc64-y +=3D tests/m48t59-test$(EXESUF) -#gcov-files-sparc64-y +=3D hw/timer/m48t59.c check-qtest-sparc64-y +=3D tests/prom-env-test$(EXESUF) check-qtest-sparc64-y +=3D tests/boot-serial-test$(EXESUF) =20 diff --git a/tests/m48t59-test.c b/tests/m48t59-test.c index 0f921ef..a85f84d 100644 --- a/tests/m48t59-test.c +++ b/tests/m48t59-test.c @@ -143,11 +143,18 @@ static void cmos_get_date_time(struct tm *date) ts =3D mktime(date); } =20 -static void check_time(int wiggle) +static QTestState *m48t59_qtest_start(void) +{ + return qtest_start("-rtc clock=3Dvm"); +} + +static void bcd_check_time(void) { struct tm start, date[4], end; struct tm *datep; time_t ts; + const int wiggle =3D 2; + QTestState *s =3D m48t59_qtest_start(); =20 /* * This check assumes a few things. First, we cannot guarantee that w= e get @@ -198,30 +205,15 @@ static void check_time(int wiggle) =20 g_assert_cmpint(ABS(t - s), <=3D, wiggle); } -} - -static int wiggle =3D 2; =20 -static void bcd_check_time(void) -{ - if (strcmp(qtest_get_arch(), "sparc64") =3D=3D 0) { - base =3D 0x74; - base_year =3D 1900; - use_mmio =3D false; - } else if (strcmp(qtest_get_arch(), "sparc") =3D=3D 0) { - base =3D 0x71200000; - base_year =3D 1968; - use_mmio =3D true; - } else { /* PPC: need to map macio in PCI */ - g_assert_not_reached(); - } - check_time(wiggle); + qtest_quit(s); } =20 /* success if no crash or abort */ static void fuzz_registers(void) { unsigned int i; + QTestState *s =3D m48t59_qtest_start(); =20 for (i =3D 0; i < 1000; i++) { uint8_t reg, val; @@ -237,24 +229,38 @@ static void fuzz_registers(void) cmos_write(reg, val); cmos_read(reg); } + + qtest_quit(s); +} + +static void base_setup(void) +{ + const char *arch =3D qtest_get_arch(); + + if (g_str_equal(arch, "sparc")) { + /* Note: For sparc64, we'd need to map-in the PCI bridge memory fi= rst */ + base =3D 0x71200000; + base_year =3D 1968; + use_mmio =3D true; + } else { + g_assert_not_reached(); + } } =20 int main(int argc, char **argv) { - QTestState *s =3D NULL; int ret; =20 - g_test_init(&argc, &argv, NULL); + base_setup(); =20 - s =3D qtest_start("-rtc clock=3Dvm"); + g_test_init(&argc, &argv, NULL); =20 - qtest_add_func("/rtc/bcd/check-time", bcd_check_time); + if (g_test_slow()) { + /* Do not run this in timing-sensitive environments */ + qtest_add_func("/rtc/bcd-check-time", bcd_check_time); + } qtest_add_func("/rtc/fuzz-registers", fuzz_registers); ret =3D g_test_run(); =20 - if (s) { - qtest_quit(s); - } - return ret; } --=20 1.8.3.1 From nobody Mon Apr 29 01:36:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518439655405696.1698526225824; Mon, 12 Feb 2018 04:47:35 -0800 (PST) Received: from localhost ([::1]:54349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elDW7-0001c6-7V for importer@patchew.org; Mon, 12 Feb 2018 07:47:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elDTd-00005E-Qv for qemu-devel@nongnu.org; Mon, 12 Feb 2018 07:44:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elDTc-0003QK-0w for qemu-devel@nongnu.org; Mon, 12 Feb 2018 07:44:57 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57168 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1elDTb-0003Pt-SG; Mon, 12 Feb 2018 07:44:55 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 60CB1404084B; Mon, 12 Feb 2018 12:44:55 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-132.ams2.redhat.com [10.36.116.132]) by smtp.corp.redhat.com (Postfix) with ESMTP id E4C302166BAE; Mon, 12 Feb 2018 12:44:53 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 12 Feb 2018 13:44:47 +0100 Message-Id: <1518439489-2724-3-git-send-email-thuth@redhat.com> In-Reply-To: <1518439489-2724-1-git-send-email-thuth@redhat.com> References: <1518439489-2724-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 12 Feb 2018 12:44:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 12 Feb 2018 12:44:55 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 2/4] tests/m48t59: Make the test independent of global_qtest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Stop using the functions that require global_qtest here and pass around the QTestState instead (global_qtest should finally get removed since this causes problems with tests running in parallel). Signed-off-by: Thomas Huth Reviewed-by: Eric Blake --- tests/m48t59-test.c | 60 ++++++++++++++++++++++++++-----------------------= ---- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/m48t59-test.c b/tests/m48t59-test.c index a85f84d..8c25467 100644 --- a/tests/m48t59-test.c +++ b/tests/m48t59-test.c @@ -30,45 +30,45 @@ static uint16_t reg_base =3D 0x1ff0; /* 0x7f0 for m48t0= 2 */ static int base_year; static bool use_mmio; =20 -static uint8_t cmos_read_mmio(uint8_t reg) +static uint8_t cmos_read_mmio(QTestState *s, uint8_t reg) { - return readb(base + (uint32_t)reg_base + (uint32_t)reg); + return qtest_readb(s, base + (uint32_t)reg_base + (uint32_t)reg); } =20 -static void cmos_write_mmio(uint8_t reg, uint8_t val) +static void cmos_write_mmio(QTestState *s, uint8_t reg, uint8_t val) { uint8_t data =3D val; =20 - writeb(base + (uint32_t)reg_base + (uint32_t)reg, data); + qtest_writeb(s, base + (uint32_t)reg_base + (uint32_t)reg, data); } =20 -static uint8_t cmos_read_ioio(uint8_t reg) +static uint8_t cmos_read_ioio(QTestState *s, uint8_t reg) { - outw(base + 0, reg_base + (uint16_t)reg); - return inb(base + 3); + qtest_outw(s, base + 0, reg_base + (uint16_t)reg); + return qtest_inb(s, base + 3); } =20 -static void cmos_write_ioio(uint8_t reg, uint8_t val) +static void cmos_write_ioio(QTestState *s, uint8_t reg, uint8_t val) { - outw(base + 0, reg_base + (uint16_t)reg); - outb(base + 3, val); + qtest_outw(s, base + 0, reg_base + (uint16_t)reg); + qtest_outb(s, base + 3, val); } =20 -static uint8_t cmos_read(uint8_t reg) +static uint8_t cmos_read(QTestState *s, uint8_t reg) { if (use_mmio) { - return cmos_read_mmio(reg); + return cmos_read_mmio(s, reg); } else { - return cmos_read_ioio(reg); + return cmos_read_ioio(s, reg); } } =20 -static void cmos_write(uint8_t reg, uint8_t val) +static void cmos_write(QTestState *s, uint8_t reg, uint8_t val) { if (use_mmio) { - cmos_write_mmio(reg, val); + cmos_write_mmio(s, reg, val); } else { - cmos_write_ioio(reg, val); + cmos_write_ioio(s, reg, val); } } =20 @@ -106,18 +106,18 @@ static void print_tm(struct tm *tm) } #endif =20 -static void cmos_get_date_time(struct tm *date) +static void cmos_get_date_time(QTestState *s, struct tm *date) { int sec, min, hour, mday, mon, year; time_t ts; struct tm dummy; =20 - sec =3D cmos_read(RTC_SECONDS); - min =3D cmos_read(RTC_MINUTES); - hour =3D cmos_read(RTC_HOURS); - mday =3D cmos_read(RTC_DAY_OF_MONTH); - mon =3D cmos_read(RTC_MONTH); - year =3D cmos_read(RTC_YEAR); + sec =3D cmos_read(s, RTC_SECONDS); + min =3D cmos_read(s, RTC_MINUTES); + hour =3D cmos_read(s, RTC_HOURS); + mday =3D cmos_read(s, RTC_DAY_OF_MONTH); + mon =3D cmos_read(s, RTC_MONTH); + year =3D cmos_read(s, RTC_YEAR); =20 sec =3D bcd2dec(sec); min =3D bcd2dec(min); @@ -145,7 +145,7 @@ static void cmos_get_date_time(struct tm *date) =20 static QTestState *m48t59_qtest_start(void) { - return qtest_start("-rtc clock=3Dvm"); + return qtest_init("-rtc clock=3Dvm"); } =20 static void bcd_check_time(void) @@ -172,10 +172,10 @@ static void bcd_check_time(void) ts =3D time(NULL); gmtime_r(&ts, &start); =20 - cmos_get_date_time(&date[0]); - cmos_get_date_time(&date[1]); - cmos_get_date_time(&date[2]); - cmos_get_date_time(&date[3]); + cmos_get_date_time(s, &date[0]); + cmos_get_date_time(s, &date[1]); + cmos_get_date_time(s, &date[2]); + cmos_get_date_time(s, &date[3]); =20 ts =3D time(NULL); gmtime_r(&ts, &end); @@ -226,8 +226,8 @@ static void fuzz_registers(void) continue; } =20 - cmos_write(reg, val); - cmos_read(reg); + cmos_write(s, reg, val); + cmos_read(s, reg); } =20 qtest_quit(s); --=20 1.8.3.1 From nobody Mon Apr 29 01:36:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151843986324327.742678945466082; Mon, 12 Feb 2018 04:51:03 -0800 (PST) Received: from localhost ([::1]:54712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elDZW-0004wQ-74 for importer@patchew.org; Mon, 12 Feb 2018 07:51:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elDTe-00006W-QY for qemu-devel@nongnu.org; Mon, 12 Feb 2018 07:45:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elDTd-0003Rw-Rg for qemu-devel@nongnu.org; Mon, 12 Feb 2018 07:44:58 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57172 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1elDTd-0003Rh-MZ; Mon, 12 Feb 2018 07:44:57 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A1F94040851; Mon, 12 Feb 2018 12:44:57 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-132.ams2.redhat.com [10.36.116.132]) by smtp.corp.redhat.com (Postfix) with ESMTP id A58652166BAE; Mon, 12 Feb 2018 12:44:55 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 12 Feb 2018 13:44:48 +0100 Message-Id: <1518439489-2724-4-git-send-email-thuth@redhat.com> In-Reply-To: <1518439489-2724-1-git-send-email-thuth@redhat.com> References: <1518439489-2724-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 12 Feb 2018 12:44:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 12 Feb 2018 12:44:57 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 3/4] tests/Makefile: Derive check-qtest-ppc64-y from check-qtest-ppc-y X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" ppc64 is a superset of ppc, so the ppc64 tests should include all the ppc tests. Signed-off-by: Thomas Huth --- tests/Makefile.include | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 78bd163..3ac874c 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -319,15 +319,12 @@ check-qtest-ppc-y +=3D tests/prom-env-test$(EXESUF) check-qtest-ppc-y +=3D tests/drive_del-test$(EXESUF) check-qtest-ppc-y +=3D tests/boot-serial-test$(EXESUF) =20 -check-qtest-ppc64-y =3D tests/spapr-phb-test$(EXESUF) -gcov-files-ppc64-y =3D ppc64-softmmu/hw/ppc/spapr_pci.c -check-qtest-ppc64-y +=3D tests/endianness-test$(EXESUF) -check-qtest-ppc64-y +=3D tests/boot-order-test$(EXESUF) -check-qtest-ppc64-y +=3D tests/prom-env-test$(EXESUF) +check-qtest-ppc64-y =3D $(check-qtest-ppc-y) +gcov-files-ppc64-y =3D $(subst ppc-softmmu/,ppc64-softmmu/,$(gcov-files-pp= c-y)) +check-qtest-ppc64-y +=3D tests/spapr-phb-test$(EXESUF) +gcov-files-ppc64-y +=3D ppc64-softmmu/hw/ppc/spapr_pci.c check-qtest-ppc64-y +=3D tests/pnv-xscom-test$(EXESUF) -check-qtest-ppc64-y +=3D tests/drive_del-test$(EXESUF) check-qtest-ppc64-y +=3D tests/migration-test$(EXESUF) -check-qtest-ppc64-y +=3D tests/boot-serial-test$(EXESUF) check-qtest-ppc64-y +=3D tests/rtas-test$(EXESUF) check-qtest-ppc64-$(CONFIG_SLIRP) +=3D tests/pxe-test$(EXESUF) check-qtest-ppc64-y +=3D tests/usb-hcd-ohci-test$(EXESUF) --=20 1.8.3.1 From nobody Mon Apr 29 01:36:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518439654105477.8882029740448; Mon, 12 Feb 2018 04:47:34 -0800 (PST) Received: from localhost ([::1]:54350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elDW9-0001dp-7C for importer@patchew.org; Mon, 12 Feb 2018 07:47:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elDTg-00008g-QN for qemu-devel@nongnu.org; Mon, 12 Feb 2018 07:45:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elDTf-0003Tp-3o for qemu-devel@nongnu.org; Mon, 12 Feb 2018 07:45:00 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53048 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1elDTe-0003T6-Sn; Mon, 12 Feb 2018 07:44:58 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5989AEAE91; Mon, 12 Feb 2018 12:44:58 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-132.ams2.redhat.com [10.36.116.132]) by smtp.corp.redhat.com (Postfix) with ESMTP id 939DE2166BAE; Mon, 12 Feb 2018 12:44:57 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 12 Feb 2018 13:44:49 +0100 Message-Id: <1518439489-2724-5-git-send-email-thuth@redhat.com> In-Reply-To: <1518439489-2724-1-git-send-email-thuth@redhat.com> References: <1518439489-2724-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 12 Feb 2018 12:44:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 12 Feb 2018 12:44:58 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 4/4] tests/m48t59: Add the m48t59 test on ppc, too X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The ref405ep machine has a memory-mapped m48t59 device, so we can run the m48t59 test on this machine, too. Signed-off-by: Thomas Huth --- tests/Makefile.include | 2 ++ tests/m48t59-test.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 3ac874c..d46807a 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -318,6 +318,8 @@ check-qtest-ppc-y +=3D tests/boot-order-test$(EXESUF) check-qtest-ppc-y +=3D tests/prom-env-test$(EXESUF) check-qtest-ppc-y +=3D tests/drive_del-test$(EXESUF) check-qtest-ppc-y +=3D tests/boot-serial-test$(EXESUF) +check-qtest-ppc-y +=3D tests/m48t59-test$(EXESUF) +gcov-files-ppc-y +=3D hw/timer/m48t59.c =20 check-qtest-ppc64-y =3D $(check-qtest-ppc-y) gcov-files-ppc64-y =3D $(subst ppc-softmmu/,ppc64-softmmu/,$(gcov-files-pp= c-y)) diff --git a/tests/m48t59-test.c b/tests/m48t59-test.c index 8c25467..26af7d6 100644 --- a/tests/m48t59-test.c +++ b/tests/m48t59-test.c @@ -28,6 +28,7 @@ static uint32_t base; static uint16_t reg_base =3D 0x1ff0; /* 0x7f0 for m48t02 */ static int base_year; +static const char *base_machine; static bool use_mmio; =20 static uint8_t cmos_read_mmio(QTestState *s, uint8_t reg) @@ -145,7 +146,7 @@ static void cmos_get_date_time(QTestState *s, struct tm= *date) =20 static QTestState *m48t59_qtest_start(void) { - return qtest_init("-rtc clock=3Dvm"); + return qtest_startf("-M %s -rtc clock=3Dvm", base_machine); } =20 static void bcd_check_time(void) @@ -241,6 +242,12 @@ static void base_setup(void) /* Note: For sparc64, we'd need to map-in the PCI bridge memory fi= rst */ base =3D 0x71200000; base_year =3D 1968; + base_machine =3D "SS-5"; + use_mmio =3D true; + } else if (g_str_equal(arch, "ppc") || g_str_equal(arch, "ppc64")) { + base =3D 0xF0000000; + base_year =3D 1968; + base_machine =3D "ref405ep"; use_mmio =3D true; } else { g_assert_not_reached(); --=20 1.8.3.1