[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/44] tests/pxe: Check virtio-net-ccw on s390x
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 06/44] tests/pxe: Check virtio-net-ccw on s390x |
Date: |
Wed, 30 Aug 2017 18:52:14 +0200 |
From: Thomas Huth <address@hidden>
Now that we've got a firmware that can do TFTP booting on s390x (i.e.
the pc-bios/s390-netboot.img), we can enable the PXE tester for this
architecture, too.
Signed-off-by: Thomas Huth <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
tests/Makefile.include | 1 +
tests/boot-sector.c | 20 ++++++++++++++++++++
tests/pxe-test.c | 7 +++++++
3 files changed, 28 insertions(+)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 37c1bed683..ea0f15f70b 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -360,6 +360,7 @@ check-qtest-microblazeel-y = $(check-qtest-microblaze-y)
check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
check-qtest-s390x-y = tests/boot-serial-test$(EXESUF)
+check-qtest-s390x-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF)
check-qtest-generic-y += tests/qom-test$(EXESUF)
check-qtest-generic-y += tests/test-hmp$(EXESUF)
diff --git a/tests/boot-sector.c b/tests/boot-sector.c
index 87295624d2..9ee85370b0 100644
--- a/tests/boot-sector.c
+++ b/tests/boot-sector.c
@@ -67,6 +67,21 @@ static uint8_t x86_boot_sector[512] = {
[0x1FF] = 0xAA,
};
+/* For s390x, use a mini "kernel" with the appropriate signature */
+static const uint8_t s390x_psw[] = {
+ 0x00, 0x08, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00
+};
+static const uint8_t s390x_code[] = {
+ 0xa7, 0xf4, 0x00, 0x0a, /* j 0x10010 */
+ 0x00, 0x00, 0x00, 0x00,
+ 'S', '3', '9', '0',
+ 'E', 'P', 0x00, 0x01,
+ 0xa7, 0x38, HIGH(SIGNATURE_ADDR), LOW(SIGNATURE_ADDR), /* lhi r3,0x7c10 */
+ 0xa7, 0x48, LOW(SIGNATURE), HIGH(SIGNATURE), /* lhi r4,0xadde */
+ 0x40, 0x40, 0x30, 0x00, /* sth r4,0(r3) */
+ 0xa7, 0xf4, 0xff, 0xfa /* j 0x10010 */
+};
+
/* Create boot disk file. */
int boot_sector_init(char *fname)
{
@@ -92,6 +107,11 @@ int boot_sector_init(char *fname)
LOW(SIGNATURE), SIGNATURE_ADDR,
HIGH(SIGNATURE), SIGNATURE_ADDR + 1);
len = strlen(boot_code);
+ } else if (g_str_equal(arch, "s390x")) {
+ len = 0x10000 + sizeof(s390x_code);
+ boot_code = g_malloc0(len);
+ memcpy(boot_code, s390x_psw, sizeof(s390x_psw));
+ memcpy(&boot_code[0x10000], s390x_code, sizeof(s390x_code));
} else {
g_assert_not_reached();
}
diff --git a/tests/pxe-test.c b/tests/pxe-test.c
index cf6e225330..0d70afccd6 100644
--- a/tests/pxe-test.c
+++ b/tests/pxe-test.c
@@ -51,6 +51,11 @@ static void test_pxe_spapr_vlan(void)
test_pxe_one("-device spapr-vlan,netdev=" NETNAME, true);
}
+static void test_pxe_virtio_ccw(void)
+{
+ test_pxe_one("-device virtio-net-ccw,bootindex=1,netdev=" NETNAME, false);
+}
+
int main(int argc, char *argv[])
{
int ret;
@@ -68,6 +73,8 @@ int main(int argc, char *argv[])
} else if (strcmp(arch, "ppc64") == 0) {
qtest_add_func("pxe/virtio", test_pxe_virtio_pci);
qtest_add_func("pxe/spapr-vlan", test_pxe_spapr_vlan);
+ } else if (g_str_equal(arch, "s390x")) {
+ qtest_add_func("pxe/virtio-ccw", test_pxe_virtio_ccw);
}
ret = g_test_run();
boot_sector_cleanup(disk);
--
2.13.5
- [Qemu-devel] [PULL 00/44] first batch of s390x patches for 2.11, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 01/44] s390x/css: use macro for event-information pending error recover code, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 02/44] s390x/css: generate solicited crw for rchp completion signaling, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 03/44] s390x: introduce 2.11 compat machine, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 04/44] s390x/ipl: The s390-ipl device is not hot-pluggable, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 05/44] tests/boot-sector: Do not overwrite the x86 buffer on other architectures, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 06/44] tests/pxe: Check virtio-net-ccw on s390x,
Cornelia Huck <=
- [Qemu-devel] [PULL 07/44] tests: Run filter-redirector and -mirror test only on POSIX systems, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 08/44] tests: Add network filter tests to the check-qtest-s390x list, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 10/44] watchdog/wdt_diag288: Mark diag288 watchdog as non-hotpluggable, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 09/44] s390x/tcg: specification exception for unknown diag, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 11/44] s390x: wire up diag288 in tcg, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 12/44] configure: enable --s390-pgste linker option, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 13/44] 9pfs: fix dependencies, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 14/44] kvm: remove hard dependency on pci, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 15/44] s390x/pci: add stubs, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 16/44] s390x: chsc nt2 events are pci-only, Cornelia Huck, 2017/08/30