* [Qemu-devel] [PATCH 0/4] qtest: enable several tests for ppc64
@ 2016-12-12 23:28 Laurent Vivier
2016-12-12 23:28 ` [Qemu-devel] [PATCH 1/4] qtest: add netfilter " Laurent Vivier
` (3 more replies)
0 siblings, 4 replies; 16+ messages in thread
From: Laurent Vivier @ 2016-12-12 23:28 UTC (permalink / raw)
To: qemu-devel; +Cc: David Gibson, qemu-ppc, Greg Kurz, Laurent Vivier
This series enables some tests existing for i386 and which
can also work on ppc64.
VGA tests and netfilter tests are trivial, but ivshmem test
needs to enable the SPAPR PCI framework. We also fix a bug
in qpci_map() for SPAPR, where the PCI base is not correctly
set in the CPU address space.
Laurent Vivier (4):
qtest: add netfilter tests for ppc64
qtest: add display-vga-test to ppc64
libqos: fix spapr qpci_map()
qtest: add ivshmem-test for ppc64
tests/Makefile.include | 7 ++++++-
tests/display-vga-test.c | 7 ++++++-
tests/ivshmem-test.c | 46 +++++++++++++++++++++++++++++-----------------
tests/libqos/pci-spapr.c | 4 ++--
4 files changed, 43 insertions(+), 21 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 1/4] qtest: add netfilter tests for ppc64
2016-12-12 23:28 [Qemu-devel] [PATCH 0/4] qtest: enable several tests for ppc64 Laurent Vivier
@ 2016-12-12 23:28 ` Laurent Vivier
2016-12-13 8:04 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2016-12-13 12:15 ` [Qemu-devel] " Greg Kurz
2016-12-12 23:28 ` [Qemu-devel] [PATCH 2/4] qtest: add display-vga-test to ppc64 Laurent Vivier
` (2 subsequent siblings)
3 siblings, 2 replies; 16+ messages in thread
From: Laurent Vivier @ 2016-12-12 23:28 UTC (permalink / raw)
To: qemu-devel; +Cc: David Gibson, qemu-ppc, Greg Kurz, Laurent Vivier
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
tests/Makefile.include | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index e98d3b6..be6209d 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -283,6 +283,9 @@ gcov-files-ppc64-y += hw/usb/hcd-uhci.c
check-qtest-ppc64-y += tests/usb-hcd-xhci-test$(EXESUF)
gcov-files-ppc64-y += hw/usb/hcd-xhci.c
check-qtest-ppc64-y += $(check-qtest-virtio-y)
+check-qtest-ppc64-y += tests/test-netfilter$(EXESUF)
+check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF)
+check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF)
check-qtest-sh4-y = tests/endianness-test$(EXESUF)
--
2.7.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 2/4] qtest: add display-vga-test to ppc64
2016-12-12 23:28 [Qemu-devel] [PATCH 0/4] qtest: enable several tests for ppc64 Laurent Vivier
2016-12-12 23:28 ` [Qemu-devel] [PATCH 1/4] qtest: add netfilter " Laurent Vivier
@ 2016-12-12 23:28 ` Laurent Vivier
2016-12-13 8:40 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2016-12-13 12:16 ` [Qemu-devel] " Greg Kurz
2016-12-12 23:28 ` [Qemu-devel] [PATCH 3/4] libqos: fix spapr qpci_map() Laurent Vivier
2016-12-12 23:28 ` [Qemu-devel] [PATCH 4/4] qtest: add ivshmem-test for ppc64 Laurent Vivier
3 siblings, 2 replies; 16+ messages in thread
From: Laurent Vivier @ 2016-12-12 23:28 UTC (permalink / raw)
To: qemu-devel; +Cc: David Gibson, qemu-ppc, Greg Kurz, Laurent Vivier
Only enable for ppc64 in the Makefile, but added
code in the file to check cirrus card only on architectures
supporting it (alpha, mips, i386, x86_64).
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
tests/Makefile.include | 1 +
tests/display-vga-test.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index be6209d..b574964 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -286,6 +286,7 @@ check-qtest-ppc64-y += $(check-qtest-virtio-y)
check-qtest-ppc64-y += tests/test-netfilter$(EXESUF)
check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF)
check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF)
+check-qtest-ppc64-y += tests/display-vga-test$(EXESUF)
check-qtest-sh4-y = tests/endianness-test$(EXESUF)
diff --git a/tests/display-vga-test.c b/tests/display-vga-test.c
index 9146021..2d7d24e 100644
--- a/tests/display-vga-test.c
+++ b/tests/display-vga-test.c
@@ -50,9 +50,14 @@ static void pci_virtio_vga(void)
int main(int argc, char **argv)
{
+ const char *arch = qtest_get_arch();
+
g_test_init(&argc, &argv, NULL);
- qtest_add_func("/display/pci/cirrus", pci_cirrus);
+ if (strcmp(arch, "alpha") == 0 || strcmp(arch, "i386") == 0 ||
+ strcmp(arch, "mips") == 0 || strcmp(arch, "x86_64") == 0) {
+ qtest_add_func("/display/pci/cirrus", pci_cirrus);
+ }
qtest_add_func("/display/pci/stdvga", pci_stdvga);
qtest_add_func("/display/pci/secondary", pci_secondary);
qtest_add_func("/display/pci/multihead", pci_multihead);
--
2.7.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 3/4] libqos: fix spapr qpci_map()
2016-12-12 23:28 [Qemu-devel] [PATCH 0/4] qtest: enable several tests for ppc64 Laurent Vivier
2016-12-12 23:28 ` [Qemu-devel] [PATCH 1/4] qtest: add netfilter " Laurent Vivier
2016-12-12 23:28 ` [Qemu-devel] [PATCH 2/4] qtest: add display-vga-test to ppc64 Laurent Vivier
@ 2016-12-12 23:28 ` Laurent Vivier
2016-12-13 8:46 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2016-12-12 23:28 ` [Qemu-devel] [PATCH 4/4] qtest: add ivshmem-test for ppc64 Laurent Vivier
3 siblings, 1 reply; 16+ messages in thread
From: Laurent Vivier @ 2016-12-12 23:28 UTC (permalink / raw)
To: qemu-devel; +Cc: David Gibson, qemu-ppc, Greg Kurz, Laurent Vivier
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
tests/libqos/pci-spapr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c
index 1e5d015..2043f1e 100644
--- a/tests/libqos/pci-spapr.c
+++ b/tests/libqos/pci-spapr.c
@@ -193,8 +193,8 @@ QPCIBus *qpci_init_spapr(QGuestAllocator *alloc)
ret->pio.size = SPAPR_PCI_IO_WIN_SIZE;
/* 32-bit portion of the MMIO window is at PCI address 2..4 GiB */
- ret->mmio32_cpu_base = SPAPR_PCI_BASE + SPAPR_PCI_MMIO32_WIN_SIZE;
- ret->mmio32.pci_base = 0x80000000; /* 2 GiB */
+ ret->mmio32_cpu_base = SPAPR_PCI_BASE;
+ ret->mmio32.pci_base = SPAPR_PCI_MMIO32_WIN_SIZE;
ret->mmio32.size = SPAPR_PCI_MMIO32_WIN_SIZE;
ret->bus.pio_alloc_ptr = 0xc000;
--
2.7.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 4/4] qtest: add ivshmem-test for ppc64
2016-12-12 23:28 [Qemu-devel] [PATCH 0/4] qtest: enable several tests for ppc64 Laurent Vivier
` (2 preceding siblings ...)
2016-12-12 23:28 ` [Qemu-devel] [PATCH 3/4] libqos: fix spapr qpci_map() Laurent Vivier
@ 2016-12-12 23:28 ` Laurent Vivier
2016-12-13 7:55 ` Markus Armbruster
3 siblings, 1 reply; 16+ messages in thread
From: Laurent Vivier @ 2016-12-12 23:28 UTC (permalink / raw)
To: qemu-devel; +Cc: David Gibson, qemu-ppc, Greg Kurz, Laurent Vivier
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
tests/Makefile.include | 3 ++-
tests/ivshmem-test.c | 46 +++++++++++++++++++++++++++++-----------------
2 files changed, 31 insertions(+), 18 deletions(-)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index b574964..09fe5b6 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -287,6 +287,7 @@ check-qtest-ppc64-y += tests/test-netfilter$(EXESUF)
check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF)
check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF)
check-qtest-ppc64-y += tests/display-vga-test$(EXESUF)
+check-qtest-ppc64-y += tests/ivshmem-test$(EXESUF)
check-qtest-sh4-y = tests/endianness-test$(EXESUF)
@@ -690,7 +691,7 @@ tests/test-netfilter$(EXESUF): tests/test-netfilter.o $(qtest-obj-y)
tests/test-filter-mirror$(EXESUF): tests/test-filter-mirror.o $(qtest-obj-y)
tests/test-filter-redirector$(EXESUF): tests/test-filter-redirector.o $(qtest-obj-y)
tests/test-x86-cpuid-compat$(EXESUF): tests/test-x86-cpuid-compat.o $(qtest-obj-y)
-tests/ivshmem-test$(EXESUF): tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y)
+tests/ivshmem-test$(EXESUF): tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y)
tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o
tests/test-uuid$(EXESUF): tests/test-uuid.o $(test-util-obj-y)
tests/test-arm-mptimer$(EXESUF): tests/test-arm-mptimer.o
diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c
index 04a5c5d..5c6dc38 100644
--- a/tests/ivshmem-test.c
+++ b/tests/ivshmem-test.c
@@ -11,8 +11,9 @@
#include "qemu/osdep.h"
#include <glib/gstdio.h>
#include "contrib/ivshmem-server/ivshmem-server.h"
-#include "libqos/pci-pc.h"
#include "libqtest.h"
+#include "libqos/libqos-pc.h"
+#include "libqos/libqos-spapr.h"
#include "qemu-common.h"
#define TMPSHMSIZE (1 << 20)
@@ -40,9 +41,8 @@ static QPCIDevice *get_device(QPCIBus *pcibus)
}
typedef struct _IVState {
- QTestState *qtest;
+ QOSState *qs;
QPCIBar reg_bar, mem_bar;
- QPCIBus *pcibus;
QPCIDevice *dev;
} IVState;
@@ -74,7 +74,7 @@ static inline unsigned in_reg(IVState *s, enum Reg reg)
QTestState *qtest = global_qtest;
unsigned res;
- global_qtest = s->qtest;
+ global_qtest = s->qs->qts;
res = qpci_io_readl(s->dev, s->reg_bar, reg);
g_test_message("*%s -> %x\n", name, res);
global_qtest = qtest;
@@ -87,7 +87,7 @@ static inline void out_reg(IVState *s, enum Reg reg, unsigned v)
const char *name = reg2str(reg);
QTestState *qtest = global_qtest;
- global_qtest = s->qtest;
+ global_qtest = s->qs->qts;
g_test_message("%x -> *%s\n", v, name);
qpci_io_writel(s->dev, s->reg_bar, reg, v);
global_qtest = qtest;
@@ -97,7 +97,7 @@ static inline void read_mem(IVState *s, uint64_t off, void *buf, size_t len)
{
QTestState *qtest = global_qtest;
- global_qtest = s->qtest;
+ global_qtest = s->qs->qts;
qpci_memread(s->dev, s->mem_bar, off, buf, len);
global_qtest = qtest;
}
@@ -107,7 +107,7 @@ static inline void write_mem(IVState *s, uint64_t off,
{
QTestState *qtest = global_qtest;
- global_qtest = s->qtest;
+ global_qtest = s->qs->qts;
qpci_memwrite(s->dev, s->mem_bar, off, buf, len);
global_qtest = qtest;
}
@@ -115,17 +115,23 @@ static inline void write_mem(IVState *s, uint64_t off,
static void cleanup_vm(IVState *s)
{
g_free(s->dev);
- qpci_free_pc(s->pcibus);
- qtest_quit(s->qtest);
+ qtest_shutdown(s->qs);
}
static void setup_vm_cmd(IVState *s, const char *cmd, bool msix)
{
uint64_t barsize;
+ const char *arch = qtest_get_arch();
- s->qtest = qtest_start(cmd);
- s->pcibus = qpci_init_pc(NULL);
- s->dev = get_device(s->pcibus);
+ if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+ s->qs = qtest_pc_boot(cmd);
+ } else if (strcmp(arch, "ppc64") == 0) {
+ s->qs = qtest_spapr_boot(cmd);
+ } else {
+ g_printerr("vshmem-test tests are only available on x86 or ppc64\n");
+ exit(EXIT_FAILURE);
+ }
+ s->dev = get_device(s->qs->pcibus);
s->reg_bar = qpci_iomap(s->dev, 0, &barsize);
g_assert_cmpuint(barsize, ==, 256);
@@ -347,7 +353,7 @@ static void test_ivshmem_server(bool msi)
g_assert_cmpint(vm1, !=, vm2);
/* check number of MSI-X vectors */
- global_qtest = s1->qtest;
+ global_qtest = s1->qs->qts;
if (msi) {
ret = qpci_msix_table_size(s1->dev);
g_assert_cmpuint(ret, ==, nvectors);
@@ -370,7 +376,7 @@ static void test_ivshmem_server(bool msi)
g_assert_cmpuint(ret, !=, 0);
/* ping vm1 -> vm2 on vector 1 */
- global_qtest = s2->qtest;
+ global_qtest = s2->qs->qts;
if (msi) {
ret = qpci_msix_pending(s2->dev, 1);
g_assert_cmpuint(ret, ==, 0);
@@ -412,6 +418,7 @@ static void test_ivshmem_server_irq(void)
static void test_ivshmem_hotplug(void)
{
+ const char *arch = qtest_get_arch();
gchar *opts;
qtest_start("");
@@ -419,7 +426,9 @@ static void test_ivshmem_hotplug(void)
opts = g_strdup_printf("'shm': '%s', 'size': '1M'", tmpshm);
qpci_plug_device_test("ivshmem", "iv1", PCI_SLOT_HP, opts);
- qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP);
+ if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+ qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP);
+ }
qtest_end();
g_free(opts);
@@ -491,6 +500,7 @@ static gchar *mktempshm(int size, int *fd)
int main(int argc, char **argv)
{
int ret, fd;
+ const char *arch = qtest_get_arch();
gchar dir[] = "/tmp/ivshmem-test.XXXXXX";
#if !GLIB_CHECK_VERSION(2, 31, 0)
@@ -521,8 +531,10 @@ int main(int argc, char **argv)
qtest_add_func("/ivshmem/memdev", test_ivshmem_memdev);
if (g_test_slow()) {
qtest_add_func("/ivshmem/pair", test_ivshmem_pair);
- qtest_add_func("/ivshmem/server-msi", test_ivshmem_server_msi);
- qtest_add_func("/ivshmem/server-irq", test_ivshmem_server_irq);
+ if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+ qtest_add_func("/ivshmem/server-msi", test_ivshmem_server_msi);
+ qtest_add_func("/ivshmem/server-irq", test_ivshmem_server_irq);
+ }
}
ret = g_test_run();
--
2.7.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 4/4] qtest: add ivshmem-test for ppc64
2016-12-12 23:28 ` [Qemu-devel] [PATCH 4/4] qtest: add ivshmem-test for ppc64 Laurent Vivier
@ 2016-12-13 7:55 ` Markus Armbruster
2016-12-13 8:18 ` Laurent Vivier
0 siblings, 1 reply; 16+ messages in thread
From: Markus Armbruster @ 2016-12-13 7:55 UTC (permalink / raw)
To: Laurent Vivier; +Cc: qemu-devel, qemu-ppc, Greg Kurz, David Gibson
Laurent Vivier <lvivier@redhat.com> writes:
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> tests/Makefile.include | 3 ++-
> tests/ivshmem-test.c | 46 +++++++++++++++++++++++++++++-----------------
> 2 files changed, 31 insertions(+), 18 deletions(-)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index b574964..09fe5b6 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -287,6 +287,7 @@ check-qtest-ppc64-y += tests/test-netfilter$(EXESUF)
> check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF)
> check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF)
> check-qtest-ppc64-y += tests/display-vga-test$(EXESUF)
> +check-qtest-ppc64-y += tests/ivshmem-test$(EXESUF)
>
> check-qtest-sh4-y = tests/endianness-test$(EXESUF)
>
> @@ -690,7 +691,7 @@ tests/test-netfilter$(EXESUF): tests/test-netfilter.o $(qtest-obj-y)
> tests/test-filter-mirror$(EXESUF): tests/test-filter-mirror.o $(qtest-obj-y)
> tests/test-filter-redirector$(EXESUF): tests/test-filter-redirector.o $(qtest-obj-y)
> tests/test-x86-cpuid-compat$(EXESUF): tests/test-x86-cpuid-compat.o $(qtest-obj-y)
> -tests/ivshmem-test$(EXESUF): tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y)
> +tests/ivshmem-test$(EXESUF): tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y)
> tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o
> tests/test-uuid$(EXESUF): tests/test-uuid.o $(test-util-obj-y)
> tests/test-arm-mptimer$(EXESUF): tests/test-arm-mptimer.o
> diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c
> index 04a5c5d..5c6dc38 100644
> --- a/tests/ivshmem-test.c
> +++ b/tests/ivshmem-test.c
> @@ -11,8 +11,9 @@
> #include "qemu/osdep.h"
> #include <glib/gstdio.h>
> #include "contrib/ivshmem-server/ivshmem-server.h"
> -#include "libqos/pci-pc.h"
> #include "libqtest.h"
> +#include "libqos/libqos-pc.h"
> +#include "libqos/libqos-spapr.h"
> #include "qemu-common.h"
>
> #define TMPSHMSIZE (1 << 20)
> @@ -40,9 +41,8 @@ static QPCIDevice *get_device(QPCIBus *pcibus)
> }
>
> typedef struct _IVState {
> - QTestState *qtest;
> + QOSState *qs;
> QPCIBar reg_bar, mem_bar;
> - QPCIBus *pcibus;
> QPCIDevice *dev;
> } IVState;
>
> @@ -74,7 +74,7 @@ static inline unsigned in_reg(IVState *s, enum Reg reg)
> QTestState *qtest = global_qtest;
> unsigned res;
>
> - global_qtest = s->qtest;
> + global_qtest = s->qs->qts;
> res = qpci_io_readl(s->dev, s->reg_bar, reg);
> g_test_message("*%s -> %x\n", name, res);
> global_qtest = qtest;
> @@ -87,7 +87,7 @@ static inline void out_reg(IVState *s, enum Reg reg, unsigned v)
> const char *name = reg2str(reg);
> QTestState *qtest = global_qtest;
>
> - global_qtest = s->qtest;
> + global_qtest = s->qs->qts;
> g_test_message("%x -> *%s\n", v, name);
> qpci_io_writel(s->dev, s->reg_bar, reg, v);
> global_qtest = qtest;
> @@ -97,7 +97,7 @@ static inline void read_mem(IVState *s, uint64_t off, void *buf, size_t len)
> {
> QTestState *qtest = global_qtest;
>
> - global_qtest = s->qtest;
> + global_qtest = s->qs->qts;
> qpci_memread(s->dev, s->mem_bar, off, buf, len);
> global_qtest = qtest;
> }
> @@ -107,7 +107,7 @@ static inline void write_mem(IVState *s, uint64_t off,
> {
> QTestState *qtest = global_qtest;
>
> - global_qtest = s->qtest;
> + global_qtest = s->qs->qts;
> qpci_memwrite(s->dev, s->mem_bar, off, buf, len);
> global_qtest = qtest;
> }
> @@ -115,17 +115,23 @@ static inline void write_mem(IVState *s, uint64_t off,
> static void cleanup_vm(IVState *s)
> {
> g_free(s->dev);
> - qpci_free_pc(s->pcibus);
> - qtest_quit(s->qtest);
> + qtest_shutdown(s->qs);
> }
>
> static void setup_vm_cmd(IVState *s, const char *cmd, bool msix)
> {
> uint64_t barsize;
> + const char *arch = qtest_get_arch();
>
> - s->qtest = qtest_start(cmd);
> - s->pcibus = qpci_init_pc(NULL);
> - s->dev = get_device(s->pcibus);
> + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
> + s->qs = qtest_pc_boot(cmd);
> + } else if (strcmp(arch, "ppc64") == 0) {
> + s->qs = qtest_spapr_boot(cmd);
> + } else {
> + g_printerr("vshmem-test tests are only available on x86 or ppc64\n");
Typo: s/vshmem/ivshmem
To get here, you need to build and run this manually, as make check only
builds and runs this for targets that work. But the check doesn't hurt,
and documents expectations.
> + exit(EXIT_FAILURE);
> + }
> + s->dev = get_device(s->qs->pcibus);
>
> s->reg_bar = qpci_iomap(s->dev, 0, &barsize);
> g_assert_cmpuint(barsize, ==, 256);
> @@ -347,7 +353,7 @@ static void test_ivshmem_server(bool msi)
> g_assert_cmpint(vm1, !=, vm2);
>
> /* check number of MSI-X vectors */
> - global_qtest = s1->qtest;
> + global_qtest = s1->qs->qts;
> if (msi) {
> ret = qpci_msix_table_size(s1->dev);
> g_assert_cmpuint(ret, ==, nvectors);
> @@ -370,7 +376,7 @@ static void test_ivshmem_server(bool msi)
> g_assert_cmpuint(ret, !=, 0);
>
> /* ping vm1 -> vm2 on vector 1 */
> - global_qtest = s2->qtest;
> + global_qtest = s2->qs->qts;
> if (msi) {
> ret = qpci_msix_pending(s2->dev, 1);
> g_assert_cmpuint(ret, ==, 0);
> @@ -412,6 +418,7 @@ static void test_ivshmem_server_irq(void)
>
> static void test_ivshmem_hotplug(void)
> {
> + const char *arch = qtest_get_arch();
> gchar *opts;
>
> qtest_start("");
Unlike the other tests, this one doesn't refuse to run on unexpected
targets. Intentional?
> @@ -419,7 +426,9 @@ static void test_ivshmem_hotplug(void)
> opts = g_strdup_printf("'shm': '%s', 'size': '1M'", tmpshm);
>
> qpci_plug_device_test("ivshmem", "iv1", PCI_SLOT_HP, opts);
> - qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP);
> + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
> + qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP);
> + }
Disables unplug test for ppc64.
>
> qtest_end();
> g_free(opts);
> @@ -491,6 +500,7 @@ static gchar *mktempshm(int size, int *fd)
> int main(int argc, char **argv)
> {
> int ret, fd;
> + const char *arch = qtest_get_arch();
> gchar dir[] = "/tmp/ivshmem-test.XXXXXX";
>
> #if !GLIB_CHECK_VERSION(2, 31, 0)
> @@ -521,8 +531,10 @@ int main(int argc, char **argv)
> qtest_add_func("/ivshmem/memdev", test_ivshmem_memdev);
> if (g_test_slow()) {
> qtest_add_func("/ivshmem/pair", test_ivshmem_pair);
> - qtest_add_func("/ivshmem/server-msi", test_ivshmem_server_msi);
> - qtest_add_func("/ivshmem/server-irq", test_ivshmem_server_irq);
> + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
> + qtest_add_func("/ivshmem/server-msi", test_ivshmem_server_msi);
> + qtest_add_func("/ivshmem/server-irq", test_ivshmem_server_irq);
> + }
> }
>
> ret = g_test_run();
The commit message should explain things in a bit more detail: the test
works only for x86, and is only compiled and executed for x86. The
patch converts it to libqos, adds ppc64, and makes the test fail for
targets that don't work. It also disables the unplug part of test
/ivshmem/hotplug for ppc64; please explain why.
Please make the conversion to libqos a separate patch, for easier
review.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/4] qtest: add netfilter tests for ppc64
2016-12-12 23:28 ` [Qemu-devel] [PATCH 1/4] qtest: add netfilter " Laurent Vivier
@ 2016-12-13 8:04 ` Thomas Huth
2016-12-13 12:15 ` [Qemu-devel] " Greg Kurz
1 sibling, 0 replies; 16+ messages in thread
From: Thomas Huth @ 2016-12-13 8:04 UTC (permalink / raw)
To: Laurent Vivier, qemu-devel; +Cc: qemu-ppc, Greg Kurz, David Gibson
On 13.12.2016 00:28, Laurent Vivier wrote:
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> tests/Makefile.include | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index e98d3b6..be6209d 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -283,6 +283,9 @@ gcov-files-ppc64-y += hw/usb/hcd-uhci.c
> check-qtest-ppc64-y += tests/usb-hcd-xhci-test$(EXESUF)
> gcov-files-ppc64-y += hw/usb/hcd-xhci.c
> check-qtest-ppc64-y += $(check-qtest-virtio-y)
> +check-qtest-ppc64-y += tests/test-netfilter$(EXESUF)
> +check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF)
> +check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF)
>
> check-qtest-sh4-y = tests/endianness-test$(EXESUF)
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 4/4] qtest: add ivshmem-test for ppc64
2016-12-13 7:55 ` Markus Armbruster
@ 2016-12-13 8:18 ` Laurent Vivier
2016-12-13 8:55 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
0 siblings, 1 reply; 16+ messages in thread
From: Laurent Vivier @ 2016-12-13 8:18 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel, qemu-ppc, Greg Kurz, David Gibson
On 13/12/2016 08:55, Markus Armbruster wrote:
> Laurent Vivier <lvivier@redhat.com> writes:
>
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> ---
>> tests/Makefile.include | 3 ++-
>> tests/ivshmem-test.c | 46 +++++++++++++++++++++++++++++-----------------
>> 2 files changed, 31 insertions(+), 18 deletions(-)
>>
>> diff --git a/tests/Makefile.include b/tests/Makefile.include
>> index b574964..09fe5b6 100644
>> --- a/tests/Makefile.include
>> +++ b/tests/Makefile.include
>> @@ -287,6 +287,7 @@ check-qtest-ppc64-y += tests/test-netfilter$(EXESUF)
>> check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF)
>> check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF)
>> check-qtest-ppc64-y += tests/display-vga-test$(EXESUF)
>> +check-qtest-ppc64-y += tests/ivshmem-test$(EXESUF)
>>
>> check-qtest-sh4-y = tests/endianness-test$(EXESUF)
>>
>> @@ -690,7 +691,7 @@ tests/test-netfilter$(EXESUF): tests/test-netfilter.o $(qtest-obj-y)
>> tests/test-filter-mirror$(EXESUF): tests/test-filter-mirror.o $(qtest-obj-y)
>> tests/test-filter-redirector$(EXESUF): tests/test-filter-redirector.o $(qtest-obj-y)
>> tests/test-x86-cpuid-compat$(EXESUF): tests/test-x86-cpuid-compat.o $(qtest-obj-y)
>> -tests/ivshmem-test$(EXESUF): tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y)
>> +tests/ivshmem-test$(EXESUF): tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y)
>> tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o
>> tests/test-uuid$(EXESUF): tests/test-uuid.o $(test-util-obj-y)
>> tests/test-arm-mptimer$(EXESUF): tests/test-arm-mptimer.o
>> diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c
>> index 04a5c5d..5c6dc38 100644
>> --- a/tests/ivshmem-test.c
>> +++ b/tests/ivshmem-test.c
>> @@ -11,8 +11,9 @@
>> #include "qemu/osdep.h"
>> #include <glib/gstdio.h>
>> #include "contrib/ivshmem-server/ivshmem-server.h"
>> -#include "libqos/pci-pc.h"
>> #include "libqtest.h"
>> +#include "libqos/libqos-pc.h"
>> +#include "libqos/libqos-spapr.h"
>> #include "qemu-common.h"
>>
>> #define TMPSHMSIZE (1 << 20)
>> @@ -40,9 +41,8 @@ static QPCIDevice *get_device(QPCIBus *pcibus)
>> }
>>
>> typedef struct _IVState {
>> - QTestState *qtest;
>> + QOSState *qs;
>> QPCIBar reg_bar, mem_bar;
>> - QPCIBus *pcibus;
>> QPCIDevice *dev;
>> } IVState;
>>
>> @@ -74,7 +74,7 @@ static inline unsigned in_reg(IVState *s, enum Reg reg)
>> QTestState *qtest = global_qtest;
>> unsigned res;
>>
>> - global_qtest = s->qtest;
>> + global_qtest = s->qs->qts;
>> res = qpci_io_readl(s->dev, s->reg_bar, reg);
>> g_test_message("*%s -> %x\n", name, res);
>> global_qtest = qtest;
>> @@ -87,7 +87,7 @@ static inline void out_reg(IVState *s, enum Reg reg, unsigned v)
>> const char *name = reg2str(reg);
>> QTestState *qtest = global_qtest;
>>
>> - global_qtest = s->qtest;
>> + global_qtest = s->qs->qts;
>> g_test_message("%x -> *%s\n", v, name);
>> qpci_io_writel(s->dev, s->reg_bar, reg, v);
>> global_qtest = qtest;
>> @@ -97,7 +97,7 @@ static inline void read_mem(IVState *s, uint64_t off, void *buf, size_t len)
>> {
>> QTestState *qtest = global_qtest;
>>
>> - global_qtest = s->qtest;
>> + global_qtest = s->qs->qts;
>> qpci_memread(s->dev, s->mem_bar, off, buf, len);
>> global_qtest = qtest;
>> }
>> @@ -107,7 +107,7 @@ static inline void write_mem(IVState *s, uint64_t off,
>> {
>> QTestState *qtest = global_qtest;
>>
>> - global_qtest = s->qtest;
>> + global_qtest = s->qs->qts;
>> qpci_memwrite(s->dev, s->mem_bar, off, buf, len);
>> global_qtest = qtest;
>> }
>> @@ -115,17 +115,23 @@ static inline void write_mem(IVState *s, uint64_t off,
>> static void cleanup_vm(IVState *s)
>> {
>> g_free(s->dev);
>> - qpci_free_pc(s->pcibus);
>> - qtest_quit(s->qtest);
>> + qtest_shutdown(s->qs);
>> }
>>
>> static void setup_vm_cmd(IVState *s, const char *cmd, bool msix)
>> {
>> uint64_t barsize;
>> + const char *arch = qtest_get_arch();
>>
>> - s->qtest = qtest_start(cmd);
>> - s->pcibus = qpci_init_pc(NULL);
>> - s->dev = get_device(s->pcibus);
>> + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
>> + s->qs = qtest_pc_boot(cmd);
>> + } else if (strcmp(arch, "ppc64") == 0) {
>> + s->qs = qtest_spapr_boot(cmd);
>> + } else {
>> + g_printerr("vshmem-test tests are only available on x86 or ppc64\n");
>
> Typo: s/vshmem/ivshmem
>
> To get here, you need to build and run this manually, as make check only
> builds and runs this for targets that work. But the check doesn't hurt,
> and documents expectations.
>
>> + exit(EXIT_FAILURE);
>> + }
>> + s->dev = get_device(s->qs->pcibus);
>>
>> s->reg_bar = qpci_iomap(s->dev, 0, &barsize);
>> g_assert_cmpuint(barsize, ==, 256);
>> @@ -347,7 +353,7 @@ static void test_ivshmem_server(bool msi)
>> g_assert_cmpint(vm1, !=, vm2);
>>
>> /* check number of MSI-X vectors */
>> - global_qtest = s1->qtest;
>> + global_qtest = s1->qs->qts;
>> if (msi) {
>> ret = qpci_msix_table_size(s1->dev);
>> g_assert_cmpuint(ret, ==, nvectors);
>> @@ -370,7 +376,7 @@ static void test_ivshmem_server(bool msi)
>> g_assert_cmpuint(ret, !=, 0);
>>
>> /* ping vm1 -> vm2 on vector 1 */
>> - global_qtest = s2->qtest;
>> + global_qtest = s2->qs->qts;
>> if (msi) {
>> ret = qpci_msix_pending(s2->dev, 1);
>> g_assert_cmpuint(ret, ==, 0);
>> @@ -412,6 +418,7 @@ static void test_ivshmem_server_irq(void)
>>
>> static void test_ivshmem_hotplug(void)
>> {
>> + const char *arch = qtest_get_arch();
>> gchar *opts;
>>
>> qtest_start("");
>
> Unlike the other tests, this one doesn't refuse to run on unexpected
> targets. Intentional?
Yes, because there is no dependencies on libqos PCI implementation, so
it should always work.
>> @@ -419,7 +426,9 @@ static void test_ivshmem_hotplug(void)
>> opts = g_strdup_printf("'shm': '%s', 'size': '1M'", tmpshm);
>>
>> qpci_plug_device_test("ivshmem", "iv1", PCI_SLOT_HP, opts);
>> - qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP);
>> + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
>> + qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP);
>> + }
>
> Disables unplug test for ppc64.
>
>>
>> qtest_end();
>> g_free(opts);
>> @@ -491,6 +500,7 @@ static gchar *mktempshm(int size, int *fd)
>> int main(int argc, char **argv)
>> {
>> int ret, fd;
>> + const char *arch = qtest_get_arch();
>> gchar dir[] = "/tmp/ivshmem-test.XXXXXX";
>>
>> #if !GLIB_CHECK_VERSION(2, 31, 0)
>> @@ -521,8 +531,10 @@ int main(int argc, char **argv)
>> qtest_add_func("/ivshmem/memdev", test_ivshmem_memdev);
>> if (g_test_slow()) {
>> qtest_add_func("/ivshmem/pair", test_ivshmem_pair);
>> - qtest_add_func("/ivshmem/server-msi", test_ivshmem_server_msi);
>> - qtest_add_func("/ivshmem/server-irq", test_ivshmem_server_irq);
>> + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
>> + qtest_add_func("/ivshmem/server-msi", test_ivshmem_server_msi);
>> + qtest_add_func("/ivshmem/server-irq", test_ivshmem_server_irq);
>> + }
>> }
>>
>> ret = g_test_run();
>
> The commit message should explain things in a bit more detail: the test
> works only for x86, and is only compiled and executed for x86. The
> patch converts it to libqos, adds ppc64, and makes the test fail for
> targets that don't work. It also disables the unplug part of test
> /ivshmem/hotplug for ppc64; please explain why.
>
> Please make the conversion to libqos a separate patch, for easier
> review.
>
Thank you for the review.
I'm going to change this patch according to your comments.
Laurent
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/4] qtest: add display-vga-test to ppc64
2016-12-12 23:28 ` [Qemu-devel] [PATCH 2/4] qtest: add display-vga-test to ppc64 Laurent Vivier
@ 2016-12-13 8:40 ` Thomas Huth
2016-12-13 12:03 ` Laurent Vivier
2016-12-13 12:16 ` [Qemu-devel] " Greg Kurz
1 sibling, 1 reply; 16+ messages in thread
From: Thomas Huth @ 2016-12-13 8:40 UTC (permalink / raw)
To: Laurent Vivier, qemu-devel; +Cc: qemu-ppc, Greg Kurz, David Gibson
On 13.12.2016 00:28, Laurent Vivier wrote:
> Only enable for ppc64 in the Makefile, but added
> code in the file to check cirrus card only on architectures
> supporting it (alpha, mips, i386, x86_64).
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> tests/Makefile.include | 1 +
> tests/display-vga-test.c | 7 ++++++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index be6209d..b574964 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -286,6 +286,7 @@ check-qtest-ppc64-y += $(check-qtest-virtio-y)
> check-qtest-ppc64-y += tests/test-netfilter$(EXESUF)
> check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF)
> check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF)
> +check-qtest-ppc64-y += tests/display-vga-test$(EXESUF)
>
> check-qtest-sh4-y = tests/endianness-test$(EXESUF)
>
> diff --git a/tests/display-vga-test.c b/tests/display-vga-test.c
> index 9146021..2d7d24e 100644
> --- a/tests/display-vga-test.c
> +++ b/tests/display-vga-test.c
> @@ -50,9 +50,14 @@ static void pci_virtio_vga(void)
>
> int main(int argc, char **argv)
> {
> + const char *arch = qtest_get_arch();
> +
> g_test_init(&argc, &argv, NULL);
>
> - qtest_add_func("/display/pci/cirrus", pci_cirrus);
> + if (strcmp(arch, "alpha") == 0 || strcmp(arch, "i386") == 0 ||
> + strcmp(arch, "mips") == 0 || strcmp(arch, "x86_64") == 0) {
> + qtest_add_func("/display/pci/cirrus", pci_cirrus);
> + }
> qtest_add_func("/display/pci/stdvga", pci_stdvga);
> qtest_add_func("/display/pci/secondary", pci_secondary);
> qtest_add_func("/display/pci/multihead", pci_multihead);
Alternatively, I think you could also check the result of
qtest_hmp(global_qtest, "info qdm")
to see whether cirrus-vga is available ... but not sure, whether that's
really nicer, so:
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/4] libqos: fix spapr qpci_map()
2016-12-12 23:28 ` [Qemu-devel] [PATCH 3/4] libqos: fix spapr qpci_map() Laurent Vivier
@ 2016-12-13 8:46 ` Thomas Huth
2016-12-13 11:58 ` Laurent Vivier
0 siblings, 1 reply; 16+ messages in thread
From: Thomas Huth @ 2016-12-13 8:46 UTC (permalink / raw)
To: Laurent Vivier, qemu-devel; +Cc: qemu-ppc, Greg Kurz, David Gibson
A short patch description would be nice here.
On 13.12.2016 00:28, Laurent Vivier wrote:
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> tests/libqos/pci-spapr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c
> index 1e5d015..2043f1e 100644
> --- a/tests/libqos/pci-spapr.c
> +++ b/tests/libqos/pci-spapr.c
> @@ -193,8 +193,8 @@ QPCIBus *qpci_init_spapr(QGuestAllocator *alloc)
> ret->pio.size = SPAPR_PCI_IO_WIN_SIZE;
>
> /* 32-bit portion of the MMIO window is at PCI address 2..4 GiB */
> - ret->mmio32_cpu_base = SPAPR_PCI_BASE + SPAPR_PCI_MMIO32_WIN_SIZE;
> - ret->mmio32.pci_base = 0x80000000; /* 2 GiB */
> + ret->mmio32_cpu_base = SPAPR_PCI_BASE;
> + ret->mmio32.pci_base = SPAPR_PCI_MMIO32_WIN_SIZE;
> ret->mmio32.size = SPAPR_PCI_MMIO32_WIN_SIZE;
Not sure whether it is really right to use SPAPR_PCI_MMIO32_WIN_SIZE for
the pci_base? I mean, the WIN_SIZE could also be 1G for example, but the
base could still be at 2G ? IMHO it's better to keep the old value for
pci_base here.
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 4/4] qtest: add ivshmem-test for ppc64
2016-12-13 8:18 ` Laurent Vivier
@ 2016-12-13 8:55 ` Thomas Huth
2016-12-13 12:25 ` Laurent Vivier
0 siblings, 1 reply; 16+ messages in thread
From: Thomas Huth @ 2016-12-13 8:55 UTC (permalink / raw)
To: Laurent Vivier, Markus Armbruster
Cc: David Gibson, qemu-ppc, qemu-devel, Greg Kurz
On 13.12.2016 09:18, Laurent Vivier wrote:
>
>
> On 13/12/2016 08:55, Markus Armbruster wrote:
>> Laurent Vivier <lvivier@redhat.com> writes:
...
>>> @@ -419,7 +426,9 @@ static void test_ivshmem_hotplug(void)
>>> opts = g_strdup_printf("'shm': '%s', 'size': '1M'", tmpshm);
>>>
>>> qpci_plug_device_test("ivshmem", "iv1", PCI_SLOT_HP, opts);
>>> - qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP);
>>> + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
>>> + qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP);
>>> + }
>>
>> Disables unplug test for ppc64.
We don't have acpi on POWER ... but PCI unplug should be possible
without ACPI, too, shouldn't it? So maybe you could add a PCI unplug
function for ppc64, too?
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/4] libqos: fix spapr qpci_map()
2016-12-13 8:46 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
@ 2016-12-13 11:58 ` Laurent Vivier
0 siblings, 0 replies; 16+ messages in thread
From: Laurent Vivier @ 2016-12-13 11:58 UTC (permalink / raw)
To: Thomas Huth, qemu-devel; +Cc: qemu-ppc, Greg Kurz, David Gibson
On 13/12/2016 09:46, Thomas Huth wrote:
> A short patch description would be nice here.
>
> On 13.12.2016 00:28, Laurent Vivier wrote:
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> ---
>> tests/libqos/pci-spapr.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c
>> index 1e5d015..2043f1e 100644
>> --- a/tests/libqos/pci-spapr.c
>> +++ b/tests/libqos/pci-spapr.c
>> @@ -193,8 +193,8 @@ QPCIBus *qpci_init_spapr(QGuestAllocator *alloc)
>> ret->pio.size = SPAPR_PCI_IO_WIN_SIZE;
>>
>> /* 32-bit portion of the MMIO window is at PCI address 2..4 GiB */
>> - ret->mmio32_cpu_base = SPAPR_PCI_BASE + SPAPR_PCI_MMIO32_WIN_SIZE;
>> - ret->mmio32.pci_base = 0x80000000; /* 2 GiB */
>> + ret->mmio32_cpu_base = SPAPR_PCI_BASE;
>> + ret->mmio32.pci_base = SPAPR_PCI_MMIO32_WIN_SIZE;
>> ret->mmio32.size = SPAPR_PCI_MMIO32_WIN_SIZE;
>
> Not sure whether it is really right to use SPAPR_PCI_MMIO32_WIN_SIZE for
> the pci_base? I mean, the WIN_SIZE could also be 1G for example, but the
> base could still be at 2G ? IMHO it's better to keep the old value for
> pci_base here.
in hw/ppc/spapr.c, we have:
*mmio32 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM32_WIN_SIZE;
So I think it's logic to have the PCI base at SPAPR_PCI_MMIO32_WIN_SIZE.
Thanks for your review,
Laurent
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/4] qtest: add display-vga-test to ppc64
2016-12-13 8:40 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
@ 2016-12-13 12:03 ` Laurent Vivier
0 siblings, 0 replies; 16+ messages in thread
From: Laurent Vivier @ 2016-12-13 12:03 UTC (permalink / raw)
To: Thomas Huth, qemu-devel; +Cc: qemu-ppc, Greg Kurz, David Gibson
On 13/12/2016 09:40, Thomas Huth wrote:
> On 13.12.2016 00:28, Laurent Vivier wrote:
>> Only enable for ppc64 in the Makefile, but added
>> code in the file to check cirrus card only on architectures
>> supporting it (alpha, mips, i386, x86_64).
>>
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> ---
>> tests/Makefile.include | 1 +
>> tests/display-vga-test.c | 7 ++++++-
>> 2 files changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/Makefile.include b/tests/Makefile.include
>> index be6209d..b574964 100644
>> --- a/tests/Makefile.include
>> +++ b/tests/Makefile.include
>> @@ -286,6 +286,7 @@ check-qtest-ppc64-y += $(check-qtest-virtio-y)
>> check-qtest-ppc64-y += tests/test-netfilter$(EXESUF)
>> check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF)
>> check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF)
>> +check-qtest-ppc64-y += tests/display-vga-test$(EXESUF)
>>
>> check-qtest-sh4-y = tests/endianness-test$(EXESUF)
>>
>> diff --git a/tests/display-vga-test.c b/tests/display-vga-test.c
>> index 9146021..2d7d24e 100644
>> --- a/tests/display-vga-test.c
>> +++ b/tests/display-vga-test.c
>> @@ -50,9 +50,14 @@ static void pci_virtio_vga(void)
>>
>> int main(int argc, char **argv)
>> {
>> + const char *arch = qtest_get_arch();
>> +
>> g_test_init(&argc, &argv, NULL);
>>
>> - qtest_add_func("/display/pci/cirrus", pci_cirrus);
>> + if (strcmp(arch, "alpha") == 0 || strcmp(arch, "i386") == 0 ||
>> + strcmp(arch, "mips") == 0 || strcmp(arch, "x86_64") == 0) {
>> + qtest_add_func("/display/pci/cirrus", pci_cirrus);
>> + }
>> qtest_add_func("/display/pci/stdvga", pci_stdvga);
>> qtest_add_func("/display/pci/secondary", pci_secondary);
>> qtest_add_func("/display/pci/multihead", pci_multihead);
>
> Alternatively, I think you could also check the result of
> qtest_hmp(global_qtest, "info qdm")
> to see whether cirrus-vga is available ... but not sure, whether that's
> really nicer, so:
I think it's too complicated for a so simple test (it only starts the
machine with "-device XXX")
> Reviewed-by: Thomas Huth <thuth@redhat.com>
Thanks,
Laurent
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 1/4] qtest: add netfilter tests for ppc64
2016-12-12 23:28 ` [Qemu-devel] [PATCH 1/4] qtest: add netfilter " Laurent Vivier
2016-12-13 8:04 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
@ 2016-12-13 12:15 ` Greg Kurz
1 sibling, 0 replies; 16+ messages in thread
From: Greg Kurz @ 2016-12-13 12:15 UTC (permalink / raw)
To: Laurent Vivier; +Cc: qemu-devel, David Gibson, qemu-ppc
On Tue, 13 Dec 2016 00:28:33 +0100
Laurent Vivier <lvivier@redhat.com> wrote:
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> tests/Makefile.include | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index e98d3b6..be6209d 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -283,6 +283,9 @@ gcov-files-ppc64-y += hw/usb/hcd-uhci.c
> check-qtest-ppc64-y += tests/usb-hcd-xhci-test$(EXESUF)
> gcov-files-ppc64-y += hw/usb/hcd-xhci.c
> check-qtest-ppc64-y += $(check-qtest-virtio-y)
> +check-qtest-ppc64-y += tests/test-netfilter$(EXESUF)
> +check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF)
> +check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF)
>
> check-qtest-sh4-y = tests/endianness-test$(EXESUF)
>
Reviewed-by: Greg Kurz <groug@kaod.org>
And this what I get on x86, x86_64, pp64 and ppc64le hosts:
TEST: tests/test-netfilter... (pid=1433)
/ppc64/netfilter/addremove_one: OK
/ppc64/netfilter/remove_netdev_one: OK
/ppc64/netfilter/addremove_multi: OK
/ppc64/netfilter/remove_netdev_multi: OK
PASS: tests/test-netfilter
TEST: tests/test-filter-mirror... (pid=1441)
/ppc64/netfilter/mirror: OK
PASS: tests/test-filter-mirror
so
Tested-by: Greg Kurz <groug@kaod.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 2/4] qtest: add display-vga-test to ppc64
2016-12-12 23:28 ` [Qemu-devel] [PATCH 2/4] qtest: add display-vga-test to ppc64 Laurent Vivier
2016-12-13 8:40 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
@ 2016-12-13 12:16 ` Greg Kurz
1 sibling, 0 replies; 16+ messages in thread
From: Greg Kurz @ 2016-12-13 12:16 UTC (permalink / raw)
To: Laurent Vivier; +Cc: qemu-devel, David Gibson, qemu-ppc
On Tue, 13 Dec 2016 00:28:34 +0100
Laurent Vivier <lvivier@redhat.com> wrote:
> Only enable for ppc64 in the Makefile, but added
> code in the file to check cirrus card only on architectures
> supporting it (alpha, mips, i386, x86_64).
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> tests/Makefile.include | 1 +
> tests/display-vga-test.c | 7 ++++++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index be6209d..b574964 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -286,6 +286,7 @@ check-qtest-ppc64-y += $(check-qtest-virtio-y)
> check-qtest-ppc64-y += tests/test-netfilter$(EXESUF)
> check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF)
> check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF)
> +check-qtest-ppc64-y += tests/display-vga-test$(EXESUF)
>
> check-qtest-sh4-y = tests/endianness-test$(EXESUF)
>
> diff --git a/tests/display-vga-test.c b/tests/display-vga-test.c
> index 9146021..2d7d24e 100644
> --- a/tests/display-vga-test.c
> +++ b/tests/display-vga-test.c
> @@ -50,9 +50,14 @@ static void pci_virtio_vga(void)
>
> int main(int argc, char **argv)
> {
> + const char *arch = qtest_get_arch();
> +
> g_test_init(&argc, &argv, NULL);
>
> - qtest_add_func("/display/pci/cirrus", pci_cirrus);
> + if (strcmp(arch, "alpha") == 0 || strcmp(arch, "i386") == 0 ||
> + strcmp(arch, "mips") == 0 || strcmp(arch, "x86_64") == 0) {
> + qtest_add_func("/display/pci/cirrus", pci_cirrus);
> + }
> qtest_add_func("/display/pci/stdvga", pci_stdvga);
> qtest_add_func("/display/pci/secondary", pci_secondary);
> qtest_add_func("/display/pci/multihead", pci_multihead);
Reviewed-by: Greg Kurz <groug@kaod.org>
TEST: tests/display-vga-test... (pid=1462)
/ppc64/display/pci/stdvga: OK
/ppc64/display/pci/secondary: OK
/ppc64/display/pci/multihead: OK
/ppc64/display/pci/virtio-gpu: OK
PASS: tests/display-vga-test
Tested-by: Greg Kurz <groug@kaod.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 4/4] qtest: add ivshmem-test for ppc64
2016-12-13 8:55 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
@ 2016-12-13 12:25 ` Laurent Vivier
0 siblings, 0 replies; 16+ messages in thread
From: Laurent Vivier @ 2016-12-13 12:25 UTC (permalink / raw)
To: Thomas Huth, Markus Armbruster
Cc: David Gibson, qemu-ppc, qemu-devel, Greg Kurz
On 13/12/2016 09:55, Thomas Huth wrote:
> On 13.12.2016 09:18, Laurent Vivier wrote:
>>
>>
>> On 13/12/2016 08:55, Markus Armbruster wrote:
>>> Laurent Vivier <lvivier@redhat.com> writes:
> ...
>>>> @@ -419,7 +426,9 @@ static void test_ivshmem_hotplug(void)
>>>> opts = g_strdup_printf("'shm': '%s', 'size': '1M'", tmpshm);
>>>>
>>>> qpci_plug_device_test("ivshmem", "iv1", PCI_SLOT_HP, opts);
>>>> - qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP);
>>>> + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
>>>> + qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP);
>>>> + }
>>>
>>> Disables unplug test for ppc64.
>
> We don't have acpi on POWER ... but PCI unplug should be possible
> without ACPI, too, shouldn't it? So maybe you could add a PCI unplug
> function for ppc64, too?
Good idea, I will check if we can implement this.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2016-12-13 12:25 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-12 23:28 [Qemu-devel] [PATCH 0/4] qtest: enable several tests for ppc64 Laurent Vivier
2016-12-12 23:28 ` [Qemu-devel] [PATCH 1/4] qtest: add netfilter " Laurent Vivier
2016-12-13 8:04 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2016-12-13 12:15 ` [Qemu-devel] " Greg Kurz
2016-12-12 23:28 ` [Qemu-devel] [PATCH 2/4] qtest: add display-vga-test to ppc64 Laurent Vivier
2016-12-13 8:40 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2016-12-13 12:03 ` Laurent Vivier
2016-12-13 12:16 ` [Qemu-devel] " Greg Kurz
2016-12-12 23:28 ` [Qemu-devel] [PATCH 3/4] libqos: fix spapr qpci_map() Laurent Vivier
2016-12-13 8:46 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2016-12-13 11:58 ` Laurent Vivier
2016-12-12 23:28 ` [Qemu-devel] [PATCH 4/4] qtest: add ivshmem-test for ppc64 Laurent Vivier
2016-12-13 7:55 ` Markus Armbruster
2016-12-13 8:18 ` Laurent Vivier
2016-12-13 8:55 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2016-12-13 12:25 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).