From patchwork Mon Jan 14 10:01:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761971 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75C0F6C2 for ; Mon, 14 Jan 2019 10:12:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 649A12880D for ; Mon, 14 Jan 2019 10:12:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5933928AB7; Mon, 14 Jan 2019 10:12:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5618B2880D for ; Mon, 14 Jan 2019 10:12:17 +0000 (UTC) Received: from localhost ([127.0.0.1]:34968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizE8-0005MM-Ik for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:12:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4q-0005Yy-Ru for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4j-0007Ne-2F for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59384) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4g-0007LH-UW for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:32 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF79789AC2; Mon, 14 Jan 2019 10:02:27 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFF4C101963E; Mon, 14 Jan 2019 10:02:26 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:01:56 +0100 Message-Id: <1547460140-1473-2-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 14 Jan 2019 10:02:28 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/25] hw/misc/ivshmem: Remove deprecated "ivshmem" legacy device 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP It's been marked as deprecated in QEMU v2.6.0 already, so really nobody should use the legacy "ivshmem" device anymore (but use ivshmem-plain or ivshmem-doorbell instead). Time to remove the deprecated device now. Belatedly also update a mention of the deprecated "ivshmem" in the file docs/specs/ivshmem-spec.txt to "ivshmem-doorbell". Missed in commit 5400c02b90b ("ivshmem: Split ivshmem-plain, ivshmem-doorbell off ivshmem"). Reviewed-by: Markus Armbruster Signed-off-by: Thomas Huth --- docs/specs/ivshmem-spec.txt | 8 +- hw/i386/pc_piix.c | 1 - hw/misc/ivshmem.c | 210 ++------------------------------------------ qemu-deprecated.texi | 5 -- scripts/device-crash-test | 1 - tests/ivshmem-test.c | 67 +++++--------- 6 files changed, 34 insertions(+), 258 deletions(-) diff --git a/docs/specs/ivshmem-spec.txt b/docs/specs/ivshmem-spec.txt index a1f5499..042f7ea 100644 --- a/docs/specs/ivshmem-spec.txt +++ b/docs/specs/ivshmem-spec.txt @@ -17,12 +17,16 @@ get interrupted by its peers. There are two basic configurations: -- Just shared memory: -device ivshmem-plain,memdev=HMB,... +- Just shared memory: + + -device ivshmem-plain,memdev=HMB,... This uses host memory backend HMB. It should have option "share" set. -- Shared memory plus interrupts: -device ivshmem,chardev=CHR,vectors=N,... +- Shared memory plus interrupts: + + -device ivshmem-doorbell,chardev=CHR,vectors=N,... An ivshmem server must already be running on the host. The device connects to the server's UNIX domain socket via character device diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 5088e2f..63c84e3 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -715,7 +715,6 @@ static void pc_i440fx_1_2_machine_options(MachineClass *m) PC_CPU_MODEL_IDS("1.2.0") { "nec-usb-xhci", "msi", "off" }, { "nec-usb-xhci", "msix", "off" }, - { "ivshmem", "use64", "0" }, { "qxl", "revision", "3" }, { "qxl-vga", "revision", "3" }, { "VGA", "mmio", "off" }, diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 8213659..c7b6bbc 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -112,13 +112,6 @@ typedef struct IVShmemState { /* migration stuff */ OnOffAuto master; Error *migration_blocker; - - /* legacy cruft */ - char *role; - char *shmobj; - char *sizearg; - size_t legacy_size; - uint32_t not_legacy_32bit; } IVShmemState; /* registers for the Inter-VM shared memory device */ @@ -529,17 +522,6 @@ static void process_msg_shmem(IVShmemState *s, int fd, Error **errp) size = buf.st_size; - /* Legacy cruft */ - if (s->legacy_size != SIZE_MAX) { - if (size < s->legacy_size) { - error_setg(errp, "server sent only %zd bytes of shared memory", - (size_t)buf.st_size); - close(fd); - return; - } - size = s->legacy_size; - } - /* mmap the region and map into the BAR2 */ memory_region_init_ram_from_fd(&s->server_bar2, OBJECT(s), "ivshmem.bar2", size, true, fd, &local_err); @@ -882,8 +864,6 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp) IVShmemState *s = IVSHMEM_COMMON(dev); Error *err = NULL; uint8_t *pci_conf; - uint8_t attr = PCI_BASE_ADDRESS_SPACE_MEMORY | - PCI_BASE_ADDRESS_MEM_PREFETCH; Error *local_err = NULL; /* IRQFD requires MSI */ @@ -903,10 +883,6 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp) pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->ivshmem_mmio); - if (s->not_legacy_32bit) { - attr |= PCI_BASE_ADDRESS_MEM_TYPE_64; - } - if (s->hostmem != NULL) { IVSHMEM_DPRINTF("using hostmem\n"); @@ -964,7 +940,11 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp) } vmstate_register_ram(s->ivshmem_bar2, DEVICE(s)); - pci_register_bar(PCI_DEVICE(s), 2, attr, s->ivshmem_bar2); + pci_register_bar(PCI_DEVICE(s), 2, + PCI_BASE_ADDRESS_SPACE_MEMORY | + PCI_BASE_ADDRESS_MEM_PREFETCH | + PCI_BASE_ADDRESS_MEM_TYPE_64, + s->ivshmem_bar2); } static void ivshmem_exit(PCIDevice *dev) @@ -1084,13 +1064,6 @@ static Property ivshmem_plain_properties[] = { DEFINE_PROP_END_OF_LIST(), }; -static void ivshmem_plain_init(Object *obj) -{ - IVShmemState *s = IVSHMEM_PLAIN(obj); - - s->not_legacy_32bit = 1; -} - static void ivshmem_plain_realize(PCIDevice *dev, Error **errp) { IVShmemState *s = IVSHMEM_COMMON(dev); @@ -1122,7 +1095,6 @@ static const TypeInfo ivshmem_plain_info = { .name = TYPE_IVSHMEM_PLAIN, .parent = TYPE_IVSHMEM_COMMON, .instance_size = sizeof(IVShmemState), - .instance_init = ivshmem_plain_init, .class_init = ivshmem_plain_class_init, }; @@ -1155,8 +1127,6 @@ static void ivshmem_doorbell_init(Object *obj) IVShmemState *s = IVSHMEM_DOORBELL(obj); s->features |= (1 << IVSHMEM_MSI); - s->legacy_size = SIZE_MAX; /* whatever the server sends */ - s->not_legacy_32bit = 1; } static void ivshmem_doorbell_realize(PCIDevice *dev, Error **errp) @@ -1189,181 +1159,11 @@ static const TypeInfo ivshmem_doorbell_info = { .class_init = ivshmem_doorbell_class_init, }; -static int ivshmem_load_old(QEMUFile *f, void *opaque, int version_id) -{ - IVShmemState *s = opaque; - PCIDevice *pdev = PCI_DEVICE(s); - int ret; - - IVSHMEM_DPRINTF("ivshmem_load_old\n"); - - if (version_id != 0) { - return -EINVAL; - } - - ret = ivshmem_pre_load(s); - if (ret) { - return ret; - } - - ret = pci_device_load(pdev, f); - if (ret) { - return ret; - } - - if (ivshmem_has_feature(s, IVSHMEM_MSI)) { - msix_load(pdev, f); - ivshmem_msix_vector_use(s); - } else { - s->intrstatus = qemu_get_be32(f); - s->intrmask = qemu_get_be32(f); - } - - return 0; -} - -static bool test_msix(void *opaque, int version_id) -{ - IVShmemState *s = opaque; - - return ivshmem_has_feature(s, IVSHMEM_MSI); -} - -static bool test_no_msix(void *opaque, int version_id) -{ - return !test_msix(opaque, version_id); -} - -static const VMStateDescription ivshmem_vmsd = { - .name = "ivshmem", - .version_id = 1, - .minimum_version_id = 1, - .pre_load = ivshmem_pre_load, - .post_load = ivshmem_post_load, - .fields = (VMStateField[]) { - VMSTATE_PCI_DEVICE(parent_obj, IVShmemState), - - VMSTATE_MSIX_TEST(parent_obj, IVShmemState, test_msix), - VMSTATE_UINT32_TEST(intrstatus, IVShmemState, test_no_msix), - VMSTATE_UINT32_TEST(intrmask, IVShmemState, test_no_msix), - - VMSTATE_END_OF_LIST() - }, - .load_state_old = ivshmem_load_old, - .minimum_version_id_old = 0 -}; - -static Property ivshmem_properties[] = { - DEFINE_PROP_CHR("chardev", IVShmemState, server_chr), - DEFINE_PROP_STRING("size", IVShmemState, sizearg), - DEFINE_PROP_UINT32("vectors", IVShmemState, vectors, 1), - DEFINE_PROP_BIT("ioeventfd", IVShmemState, features, IVSHMEM_IOEVENTFD, - false), - DEFINE_PROP_BIT("msi", IVShmemState, features, IVSHMEM_MSI, true), - DEFINE_PROP_STRING("shm", IVShmemState, shmobj), - DEFINE_PROP_STRING("role", IVShmemState, role), - DEFINE_PROP_UINT32("use64", IVShmemState, not_legacy_32bit, 1), - DEFINE_PROP_END_OF_LIST(), -}; - -static void desugar_shm(IVShmemState *s) -{ - Object *obj; - char *path; - - obj = object_new("memory-backend-file"); - path = g_strdup_printf("/dev/shm/%s", s->shmobj); - object_property_set_str(obj, path, "mem-path", &error_abort); - g_free(path); - object_property_set_int(obj, s->legacy_size, "size", &error_abort); - object_property_set_bool(obj, true, "share", &error_abort); - object_property_add_child(OBJECT(s), "internal-shm-backend", obj, - &error_abort); - object_unref(obj); - user_creatable_complete(USER_CREATABLE(obj), &error_abort); - s->hostmem = MEMORY_BACKEND(obj); -} - -static void ivshmem_realize(PCIDevice *dev, Error **errp) -{ - IVShmemState *s = IVSHMEM_COMMON(dev); - - if (!qtest_enabled()) { - warn_report("ivshmem is deprecated, please use ivshmem-plain" - " or ivshmem-doorbell instead"); - } - - if (qemu_chr_fe_backend_connected(&s->server_chr) + !!s->shmobj != 1) { - error_setg(errp, "You must specify either 'shm' or 'chardev'"); - return; - } - - if (s->sizearg == NULL) { - s->legacy_size = 4 * MiB; /* 4 MB default */ - } else { - int ret; - uint64_t size; - - ret = qemu_strtosz_MiB(s->sizearg, NULL, &size); - if (ret < 0 || (size_t)size != size || !is_power_of_2(size)) { - error_setg(errp, "Invalid size %s", s->sizearg); - return; - } - s->legacy_size = size; - } - - /* check that role is reasonable */ - if (s->role) { - if (strncmp(s->role, "peer", 5) == 0) { - s->master = ON_OFF_AUTO_OFF; - } else if (strncmp(s->role, "master", 7) == 0) { - s->master = ON_OFF_AUTO_ON; - } else { - error_setg(errp, "'role' must be 'peer' or 'master'"); - return; - } - } else { - s->master = ON_OFF_AUTO_AUTO; - } - - if (s->shmobj) { - desugar_shm(s); - } - - /* - * Note: we don't use INTx with IVSHMEM_MSI at all, so this is a - * bald-faced lie then. But it's a backwards compatible lie. - */ - pci_config_set_interrupt_pin(dev->config, 1); - - ivshmem_common_realize(dev, errp); -} - -static void ivshmem_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - - k->realize = ivshmem_realize; - k->revision = 0; - dc->desc = "Inter-VM shared memory (legacy)"; - dc->props = ivshmem_properties; - dc->vmsd = &ivshmem_vmsd; -} - -static const TypeInfo ivshmem_info = { - .name = TYPE_IVSHMEM, - .parent = TYPE_IVSHMEM_COMMON, - .instance_size = sizeof(IVShmemState), - .class_init = ivshmem_class_init, -}; - static void ivshmem_register_types(void) { type_register_static(&ivshmem_common_info); type_register_static(&ivshmem_plain_info); type_register_static(&ivshmem_doorbell_info); - type_register_static(&ivshmem_info); } type_init(ivshmem_register_types) diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 81de5fc..219206a 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -126,11 +126,6 @@ documentation of ``query-hotpluggable-cpus'' for additional details. @section System emulator devices -@subsection ivshmem (since 2.6.0) - -The ``ivshmem'' device type is replaced by either the ``ivshmem-plain'' -or ``ivshmem-doorbell`` device types. - @subsection bluetooth (since 3.1) The bluetooth subsystem is unmaintained since many years and likely bitrotten diff --git a/scripts/device-crash-test b/scripts/device-crash-test index e93a7c0..a835772 100755 --- a/scripts/device-crash-test +++ b/scripts/device-crash-test @@ -83,7 +83,6 @@ ERROR_WHITELIST = [ {'device':'isa-ipmi-bt', 'expected':True}, # IPMI device requires a bmc attribute to be set {'device':'isa-ipmi-kcs', 'expected':True}, # IPMI device requires a bmc attribute to be set {'device':'isa-parallel', 'expected':True}, # Can't create serial device, empty char device - {'device':'ivshmem', 'expected':True}, # You must specify either 'shm' or 'chardev' {'device':'ivshmem-doorbell', 'expected':True}, # You must specify a 'chardev' {'device':'ivshmem-plain', 'expected':True}, # You must specify a 'memdev' {'device':'loader', 'expected':True}, # please include valid arguments diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c index fe5eb30..4911b69 100644 --- a/tests/ivshmem-test.c +++ b/tests/ivshmem-test.c @@ -291,20 +291,20 @@ static void *server_thread(void *data) return NULL; } -static void setup_vm_with_server(IVState *s, int nvectors, bool msi) +static void setup_vm_with_server(IVState *s, int nvectors) { - char *cmd = g_strdup_printf("-chardev socket,id=chr0,path=%s,nowait " - "-device ivshmem%s,chardev=chr0,vectors=%d", - tmpserver, - msi ? "-doorbell" : ",size=1M,msi=off", - nvectors); + char *cmd; - setup_vm_cmd(s, cmd, msi); + cmd = g_strdup_printf("-chardev socket,id=chr0,path=%s,nowait " + "-device ivshmem-doorbell,chardev=chr0,vectors=%d", + tmpserver, nvectors); + + setup_vm_cmd(s, cmd, true); g_free(cmd); } -static void test_ivshmem_server(bool msi) +static void test_ivshmem_server(void) { IVState state1, state2, *s1, *s2; ServerThread thread; @@ -327,9 +327,9 @@ static void test_ivshmem_server(bool msi) thread.thread = g_thread_new("ivshmem-server", server_thread, &thread); g_assert(thread.thread != NULL); - setup_vm_with_server(&state1, nvectors, msi); + setup_vm_with_server(&state1, nvectors); s1 = &state1; - setup_vm_with_server(&state2, nvectors, msi); + setup_vm_with_server(&state2, nvectors); s2 = &state2; /* check got different VM ids */ @@ -340,38 +340,28 @@ static void test_ivshmem_server(bool msi) g_assert_cmpint(vm1, !=, vm2); /* check number of MSI-X vectors */ - if (msi) { - ret = qpci_msix_table_size(s1->dev); - g_assert_cmpuint(ret, ==, nvectors); - } + ret = qpci_msix_table_size(s1->dev); + g_assert_cmpuint(ret, ==, nvectors); /* TODO test behavior before MSI-X is enabled */ /* ping vm2 -> vm1 on vector 0 */ - if (msi) { - ret = qpci_msix_pending(s1->dev, 0); - g_assert_cmpuint(ret, ==, 0); - } else { - g_assert_cmpuint(in_reg(s1, INTRSTATUS), ==, 0); - } + ret = qpci_msix_pending(s1->dev, 0); + g_assert_cmpuint(ret, ==, 0); out_reg(s2, DOORBELL, vm1 << 16); do { g_usleep(10000); - ret = msi ? qpci_msix_pending(s1->dev, 0) : in_reg(s1, INTRSTATUS); + ret = qpci_msix_pending(s1->dev, 0); } while (ret == 0 && g_get_monotonic_time() < end_time); g_assert_cmpuint(ret, !=, 0); /* ping vm1 -> vm2 on vector 1 */ - if (msi) { - ret = qpci_msix_pending(s2->dev, 1); - g_assert_cmpuint(ret, ==, 0); - } else { - g_assert_cmpuint(in_reg(s2, INTRSTATUS), ==, 0); - } + ret = qpci_msix_pending(s2->dev, 1); + g_assert_cmpuint(ret, ==, 0); out_reg(s1, DOORBELL, vm2 << 16 | 1); do { g_usleep(10000); - ret = msi ? qpci_msix_pending(s2->dev, 1) : in_reg(s2, INTRSTATUS); + ret = qpci_msix_pending(s2->dev, 1); } while (ret == 0 && g_get_monotonic_time() < end_time); g_assert_cmpuint(ret, !=, 0); @@ -389,27 +379,17 @@ static void test_ivshmem_server(bool msi) close(thread.pipe[0]); } -static void test_ivshmem_server_msi(void) -{ - test_ivshmem_server(true); -} - -static void test_ivshmem_server_irq(void) -{ - test_ivshmem_server(false); -} - #define PCI_SLOT_HP 0x06 static void test_ivshmem_hotplug(void) { const char *arch = qtest_get_arch(); - qtest_start(""); + qtest_start("-object memory-backend-ram,size=1M,id=mb1"); - qtest_qmp_device_add("ivshmem", - "iv1", "{'addr': %s, 'shm': %s, 'size': '1M'}", - stringify(PCI_SLOT_HP), tmpshm); + qtest_qmp_device_add("ivshmem-plain", "iv1", + "{'addr': %s, 'memdev': 'mb1'}", + stringify(PCI_SLOT_HP)); if (strcmp(arch, "ppc64") != 0) { qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP); } @@ -509,8 +489,7 @@ int main(int argc, char **argv) if (g_test_slow()) { qtest_add_func("/ivshmem/pair", test_ivshmem_pair); if (strcmp(arch, "ppc64") != 0) { - qtest_add_func("/ivshmem/server-msi", test_ivshmem_server_msi); - qtest_add_func("/ivshmem/server-irq", test_ivshmem_server_irq); + qtest_add_func("/ivshmem/server", test_ivshmem_server); } } From patchwork Mon Jan 14 10:01:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7827139A for ; Mon, 14 Jan 2019 10:06:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D71E22889B for ; Mon, 14 Jan 2019 10:06:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB88028ACE; Mon, 14 Jan 2019 10:06:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 861C52889B for ; Mon, 14 Jan 2019 10:06:04 +0000 (UTC) Received: from localhost ([127.0.0.1]:33482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz84-0008S3-Nc for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:06:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4p-0005YC-Gw for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4j-0007NR-1I for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59396) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4g-0007Lp-U8 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:32 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DB6F86673; Mon, 14 Jan 2019 10:02:29 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4583D101963E; Mon, 14 Jan 2019 10:02:28 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:01:57 +0100 Message-Id: <1547460140-1473-3-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 14 Jan 2019 10:02:29 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/25] tests: vhost-user-test: initialize 'fd' in chr_read 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Li Qiang Currently when processing VHOST_USER_SET_VRING_CALL if 'qemu_chr_fe_get_msgfds' get no fd, the 'fd' will be a stack uninitialized value. Signed-off-by: Li Qiang Reviewed-by: Thomas Huth Reviewed-by: Michael S. Tsirkin Signed-off-by: Thomas Huth --- tests/vhost-user-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 54982f6..84e50d8 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -309,7 +309,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size) CharBackend *chr = &s->chr; VhostUserMsg msg; uint8_t *p = (uint8_t *) &msg; - int fd; + int fd = -1; if (s->test_fail) { qemu_chr_fe_disconnect(chr); From patchwork Mon Jan 14 10:01:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 931FD6C2 for ; Mon, 14 Jan 2019 10:08:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 841E62889B for ; Mon, 14 Jan 2019 10:08:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7615628ACE; Mon, 14 Jan 2019 10:08:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 20DFB2889B for ; Mon, 14 Jan 2019 10:08:26 +0000 (UTC) Received: from localhost ([127.0.0.1]:34033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizAP-0001zt-BM for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:08:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4r-0005Zq-PK for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4l-0007Qi-4c for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47412) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4k-0007MQ-UD for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:35 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A715B8E5B1; Mon, 14 Jan 2019 10:02:30 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9685B101963E; Mon, 14 Jan 2019 10:02:29 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:01:58 +0100 Message-Id: <1547460140-1473-4-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 14 Jan 2019 10:02:30 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/25] vhost-user: fix ioeventfd_enabled 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Li Qiang Currently, the vhost-user-test assumes the eventfd is available. However it's not true because the accel is qtest. So the 'vhost_set_vring_file' will not add fds to the msg and the server side of vhost-user-test will be broken. The bug is in 'ioeventfd_enabled'. We should make this function return true if not using kvm accel. Signed-off-by: Li Qiang Signed-off-by: Thomas Huth --- hw/virtio/vhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index e09bed0..564a31d 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -207,7 +207,7 @@ struct vhost_user { static bool ioeventfd_enabled(void) { - return kvm_enabled() && kvm_eventfds_enabled(); + return !kvm_enabled() || kvm_eventfds_enabled(); } static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg) From patchwork Mon Jan 14 10:01:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3719B6C2 for ; Mon, 14 Jan 2019 10:12:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24C4528AB7 for ; Mon, 14 Jan 2019 10:12:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1830028AD2; Mon, 14 Jan 2019 10:12:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C7D4B28AB7 for ; Mon, 14 Jan 2019 10:12:05 +0000 (UTC) Received: from localhost ([127.0.0.1]:34920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizDx-0005E8-1Y for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:12:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4n-0005Xs-2s for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4k-0007QQ-Uv for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41628) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4j-0007N1-S9 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:34 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C29B37E79; Mon, 14 Jan 2019 10:02:32 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED304101963C; Mon, 14 Jan 2019 10:02:30 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:01:59 +0100 Message-Id: <1547460140-1473-5-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 14 Jan 2019 10:02:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/25] util: check the return value of fcntl in qemu_set_{block, nonblock} 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Li Qiang Assert that the return value is not an error. This is like commit 7e6478e7d4f for qemu_set_cloexec. Signed-off-by: Li Qiang Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- util/oslib-posix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index c1bee2a..4ce1ba9 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -233,14 +233,18 @@ void qemu_set_block(int fd) { int f; f = fcntl(fd, F_GETFL); - fcntl(fd, F_SETFL, f & ~O_NONBLOCK); + assert(f != -1); + f = fcntl(fd, F_SETFL, f & ~O_NONBLOCK); + assert(f != -1); } void qemu_set_nonblock(int fd) { int f; f = fcntl(fd, F_GETFL); - fcntl(fd, F_SETFL, f | O_NONBLOCK); + assert(f != -1); + f = fcntl(fd, F_SETFL, f | O_NONBLOCK); + assert(f != -1); } int socket_set_fast_reuse(int fd) From patchwork Mon Jan 14 10:02:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89DF1139A for ; Mon, 14 Jan 2019 10:04:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF3F727C05 for ; Mon, 14 Jan 2019 10:04:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B33A2289A6; Mon, 14 Jan 2019 10:04:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C72027C05 for ; Mon, 14 Jan 2019 10:04:44 +0000 (UTC) Received: from localhost ([127.0.0.1]:33164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz6p-0007Pk-Iy for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:04:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4r-0005Zs-PM for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4l-0007Qp-5t for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55026) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4l-0007PS-09 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:35 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6114FA7887; Mon, 14 Jan 2019 10:02:33 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52828101963C; Mon, 14 Jan 2019 10:02:32 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:00 +0100 Message-Id: <1547460140-1473-6-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 14 Jan 2019 10:02:33 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/25] tests/Makefile: Use some more CONFIG switches for x86 tests 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP To be able to build and test QEMU binaries where certain devices are disabled, we have to use the right CONFIG_* switches to run certain tests only if the corresponding device really has been compiled into the binary. Signed-off-by: Thomas Huth --- tests/Makefile.include | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index c17f6d5..462b5e0 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -165,13 +165,13 @@ check-qtest-pci-$(CONFIG_NE2000_PCI) += tests/ne2000-test$(EXESUF) check-qtest-pci-$(CONFIG_NVME_PCI) += tests/nvme-test$(EXESUF) check-qtest-pci-$(CONFIG_AC97) += tests/ac97-test$(EXESUF) check-qtest-pci-$(CONFIG_ES1370) += tests/es1370-test$(EXESUF) -check-qtest-pci-y += $(check-qtest-virtio-y) +check-qtest-pci-$(CONFIG_VIRTIO) += $(check-qtest-virtio-y) check-qtest-pci-$(CONFIG_IPACK) += tests/tpci200-test$(EXESUF) check-qtest-pci-$(CONFIG_IPACK) += $(check-qtest-ipack-y) -check-qtest-pci-y += tests/display-vga-test$(EXESUF) +check-qtest-pci-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF) check-qtest-pci-$(CONFIG_HDA) += tests/intel-hda-test$(EXESUF) check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) += tests/ivshmem-test$(EXESUF) -check-qtest-pci-y += tests/megasas-test$(EXESUF) +check-qtest-pci-$(CONFIG_MEGASAS_SCSI_PCI) += tests/megasas-test$(EXESUF) check-qtest-i386-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-i386-y += tests/fdc-test$(EXESUF) @@ -183,8 +183,8 @@ check-qtest-i386-y += tests/bios-tables-test$(EXESUF) check-qtest-i386-$(CONFIG_SGA) += tests/boot-serial-test$(EXESUF) check-qtest-i386-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF) check-qtest-i386-y += tests/rtc-test$(EXESUF) -check-qtest-i386-y += tests/ipmi-kcs-test$(EXESUF) -check-qtest-i386-y += tests/ipmi-bt-test$(EXESUF) +check-qtest-i386-$(CONFIG_ISA_IPMI_KCS) += tests/ipmi-kcs-test$(EXESUF) +check-qtest-i386-$(CONFIG_ISA_IPMI_BT) += tests/ipmi-bt-test$(EXESUF) check-qtest-i386-y += tests/i440fx-test$(EXESUF) check-qtest-i386-y += tests/fw_cfg-test$(EXESUF) check-qtest-i386-y += tests/drive_del-test$(EXESUF) From patchwork Mon Jan 14 10:02:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 305B76C2 for ; Mon, 14 Jan 2019 10:05:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74F7A2889B for ; Mon, 14 Jan 2019 10:04:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69830289A6; Mon, 14 Jan 2019 10:04:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 175132889B for ; Mon, 14 Jan 2019 10:04:45 +0000 (UTC) Received: from localhost ([127.0.0.1]:33172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz6q-0007Qc-9w for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:04:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4t-0005b2-OG for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4n-0007Rz-5L for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47478) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4m-0007QU-Vx for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:37 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4558F81C; Mon, 14 Jan 2019 10:02:34 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id A92C8108429B; Mon, 14 Jan 2019 10:02:33 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:01 +0100 Message-Id: <1547460140-1473-7-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 14 Jan 2019 10:02:34 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/25] tests/Makefile: Use some more CONFIG switches for ppc tests 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP To be able to build and test QEMU binaries where certain devices or machines are disabled, we have to use the right CONFIG_* switches to run certain tests only if the corresponding device or machine really has been compiled into the binary. Reviewed-by: Wainer dos Santos Moschetta Signed-off-by: Thomas Huth --- tests/Makefile.include | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 462b5e0..476b943 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -242,22 +242,22 @@ check-qtest-ppc-y += tests/boot-order-test$(EXESUF) check-qtest-ppc-y += tests/prom-env-test$(EXESUF) check-qtest-ppc-y += tests/drive_del-test$(EXESUF) check-qtest-ppc-y += tests/boot-serial-test$(EXESUF) -check-qtest-ppc-y += tests/m48t59-test$(EXESUF) +check-qtest-ppc-$(CONFIG_M48T59) += tests/m48t59-test$(EXESUF) check-qtest-ppc64-y += $(check-qtest-ppc-y) -check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF) -check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF) +check-qtest-ppc64-$(CONFIG_PSERIES) += tests/spapr-phb-test$(EXESUF) +check-qtest-ppc64-$(CONFIG_POWERNV) += tests/pnv-xscom-test$(EXESUF) check-qtest-ppc64-y += tests/migration-test$(EXESUF) -check-qtest-ppc64-y += tests/rtas-test$(EXESUF) +check-qtest-ppc64-$(CONFIG_PSERIES) += tests/rtas-test$(EXESUF) check-qtest-ppc64-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF) check-qtest-ppc64-$(CONFIG_USB_OHCI) += tests/usb-hcd-ohci-test$(EXESUF) check-qtest-ppc64-$(CONFIG_USB_UHCI) += tests/usb-hcd-uhci-test$(EXESUF) check-qtest-ppc64-$(CONFIG_USB_XHCI_NEC) += tests/usb-hcd-xhci-test$(EXESUF) -check-qtest-ppc64-y += $(check-qtest-virtio-y) +check-qtest-ppc64-$(CONFIG_VIRTIO) += $(check-qtest-virtio-y) check-qtest-ppc64-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF) check-qtest-ppc64-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF) check-qtest-ppc64-$(CONFIG_RTL8139_PCI) += tests/test-filter-redirector$(EXESUF) -check-qtest-ppc64-y += tests/display-vga-test$(EXESUF) +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) From patchwork Mon Jan 14 10:02:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761975 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 169A713B5 for ; Mon, 14 Jan 2019 10:15:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05CA5284C9 for ; Mon, 14 Jan 2019 10:15:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBEA7289CC; Mon, 14 Jan 2019 10:15:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F1217284C9 for ; Mon, 14 Jan 2019 10:15:38 +0000 (UTC) Received: from localhost ([127.0.0.1]:35793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizHN-0008CB-MH for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:15:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4r-0005Zr-PL for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4p-0007Sx-AF for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52398) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4n-0007RL-1b for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:37 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 17582D400F; Mon, 14 Jan 2019 10:02:36 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09886108429B; Mon, 14 Jan 2019 10:02:34 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:02 +0100 Message-Id: <1547460140-1473-8-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 14 Jan 2019 10:02:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/25] tests/endianesss: Make 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Pass around the test state explicitly, to be able to use the qtest_in*() and qtest_out*() function in this test. Signed-off-by: Thomas Huth --- tests/endianness-test.c | 329 ++++++++++++++++++++++++------------------------ 1 file changed, 166 insertions(+), 163 deletions(-) diff --git a/tests/endianness-test.c b/tests/endianness-test.c index 48680cd..5852795 100644 --- a/tests/endianness-test.c +++ b/tests/endianness-test.c @@ -48,65 +48,68 @@ static const TestCase test_cases[] = { {} }; -static uint8_t isa_inb(const TestCase *test, uint16_t addr) +static uint8_t isa_inb(QTestState *qts, const TestCase *test, uint16_t addr) { uint8_t value; if (test->isa_base == -1) { - value = inb(addr); + value = qtest_inb(qts, addr); } else { - value = readb(test->isa_base + addr); + value = qtest_readb(qts, test->isa_base + addr); } return value; } -static uint16_t isa_inw(const TestCase *test, uint16_t addr) +static uint16_t isa_inw(QTestState *qts, const TestCase *test, uint16_t addr) { uint16_t value; if (test->isa_base == -1) { - value = inw(addr); + value = qtest_inw(qts, addr); } else { - value = readw(test->isa_base + addr); + value = qtest_readw(qts, test->isa_base + addr); } return test->bswap ? bswap16(value) : value; } -static uint32_t isa_inl(const TestCase *test, uint16_t addr) +static uint32_t isa_inl(QTestState *qts, const TestCase *test, uint16_t addr) { uint32_t value; if (test->isa_base == -1) { - value = inl(addr); + value = qtest_inl(qts, addr); } else { - value = readl(test->isa_base + addr); + value = qtest_readl(qts, test->isa_base + addr); } return test->bswap ? bswap32(value) : value; } -static void isa_outb(const TestCase *test, uint16_t addr, uint8_t value) +static void isa_outb(QTestState *qts, const TestCase *test, uint16_t addr, + uint8_t value) { if (test->isa_base == -1) { - outb(addr, value); + qtest_outb(qts, addr, value); } else { - writeb(test->isa_base + addr, value); + qtest_writeb(qts, test->isa_base + addr, value); } } -static void isa_outw(const TestCase *test, uint16_t addr, uint16_t value) +static void isa_outw(QTestState *qts, const TestCase *test, uint16_t addr, + uint16_t value) { value = test->bswap ? bswap16(value) : value; if (test->isa_base == -1) { - outw(addr, value); + qtest_outw(qts, addr, value); } else { - writew(test->isa_base + addr, value); + qtest_writew(qts, test->isa_base + addr, value); } } -static void isa_outl(const TestCase *test, uint16_t addr, uint32_t value) +static void isa_outl(QTestState *qts, const TestCase *test, uint16_t addr, + uint32_t value) { value = test->bswap ? bswap32(value) : value; if (test->isa_base == -1) { - outl(addr, value); + qtest_outl(qts, addr, value); } else { - writel(test->isa_base + addr, value); + qtest_writel(qts, test->isa_base + addr, value); } } @@ -114,161 +117,161 @@ static void isa_outl(const TestCase *test, uint16_t addr, uint32_t value) static void test_endianness(gconstpointer data) { const TestCase *test = data; - - global_qtest = qtest_initf("-M %s%s%s -device pc-testdev", - test->machine, - test->superio ? " -device " : "", - test->superio ?: ""); - isa_outl(test, 0xe0, 0x87654321); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x87654321); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4321); - g_assert_cmphex(isa_inb(test, 0xe3), ==, 0x87); - g_assert_cmphex(isa_inb(test, 0xe2), ==, 0x65); - g_assert_cmphex(isa_inb(test, 0xe1), ==, 0x43); - g_assert_cmphex(isa_inb(test, 0xe0), ==, 0x21); - - isa_outw(test, 0xe2, 0x8866); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x88664321); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8866); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4321); - g_assert_cmphex(isa_inb(test, 0xe3), ==, 0x88); - g_assert_cmphex(isa_inb(test, 0xe2), ==, 0x66); - g_assert_cmphex(isa_inb(test, 0xe1), ==, 0x43); - g_assert_cmphex(isa_inb(test, 0xe0), ==, 0x21); - - isa_outw(test, 0xe0, 0x4422); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x88664422); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8866); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4422); - g_assert_cmphex(isa_inb(test, 0xe3), ==, 0x88); - g_assert_cmphex(isa_inb(test, 0xe2), ==, 0x66); - g_assert_cmphex(isa_inb(test, 0xe1), ==, 0x44); - g_assert_cmphex(isa_inb(test, 0xe0), ==, 0x22); - - isa_outb(test, 0xe3, 0x87); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x87664422); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8766); - g_assert_cmphex(isa_inb(test, 0xe3), ==, 0x87); - g_assert_cmphex(isa_inb(test, 0xe2), ==, 0x66); - g_assert_cmphex(isa_inb(test, 0xe1), ==, 0x44); - g_assert_cmphex(isa_inb(test, 0xe0), ==, 0x22); - - isa_outb(test, 0xe2, 0x65); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x87654422); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4422); - g_assert_cmphex(isa_inb(test, 0xe3), ==, 0x87); - g_assert_cmphex(isa_inb(test, 0xe2), ==, 0x65); - g_assert_cmphex(isa_inb(test, 0xe1), ==, 0x44); - g_assert_cmphex(isa_inb(test, 0xe0), ==, 0x22); - - isa_outb(test, 0xe1, 0x43); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x87654322); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4322); - g_assert_cmphex(isa_inb(test, 0xe3), ==, 0x87); - g_assert_cmphex(isa_inb(test, 0xe2), ==, 0x65); - g_assert_cmphex(isa_inb(test, 0xe1), ==, 0x43); - g_assert_cmphex(isa_inb(test, 0xe0), ==, 0x22); - - isa_outb(test, 0xe0, 0x21); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x87654321); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4321); - g_assert_cmphex(isa_inb(test, 0xe3), ==, 0x87); - g_assert_cmphex(isa_inb(test, 0xe2), ==, 0x65); - g_assert_cmphex(isa_inb(test, 0xe1), ==, 0x43); - g_assert_cmphex(isa_inb(test, 0xe0), ==, 0x21); - qtest_quit(global_qtest); + QTestState *qts; + + qts = qtest_initf("-M %s%s%s -device pc-testdev", test->machine, + test->superio ? " -device " : "", + test->superio ?: ""); + isa_outl(qts, test, 0xe0, 0x87654321); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654321); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); + g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x87); + g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x65); + g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x43); + g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x21); + + isa_outw(qts, test, 0xe2, 0x8866); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x88664321); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8866); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); + g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x88); + g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x66); + g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x43); + g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x21); + + isa_outw(qts, test, 0xe0, 0x4422); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x88664422); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8866); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4422); + g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x88); + g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x66); + g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x44); + g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x22); + + isa_outb(qts, test, 0xe3, 0x87); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87664422); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8766); + g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x87); + g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x66); + g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x44); + g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x22); + + isa_outb(qts, test, 0xe2, 0x65); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654422); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4422); + g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x87); + g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x65); + g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x44); + g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x22); + + isa_outb(qts, test, 0xe1, 0x43); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654322); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4322); + g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x87); + g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x65); + g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x43); + g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x22); + + isa_outb(qts, test, 0xe0, 0x21); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654321); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); + g_assert_cmphex(isa_inb(qts, test, 0xe3), ==, 0x87); + g_assert_cmphex(isa_inb(qts, test, 0xe2), ==, 0x65); + g_assert_cmphex(isa_inb(qts, test, 0xe1), ==, 0x43); + g_assert_cmphex(isa_inb(qts, test, 0xe0), ==, 0x21); + qtest_quit(qts); } static void test_endianness_split(gconstpointer data) { const TestCase *test = data; - - global_qtest = qtest_initf("-M %s%s%s -device pc-testdev", - test->machine, - test->superio ? " -device " : "", - test->superio ?: ""); - isa_outl(test, 0xe8, 0x87654321); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x87654321); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4321); - - isa_outw(test, 0xea, 0x8866); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x88664321); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8866); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4321); - - isa_outw(test, 0xe8, 0x4422); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x88664422); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8866); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4422); - - isa_outb(test, 0xeb, 0x87); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x87664422); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8766); - - isa_outb(test, 0xea, 0x65); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x87654422); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4422); - - isa_outb(test, 0xe9, 0x43); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x87654322); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4322); - - isa_outb(test, 0xe8, 0x21); - g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x87654321); - g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4321); - qtest_quit(global_qtest); + QTestState *qts; + + qts = qtest_initf("-M %s%s%s -device pc-testdev", test->machine, + test->superio ? " -device " : "", + test->superio ?: ""); + isa_outl(qts, test, 0xe8, 0x87654321); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654321); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); + + isa_outw(qts, test, 0xea, 0x8866); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x88664321); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8866); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); + + isa_outw(qts, test, 0xe8, 0x4422); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x88664422); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8866); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4422); + + isa_outb(qts, test, 0xeb, 0x87); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87664422); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8766); + + isa_outb(qts, test, 0xea, 0x65); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654422); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4422); + + isa_outb(qts, test, 0xe9, 0x43); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654322); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4322); + + isa_outb(qts, test, 0xe8, 0x21); + g_assert_cmphex(isa_inl(qts, test, 0xe0), ==, 0x87654321); + g_assert_cmphex(isa_inw(qts, test, 0xe2), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe0), ==, 0x4321); + qtest_quit(qts); } static void test_endianness_combine(gconstpointer data) { const TestCase *test = data; - - global_qtest = qtest_initf("-M %s%s%s -device pc-testdev", - test->machine, - test->superio ? " -device " : "", - test->superio ?: ""); - isa_outl(test, 0xe0, 0x87654321); - g_assert_cmphex(isa_inl(test, 0xe8), ==, 0x87654321); - g_assert_cmphex(isa_inw(test, 0xea), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe8), ==, 0x4321); - - isa_outw(test, 0xe2, 0x8866); - g_assert_cmphex(isa_inl(test, 0xe8), ==, 0x88664321); - g_assert_cmphex(isa_inw(test, 0xea), ==, 0x8866); - g_assert_cmphex(isa_inw(test, 0xe8), ==, 0x4321); - - isa_outw(test, 0xe0, 0x4422); - g_assert_cmphex(isa_inl(test, 0xe8), ==, 0x88664422); - g_assert_cmphex(isa_inw(test, 0xea), ==, 0x8866); - g_assert_cmphex(isa_inw(test, 0xe8), ==, 0x4422); - - isa_outb(test, 0xe3, 0x87); - g_assert_cmphex(isa_inl(test, 0xe8), ==, 0x87664422); - g_assert_cmphex(isa_inw(test, 0xea), ==, 0x8766); - - isa_outb(test, 0xe2, 0x65); - g_assert_cmphex(isa_inl(test, 0xe8), ==, 0x87654422); - g_assert_cmphex(isa_inw(test, 0xea), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe8), ==, 0x4422); - - isa_outb(test, 0xe1, 0x43); - g_assert_cmphex(isa_inl(test, 0xe8), ==, 0x87654322); - g_assert_cmphex(isa_inw(test, 0xea), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe8), ==, 0x4322); - - isa_outb(test, 0xe0, 0x21); - g_assert_cmphex(isa_inl(test, 0xe8), ==, 0x87654321); - g_assert_cmphex(isa_inw(test, 0xea), ==, 0x8765); - g_assert_cmphex(isa_inw(test, 0xe8), ==, 0x4321); - qtest_quit(global_qtest); + QTestState *qts; + + qts = qtest_initf("-M %s%s%s -device pc-testdev", test->machine, + test->superio ? " -device " : "", + test->superio ?: ""); + isa_outl(qts, test, 0xe0, 0x87654321); + g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x87654321); + g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4321); + + isa_outw(qts, test, 0xe2, 0x8866); + g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x88664321); + g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8866); + g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4321); + + isa_outw(qts, test, 0xe0, 0x4422); + g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x88664422); + g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8866); + g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4422); + + isa_outb(qts, test, 0xe3, 0x87); + g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x87664422); + g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8766); + + isa_outb(qts, test, 0xe2, 0x65); + g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x87654422); + g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4422); + + isa_outb(qts, test, 0xe1, 0x43); + g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x87654322); + g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4322); + + isa_outb(qts, test, 0xe0, 0x21); + g_assert_cmphex(isa_inl(qts, test, 0xe8), ==, 0x87654321); + g_assert_cmphex(isa_inw(qts, test, 0xea), ==, 0x8765); + g_assert_cmphex(isa_inw(qts, test, 0xe8), ==, 0x4321); + qtest_quit(qts); } int main(int argc, char **argv) From patchwork Mon Jan 14 10:02:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC53013B4 for ; Mon, 14 Jan 2019 10:19:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEB3C2882F for ; Mon, 14 Jan 2019 10:19:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2C4728B4B; Mon, 14 Jan 2019 10:19:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 57BD22882F for ; Mon, 14 Jan 2019 10:19:43 +0000 (UTC) Received: from localhost ([127.0.0.1]:36598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizLK-0002y6-Fz for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:19:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4v-0005c8-P8 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4p-0007TZ-R9 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40510) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4p-0007SG-8s for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:39 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B2F4C0495AE; Mon, 14 Jan 2019 10:02:37 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E913101963C; Mon, 14 Jan 2019 10:02:36 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:03 +0100 Message-Id: <1547460140-1473-9-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 14 Jan 2019 10:02:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/25] tests/boot-order: Make 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Pass around the QTestState from function to function, so that we can finally get rid of the out-of-favor global_qtest variable in this file, too. Signed-off-by: Thomas Huth --- tests/boot-order-test.c | 59 ++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/tests/boot-order-test.c b/tests/boot-order-test.c index c60ebcf..a725bce 100644 --- a/tests/boot-order-test.c +++ b/tests/boot-order-test.c @@ -17,7 +17,7 @@ #include "standard-headers/linux/qemu_fw_cfg.h" /* TODO actually test the results and get rid of this */ -#define qmp_discard_response(...) qobject_unref(qmp(__VA_ARGS__)) +#define qmp_discard_response(qs, ...) qobject_unref(qtest_qmp(qs, __VA_ARGS__)) typedef struct { const char *args; @@ -27,31 +27,30 @@ typedef struct { static void test_a_boot_order(const char *machine, const char *test_args, - uint64_t (*read_boot_order)(void), + uint64_t (*read_boot_order)(QTestState *), uint64_t expected_boot, uint64_t expected_reboot) { uint64_t actual; + QTestState *qts; - global_qtest = qtest_initf("-nodefaults%s%s %s", - machine ? " -M " : "", - machine ?: "", - test_args); - actual = read_boot_order(); + qts = qtest_initf("-nodefaults%s%s %s", machine ? " -M " : "", + machine ?: "", test_args); + actual = read_boot_order(qts); g_assert_cmphex(actual, ==, expected_boot); - qmp_discard_response("{ 'execute': 'system_reset' }"); + qmp_discard_response(qts, "{ 'execute': 'system_reset' }"); /* * system_reset only requests reset. We get a RESET event after * the actual reset completes. Need to wait for that. */ - qmp_eventwait("RESET"); - actual = read_boot_order(); + qtest_qmp_eventwait(qts, "RESET"); + actual = read_boot_order(qts); g_assert_cmphex(actual, ==, expected_reboot); - qtest_quit(global_qtest); + qtest_quit(qts); } static void test_boot_orders(const char *machine, - uint64_t (*read_boot_order)(void), + uint64_t (*read_boot_order)(QTestState *), const boot_order_test *tests) { int i; @@ -64,16 +63,16 @@ static void test_boot_orders(const char *machine, } } -static uint8_t read_mc146818(uint16_t port, uint8_t reg) +static uint8_t read_mc146818(QTestState *qts, uint16_t port, uint8_t reg) { - outb(port, reg); - return inb(port + 1); + qtest_outb(qts, port, reg); + return qtest_inb(qts, port + 1); } -static uint64_t read_boot_order_pc(void) +static uint64_t read_boot_order_pc(QTestState *qts) { - uint8_t b1 = read_mc146818(0x70, 0x38); - uint8_t b2 = read_mc146818(0x70, 0x3d); + uint8_t b1 = read_mc146818(qts, 0x70, 0x38); + uint8_t b2 = read_mc146818(qts, 0x70, 0x3d); return b1 | (b2 << 8); } @@ -109,16 +108,16 @@ static void test_pc_boot_order(void) test_boot_orders(NULL, read_boot_order_pc, test_cases_pc); } -static uint8_t read_m48t59(uint64_t addr, uint16_t reg) +static uint8_t read_m48t59(QTestState *qts, uint64_t addr, uint16_t reg) { - writeb(addr, reg & 0xff); - writeb(addr + 1, reg >> 8); - return readb(addr + 3); + qtest_writeb(qts, addr, reg & 0xff); + qtest_writeb(qts, addr + 1, reg >> 8); + return qtest_readb(qts, addr + 3); } -static uint64_t read_boot_order_prep(void) +static uint64_t read_boot_order_prep(QTestState *qts) { - return read_m48t59(0x80000000 + 0x74, 0x34); + return read_m48t59(qts, 0x80000000 + 0x74, 0x34); } static const boot_order_test test_cases_prep[] = { @@ -133,9 +132,9 @@ static void test_prep_boot_order(void) test_boot_orders("prep", read_boot_order_prep, test_cases_prep); } -static uint64_t read_boot_order_pmac(void) +static uint64_t read_boot_order_pmac(QTestState *qts) { - QFWCFG *fw_cfg = mm_fw_cfg_init(global_qtest, 0xf0000510); + QFWCFG *fw_cfg = mm_fw_cfg_init(qts, 0xf0000510); return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE); } @@ -158,9 +157,9 @@ static void test_pmac_newworld_boot_order(void) test_boot_orders("mac99", read_boot_order_pmac, test_cases_fw_cfg); } -static uint64_t read_boot_order_sun4m(void) +static uint64_t read_boot_order_sun4m(QTestState *qts) { - QFWCFG *fw_cfg = mm_fw_cfg_init(global_qtest, 0xd00000510ULL); + QFWCFG *fw_cfg = mm_fw_cfg_init(qts, 0xd00000510ULL); return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE); } @@ -170,9 +169,9 @@ static void test_sun4m_boot_order(void) test_boot_orders("SS-5", read_boot_order_sun4m, test_cases_fw_cfg); } -static uint64_t read_boot_order_sun4u(void) +static uint64_t read_boot_order_sun4u(QTestState *qts) { - QFWCFG *fw_cfg = io_fw_cfg_init(global_qtest, 0x510); + QFWCFG *fw_cfg = io_fw_cfg_init(qts, 0x510); return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE); } From patchwork Mon Jan 14 10:02:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761963 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B0C3184E for ; Mon, 14 Jan 2019 10:08:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C5E32889B for ; Mon, 14 Jan 2019 10:08:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F9D528ACE; Mon, 14 Jan 2019 10:08:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CF02E2889B for ; Mon, 14 Jan 2019 10:08:32 +0000 (UTC) Received: from localhost ([127.0.0.1]:34072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizAW-00027S-0r for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:08:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4v-0005c6-O4 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4p-0007Th-Sk for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40540) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4p-0007Sr-J4 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:39 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C04A2C070E2A; Mon, 14 Jan 2019 10:02:38 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3888101963C; Mon, 14 Jan 2019 10:02:37 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:04 +0100 Message-Id: <1547460140-1473-10-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 14 Jan 2019 10:02:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/25] tests/pnv-xscom: Make 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Pass around the QTestState, so that we can finally get rid of the out-of-favor global_qtest variable in this file, too. Signed-off-by: Thomas Huth --- tests/pnv-xscom-test.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/tests/pnv-xscom-test.c b/tests/pnv-xscom-test.c index 70f4c84..974f8da 100644 --- a/tests/pnv-xscom-test.c +++ b/tests/pnv-xscom-test.c @@ -63,14 +63,15 @@ static uint64_t pnv_xscom_addr(const PnvChip *chip, uint32_t pcba) return addr; } -static uint64_t pnv_xscom_read(const PnvChip *chip, uint32_t pcba) +static uint64_t pnv_xscom_read(QTestState *qts, const PnvChip *chip, + uint32_t pcba) { - return readq(pnv_xscom_addr(chip, pcba)); + return qtest_readq(qts, pnv_xscom_addr(chip, pcba)); } -static void test_xscom_cfam_id(const PnvChip *chip) +static void test_xscom_cfam_id(QTestState *qts, const PnvChip *chip) { - uint64_t f000f = pnv_xscom_read(chip, 0xf000f); + uint64_t f000f = pnv_xscom_read(qts, chip, 0xf000f); g_assert_cmphex(f000f, ==, chip->cfam_id); } @@ -78,11 +79,11 @@ static void test_xscom_cfam_id(const PnvChip *chip) static void test_cfam_id(const void *data) { const PnvChip *chip = data; + QTestState *qts; - global_qtest = qtest_initf("-M powernv,accel=tcg -cpu %s", - chip->cpu_model); - test_xscom_cfam_id(chip); - qtest_quit(global_qtest); + qts = qtest_initf("-M powernv,accel=tcg -cpu %s", chip->cpu_model); + test_xscom_cfam_id(qts, chip); + qtest_quit(qts); } @@ -94,7 +95,7 @@ static void test_cfam_id(const void *data) #define PNV_XSCOM_EX_DTS_RESULT0 0x50000 -static void test_xscom_core(const PnvChip *chip) +static void test_xscom_core(QTestState *qts, const PnvChip *chip) { uint32_t first_core_dts0 = PNV_XSCOM_EX_DTS_RESULT0; uint64_t dts0; @@ -105,7 +106,7 @@ static void test_xscom_core(const PnvChip *chip) first_core_dts0 |= PNV_XSCOM_P9_EC_BASE(chip->first_core); } - dts0 = pnv_xscom_read(chip, first_core_dts0); + dts0 = pnv_xscom_read(qts, chip, first_core_dts0); g_assert_cmphex(dts0, ==, 0x26f024f023f0000ull); } @@ -113,11 +114,11 @@ static void test_xscom_core(const PnvChip *chip) static void test_core(const void *data) { const PnvChip *chip = data; + QTestState *qts; - global_qtest = qtest_initf("-M powernv,accel=tcg -cpu %s", - chip->cpu_model); - test_xscom_core(chip); - qtest_quit(global_qtest); + qts = qtest_initf("-M powernv,accel=tcg -cpu %s", chip->cpu_model); + test_xscom_core(qts, chip); + qtest_quit(qts); } static void add_test(const char *name, void (*test)(const void *data)) From patchwork Mon Jan 14 10:02:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3D60139A for ; Mon, 14 Jan 2019 10:08:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9134B2889B for ; Mon, 14 Jan 2019 10:08:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8225F28ACE; Mon, 14 Jan 2019 10:08:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 34DC42889B for ; Mon, 14 Jan 2019 10:08:32 +0000 (UTC) Received: from localhost ([127.0.0.1]:34062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizAV-00025y-8b for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:08:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4v-0005c7-Ot for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4t-0007VQ-NH for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52490) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4r-0007Tt-NJ for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:41 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2873F394D54; Mon, 14 Jan 2019 10:02:40 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14426101963C; Mon, 14 Jan 2019 10:02:38 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:05 +0100 Message-Id: <1547460140-1473-11-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 14 Jan 2019 10:02:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/25] hw/input/ps2: Remove PS2State from "qemu/typedefs.h" 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé PS2State is only used in "hw/input/ps2.h", there is no need to expose it via "qemu/typedefs.h". To clean "qemu/typedefs.h", move the forward declaration to "hw/input/ps2.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- include/hw/input/ps2.h | 2 ++ include/qemu/typedefs.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/input/ps2.h b/include/hw/input/ps2.h index 213aa16..b60455d 100644 --- a/include/hw/input/ps2.h +++ b/include/hw/input/ps2.h @@ -31,6 +31,8 @@ #define PS2_MOUSE_BUTTON_SIDE 0x08 #define PS2_MOUSE_BUTTON_EXTRA 0x10 +typedef struct PS2State PS2State; + /* ps2.c */ void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg); void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg); diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 741935f..28a8b9e 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -83,7 +83,6 @@ typedef struct PixelFormat PixelFormat; typedef struct PostcopyDiscardState PostcopyDiscardState; typedef struct Property Property; typedef struct PropertyInfo PropertyInfo; -typedef struct PS2State PS2State; typedef struct QBool QBool; typedef struct QDict QDict; typedef struct QEMUBH QEMUBH; From patchwork Mon Jan 14 10:02:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10FEC1580 for ; Mon, 14 Jan 2019 10:19:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03B1D2882F for ; Mon, 14 Jan 2019 10:19:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBB9928B4B; Mon, 14 Jan 2019 10:19:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9969A2882F for ; Mon, 14 Jan 2019 10:19:52 +0000 (UTC) Received: from localhost ([127.0.0.1]:36622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizLT-00035m-N6 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:19:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4z-0005dV-HZ for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4v-0007Wd-PL for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45764) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4t-0007Uj-Pa for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:45 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 87841A1F4A; Mon, 14 Jan 2019 10:02:41 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7009A101963C; Mon, 14 Jan 2019 10:02:40 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:06 +0100 Message-Id: <1547460140-1473-12-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 14 Jan 2019 10:02:41 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 11/25] hw/pcmcia: Remove PCMCIACardState from "qemu/typedefs.h" 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé There is only one header file requiring this typedef (hw/arm/pxa.h), let it include "hw/pcmcia.h" directly to simplify "qemu/typedefs.h". To clean "qemu/typedefs.h", move the declaration to "hw/pcmcia.h" (removing the forward declaration). Signed-off-by: Philippe Mathieu-Daudé [thuth: slightly tweaked commit message] Signed-off-by: Thomas Huth --- include/hw/arm/pxa.h | 1 + include/hw/pcmcia.h | 4 ++-- include/qemu/typedefs.h | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index 0df1199..f6dfb5c 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -12,6 +12,7 @@ #include "exec/memory.h" #include "target/arm/cpu-qom.h" +#include "hw/pcmcia.h" /* Interrupt numbers */ # define PXA2XX_PIC_SSP3 0 diff --git a/include/hw/pcmcia.h b/include/hw/pcmcia.h index 79cac9c..1b40807 100644 --- a/include/hw/pcmcia.h +++ b/include/hw/pcmcia.h @@ -18,13 +18,13 @@ typedef struct PCMCIASocket { #define PCMCIA_CARD_CLASS(cls) \ OBJECT_CLASS_CHECK(PCMCIACardClass, cls, TYPE_PCMCIA_CARD) -struct PCMCIACardState { +typedef struct PCMCIACardState { /*< private >*/ DeviceState parent_obj; /*< public >*/ PCMCIASocket *slot; -}; +} PCMCIACardState; typedef struct PCMCIACardClass { /*< private >*/ diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 28a8b9e..3bd9215 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -78,7 +78,6 @@ typedef struct PCIHostDeviceAddress PCIHostDeviceAddress; typedef struct PCIHostState PCIHostState; typedef struct PCMachineClass PCMachineClass; typedef struct PCMachineState PCMachineState; -typedef struct PCMCIACardState PCMCIACardState; typedef struct PixelFormat PixelFormat; typedef struct PostcopyDiscardState PostcopyDiscardState; typedef struct Property Property; From patchwork Mon Jan 14 10:02:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10762037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 809FD139A for ; Mon, 14 Jan 2019 10:26:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 739DB28B38 for ; Mon, 14 Jan 2019 10:26:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64F4428B44; Mon, 14 Jan 2019 10:26:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0ACFC28B38 for ; Mon, 14 Jan 2019 10:26:26 +0000 (UTC) Received: from localhost ([127.0.0.1]:37901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizRp-00009A-V0 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:26:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4z-0005dW-HZ for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4v-0007Wi-PQ for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45792) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4t-0007VC-PQ for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:45 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E5B68753E2; Mon, 14 Jan 2019 10:02:42 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBD3E101963E; Mon, 14 Jan 2019 10:02:41 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:07 +0100 Message-Id: <1547460140-1473-13-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 14 Jan 2019 10:02:43 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 12/25] hw/ssi: Remove SSIBus from "qemu/typedefs.h" 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé There are only three header files requiring this typedef, let them include "hw/ssi/ssi.h" directly to simplify "qemu/typedefs.h". To clean "qemu/typedefs.h", move the forward declaration to "hw/ssi/ssi.h". Signed-off-by: Philippe Mathieu-Daudé [thuth: slightly tweaked commit message] Signed-off-by: Thomas Huth --- hw/arm/strongarm.h | 1 + include/hw/arm/pxa.h | 1 + include/hw/ssi/pl022.h | 1 + include/hw/ssi/ssi.h | 1 + include/qemu/typedefs.h | 1 - 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/arm/strongarm.h b/hw/arm/strongarm.h index e98840b..ae51a1a 100644 --- a/hw/arm/strongarm.h +++ b/hw/arm/strongarm.h @@ -3,6 +3,7 @@ #include "exec/memory.h" #include "target/arm/cpu-qom.h" +#include "hw/ssi/ssi.h" #define SA_CS0 0x00000000 #define SA_CS1 0x08000000 diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index f6dfb5c..f184349 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -13,6 +13,7 @@ #include "exec/memory.h" #include "target/arm/cpu-qom.h" #include "hw/pcmcia.h" +#include "hw/ssi/ssi.h" /* Interrupt numbers */ # define PXA2XX_PIC_SSP3 0 diff --git a/include/hw/ssi/pl022.h b/include/hw/ssi/pl022.h index a080519..1cf16f1 100644 --- a/include/hw/ssi/pl022.h +++ b/include/hw/ssi/pl022.h @@ -22,6 +22,7 @@ #define HW_SSI_PL022_H #include "hw/sysbus.h" +#include "hw/ssi/ssi.h" #define TYPE_PL022 "pl022" #define PL022(obj) OBJECT_CHECK(PL022State, (obj), TYPE_PL022) diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h index 6a0c3c3..bdbf3c5 100644 --- a/include/hw/ssi/ssi.h +++ b/include/hw/ssi/ssi.h @@ -13,6 +13,7 @@ #include "hw/qdev.h" +typedef struct SSIBus SSIBus; typedef struct SSISlave SSISlave; typedef struct SSISlaveClass SSISlaveClass; typedef enum SSICSMode SSICSMode; diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 3bd9215..c026229 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -108,7 +108,6 @@ typedef struct Range Range; typedef struct SerialState SerialState; typedef struct SHPCDevice SHPCDevice; typedef struct SMBusDevice SMBusDevice; -typedef struct SSIBus SSIBus; typedef struct uWireSlave uWireSlave; typedef struct VirtIODevice VirtIODevice; typedef struct Visitor Visitor; From patchwork Mon Jan 14 10:02:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761977 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4AC2F139A for ; Mon, 14 Jan 2019 10:15:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D500284C9 for ; Mon, 14 Jan 2019 10:15:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3163E289CC; Mon, 14 Jan 2019 10:15:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CAEE5284C9 for ; Mon, 14 Jan 2019 10:15:53 +0000 (UTC) Received: from localhost ([127.0.0.1]:35857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizHd-0008P7-1I for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:15:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4z-0005dY-Km for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4x-0007Xv-Tg for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55246) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4v-0007Vw-MO for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:47 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 49A68356D5; Mon, 14 Jan 2019 10:02:44 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38747101963E; Mon, 14 Jan 2019 10:02:43 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:08 +0100 Message-Id: <1547460140-1473-14-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 14 Jan 2019 10:02:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 13/25] hw/ide/ahci: Remove AllwinnerAHCIState from "qemu/typedefs.h" 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé Files requiring AllwinnerAHCIState already include "hw/ide/ahci.h". To clean "qemu/typedefs.h", move the declaration to "hw/ide/ahci.h" (removing the forward declaration). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- include/hw/ide/ahci.h | 4 ++-- include/qemu/typedefs.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h index b7bb2b0..b44e300 100644 --- a/include/hw/ide/ahci.h +++ b/include/hw/ide/ahci.h @@ -73,13 +73,13 @@ typedef struct SysbusAHCIState { #define ALLWINNER_AHCI_MMIO_OFF 0x80 #define ALLWINNER_AHCI_MMIO_SIZE 0x80 -struct AllwinnerAHCIState { +typedef struct AllwinnerAHCIState { /*< private >*/ SysbusAHCIState parent_obj; /*< public >*/ MemoryRegion mmio; uint32_t regs[ALLWINNER_AHCI_MMIO_SIZE/4]; -}; +} AllwinnerAHCIState; #endif /* HW_IDE_AHCI_H */ diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index c026229..3a5ca74 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -8,7 +8,6 @@ typedef struct AdapterInfo AdapterInfo; typedef struct AddressSpace AddressSpace; typedef struct AioContext AioContext; -typedef struct AllwinnerAHCIState AllwinnerAHCIState; typedef struct AudioState AudioState; typedef struct BdrvDirtyBitmap BdrvDirtyBitmap; typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter; From patchwork Mon Jan 14 10:02:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10762031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8585139A for ; Mon, 14 Jan 2019 10:23:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAAF42882F for ; Mon, 14 Jan 2019 10:23:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE76B289A5; Mon, 14 Jan 2019 10:23:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6FA082882F for ; Mon, 14 Jan 2019 10:23:22 +0000 (UTC) Received: from localhost ([127.0.0.1]:37261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizOr-0005qG-J0 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:23:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz4z-0005dX-Hd for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4y-0007Y4-3k for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30379) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4x-0007Wu-TN for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:48 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A9962C0587FF; Mon, 14 Jan 2019 10:02:45 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90DDD101963E; Mon, 14 Jan 2019 10:02:44 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:09 +0100 Message-Id: <1547460140-1473-15-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 14 Jan 2019 10:02:45 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 14/25] hw/i2c/smbus: Remove SMBusDevice from "qemu/typedefs.h" 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé Files requiring SMBusDevice already include "hw/i2c/smbus.h". To clean "qemu/typedefs.h", move the forward declaration to "hw/i2c/smbus.h". Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- include/hw/i2c/smbus.h | 2 ++ include/qemu/typedefs.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/i2c/smbus.h b/include/hw/i2c/smbus.h index d8b1b9e..5c61c05 100644 --- a/include/hw/i2c/smbus.h +++ b/include/hw/i2c/smbus.h @@ -35,6 +35,8 @@ #define SMBUS_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(SMBusDeviceClass, (obj), TYPE_SMBUS_DEVICE) +typedef struct SMBusDevice SMBusDevice; + typedef struct SMBusDeviceClass { I2CSlaveClass parent_class; diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 3a5ca74..26e40fd 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -106,7 +106,6 @@ typedef struct RAMBlock RAMBlock; typedef struct Range Range; typedef struct SerialState SerialState; typedef struct SHPCDevice SHPCDevice; -typedef struct SMBusDevice SMBusDevice; typedef struct uWireSlave uWireSlave; typedef struct VirtIODevice VirtIODevice; typedef struct Visitor Visitor; From patchwork Mon Jan 14 10:02:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10762039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7F8613B4 for ; Mon, 14 Jan 2019 10:26:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB6CB28B38 for ; Mon, 14 Jan 2019 10:26:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFEE528B44; Mon, 14 Jan 2019 10:26:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7560E28B38 for ; Mon, 14 Jan 2019 10:26:31 +0000 (UTC) Received: from localhost ([127.0.0.1]:37920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizRu-0000EI-Mn for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:26:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz53-0005gn-Rk for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4y-0007Y9-48 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52560) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4x-0007XV-To for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:48 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01A70394D54; Mon, 14 Jan 2019 10:02:47 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id E931B104810D; Mon, 14 Jan 2019 10:02:45 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:10 +0100 Message-Id: <1547460140-1473-16-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 14 Jan 2019 10:02:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 15/25] hw/bt: Remove HCIInfo from "qemu/typedefs.h" 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé Files requiring HCIInfo already include "sysemu/bt.h". To clean "qemu/typedefs.h", move the declaration to "sysemu/bt.h" (removing the forward declaration). Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- include/qemu/typedefs.h | 1 - include/sysemu/bt.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 26e40fd..7271e98 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -35,7 +35,6 @@ typedef struct FWCfgEntry FWCfgEntry; typedef struct FWCfgIoState FWCfgIoState; typedef struct FWCfgMemState FWCfgMemState; typedef struct FWCfgState FWCfgState; -typedef struct HCIInfo HCIInfo; typedef struct HVFX86EmulatorState HVFX86EmulatorState; typedef struct I2CBus I2CBus; typedef struct I2SCodec I2SCodec; diff --git a/include/sysemu/bt.h b/include/sysemu/bt.h index ddb05cd..2fd8c0f 100644 --- a/include/sysemu/bt.h +++ b/include/sysemu/bt.h @@ -3,7 +3,7 @@ /* BT HCI info */ -struct HCIInfo { +typedef struct HCIInfo { int (*bdaddr_set)(struct HCIInfo *hci, const uint8_t *bd_addr); void (*cmd_send)(struct HCIInfo *hci, const uint8_t *data, int len); void (*sco_send)(struct HCIInfo *hci, const uint8_t *data, int len); @@ -11,7 +11,7 @@ struct HCIInfo { void *opaque; void (*evt_recv)(void *opaque, const uint8_t *data, int len); void (*acl_recv)(void *opaque, const uint8_t *data, int len); -}; +} HCIInfo; /* bt-host.c */ struct HCIInfo *bt_host_hci(const char *id); From patchwork Mon Jan 14 10:02:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF39F6C2 for ; Mon, 14 Jan 2019 10:12:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1CF02880D for ; Mon, 14 Jan 2019 10:12:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D666E28AB7; Mon, 14 Jan 2019 10:12:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 874FF2880D for ; Mon, 14 Jan 2019 10:12:08 +0000 (UTC) Received: from localhost ([127.0.0.1]:34937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizDz-0005HA-Ll for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:12:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz51-0005g4-R5 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz4z-0007ZO-LA for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59772) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz4z-0007Ye-DJ for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:49 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72704811DA; Mon, 14 Jan 2019 10:02:48 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 48B90101963E; Mon, 14 Jan 2019 10:02:47 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:11 +0100 Message-Id: <1547460140-1473-17-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 14 Jan 2019 10:02:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 16/25] hw/char/serial: Remove SerialState from "qemu/typedefs.h" 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé Files requiring SerialState already include "hw/char/serial.h". To clean "qemu/typedefs.h", move the declaration to "hw/char/serial.h" (removing the forward declaration). Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- include/hw/char/serial.h | 4 ++-- include/qemu/typedefs.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index 0acfbbc..abd5cf7 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -35,7 +35,7 @@ #define UART_FIFO_LENGTH 16 /* 16550A Fifo Length */ -struct SerialState { +typedef struct SerialState { uint16_t divider; uint8_t rbr; /* receive register */ uint8_t thr; /* transmit holding register */ @@ -77,7 +77,7 @@ struct SerialState { QEMUTimer *modem_status_poll; MemoryRegion io; -}; +} SerialState; extern const VMStateDescription vmstate_serial; extern const MemoryRegionOps serial_io_ops; diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 7271e98..4c694b7 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -103,7 +103,6 @@ typedef struct QObject QObject; typedef struct QString QString; typedef struct RAMBlock RAMBlock; typedef struct Range Range; -typedef struct SerialState SerialState; typedef struct SHPCDevice SHPCDevice; typedef struct uWireSlave uWireSlave; typedef struct VirtIODevice VirtIODevice; From patchwork Mon Jan 14 10:02:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 54DA56C2 for ; Mon, 14 Jan 2019 10:13:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4482B289CC for ; Mon, 14 Jan 2019 10:13:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37F3528ACE; Mon, 14 Jan 2019 10:13:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DC5EE289CC for ; Mon, 14 Jan 2019 10:13:16 +0000 (UTC) Received: from localhost ([127.0.0.1]:35218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizF6-0006CH-36 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:13:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz59-0005kd-9R for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:03:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz53-0007b8-IH for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50451) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz51-0007Zh-PK for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:52 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D819180F82; Mon, 14 Jan 2019 10:02:49 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD5D2101963E; Mon, 14 Jan 2019 10:02:48 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:12 +0100 Message-Id: <1547460140-1473-18-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 14 Jan 2019 10:02:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 17/25] hw/i386: Remove PCMachineClass from "qemu/typedefs.h" 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé Files requiring PCMachineClass already include "hw/i386/pc.h". To clean "qemu/typedefs.h", move the declaration to "hw/i386/pc.h" (removing the forward declaration). Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- include/hw/i386/pc.h | 4 ++-- include/qemu/typedefs.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 0abbe45..882fd8d 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -96,7 +96,7 @@ struct PCMachineState { * way we can use 1GByte pages in the host. * */ -struct PCMachineClass { +typedef struct PCMachineClass { /*< private >*/ MachineClass parent_class; @@ -133,7 +133,7 @@ struct PCMachineClass { /* use DMA capable linuxboot option rom */ bool linuxboot_dma_enabled; -}; +} PCMachineClass; #define TYPE_PC_MACHINE "generic-pc-machine" #define PC_MACHINE(obj) \ diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 4c694b7..5edf44e 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -74,7 +74,6 @@ typedef struct PCIExpressDevice PCIExpressDevice; typedef struct PCIExpressHost PCIExpressHost; typedef struct PCIHostDeviceAddress PCIHostDeviceAddress; typedef struct PCIHostState PCIHostState; -typedef struct PCMachineClass PCMachineClass; typedef struct PCMachineState PCMachineState; typedef struct PixelFormat PixelFormat; typedef struct PostcopyDiscardState PostcopyDiscardState; From patchwork Mon Jan 14 10:02:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761965 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE6F1139A for ; Mon, 14 Jan 2019 10:09:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE7322879E for ; Mon, 14 Jan 2019 10:09:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2887289CC; Mon, 14 Jan 2019 10:09:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 64C0E2879E for ; Mon, 14 Jan 2019 10:09:46 +0000 (UTC) Received: from localhost ([127.0.0.1]:34352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizBh-0003Ke-8T for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:09:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz54-0005gr-JR for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz53-0007bI-Od for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4414) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz53-0007aG-Iu for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:53 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36213804F0; Mon, 14 Jan 2019 10:02:51 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C8C9101963E; Mon, 14 Jan 2019 10:02:50 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:13 +0100 Message-Id: <1547460140-1473-19-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 14 Jan 2019 10:02:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 18/25] audio: Remove AudioState from "qemu/typedefs.h" 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé Files requiring AudioState already include "audio_int.h". To clean "qemu/typedefs.h", move the declaration to "audio_int.h" (removing the forward declaration). Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- audio/audio_int.h | 4 ++-- include/qemu/typedefs.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index 244b454..6c451b9 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -191,7 +191,7 @@ struct SWVoiceCap { QLIST_ENTRY (SWVoiceCap) entries; }; -struct AudioState { +typedef struct AudioState { struct audio_driver *drv; void *drv_opaque; @@ -203,7 +203,7 @@ struct AudioState { int nb_hw_voices_out; int nb_hw_voices_in; int vm_running; -}; +} AudioState; extern const struct mixeng_volume nominal_volume; diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 5edf44e..c6d1c1b 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -8,7 +8,6 @@ typedef struct AdapterInfo AdapterInfo; typedef struct AddressSpace AddressSpace; typedef struct AioContext AioContext; -typedef struct AudioState AudioState; typedef struct BdrvDirtyBitmap BdrvDirtyBitmap; typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter; typedef struct BlockBackend BlockBackend; From patchwork Mon Jan 14 10:02:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10762041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E7AB13B4 for ; Mon, 14 Jan 2019 10:29:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F030284C0 for ; Mon, 14 Jan 2019 10:29:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12D662863E; Mon, 14 Jan 2019 10:29:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B1DA028617 for ; Mon, 14 Jan 2019 10:29:12 +0000 (UTC) Received: from localhost ([127.0.0.1]:38464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizUV-0002W9-V2 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:29:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz54-0005gq-JS for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz53-0007bO-PL for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59856) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz53-0007al-JU for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:53 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8AC33804EF; Mon, 14 Jan 2019 10:02:52 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80D47101963E; Mon, 14 Jan 2019 10:02:51 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:14 +0100 Message-Id: <1547460140-1473-20-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 14 Jan 2019 10:02:52 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 19/25] ui/console: Remove QemuDmaBuf from "qemu/typedefs.h" 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé Files requiring QemuDmaBuf already include "ui/console.h". To clean "qemu/typedefs.h", move the declaration to "ui/console.h" (removing the forward declaration). Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- include/qemu/typedefs.h | 1 - include/ui/console.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index c6d1c1b..67dd04f 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -82,7 +82,6 @@ typedef struct QBool QBool; typedef struct QDict QDict; typedef struct QEMUBH QEMUBH; typedef struct QemuConsole QemuConsole; -typedef struct QemuDmaBuf QemuDmaBuf; typedef struct QEMUFile QEMUFile; typedef struct QemuLockable QemuLockable; typedef struct QemuMutex QemuMutex; diff --git a/include/ui/console.h b/include/ui/console.h index 853fcf4..c4f497c 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -179,7 +179,7 @@ struct QEMUGLParams { int minor_ver; }; -struct QemuDmaBuf { +typedef struct QemuDmaBuf { int fd; uint32_t width; uint32_t height; @@ -187,7 +187,7 @@ struct QemuDmaBuf { uint32_t fourcc; uint32_t texture; bool y0_top; -}; +} QemuDmaBuf; typedef struct DisplayChangeListenerOps { const char *dpy_name; From patchwork Mon Jan 14 10:02:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10762033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A50A0139A for ; Mon, 14 Jan 2019 10:23:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97A422882F for ; Mon, 14 Jan 2019 10:23:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B6C1289A5; Mon, 14 Jan 2019 10:23:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3CD492882F for ; Mon, 14 Jan 2019 10:23:28 +0000 (UTC) Received: from localhost ([127.0.0.1]:37292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizOx-0005xU-E8 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:23:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz56-0005hi-PQ for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz54-0007cG-TX for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42024) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz54-0007bd-Nl for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:54 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E747920265; Mon, 14 Jan 2019 10:02:53 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2F031084260; Mon, 14 Jan 2019 10:02:52 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:15 +0100 Message-Id: <1547460140-1473-21-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 14 Jan 2019 10:02:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 20/25] ui/console: Remove DisplayState/DisplaySurface from "qemu/typedefs.h" 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé Files requiring DisplayState/DisplaySurface already include "ui/console.h". To clean "qemu/typedefs.h", move the declarations to "ui/console.h" (removing DisplaySurface forward declaration). Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- include/qemu/typedefs.h | 2 -- include/ui/console.h | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 67dd04f..30ad8b2 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -24,8 +24,6 @@ typedef struct DeviceListener DeviceListener; typedef struct DeviceState DeviceState; typedef struct DirtyBitmapSnapshot DirtyBitmapSnapshot; typedef struct DisplayChangeListener DisplayChangeListener; -typedef struct DisplayState DisplayState; -typedef struct DisplaySurface DisplaySurface; typedef struct DriveInfo DriveInfo; typedef struct Error Error; typedef struct EventNotifier EventNotifier; diff --git a/include/ui/console.h b/include/ui/console.h index c4f497c..0a19037 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -131,7 +131,7 @@ struct PixelFormat { uint8_t rbits, gbits, bbits, abits; }; -struct DisplaySurface { +typedef struct DisplaySurface { pixman_format_code_t format; pixman_image_t *image; uint8_t flags; @@ -140,7 +140,7 @@ struct DisplaySurface { GLenum gltype; GLuint texture; #endif -}; +} DisplaySurface; typedef struct QemuUIInfo { /* geometry */ @@ -189,6 +189,8 @@ typedef struct QemuDmaBuf { bool y0_top; } QemuDmaBuf; +typedef struct DisplayState DisplayState; + typedef struct DisplayChangeListenerOps { const char *dpy_name; From patchwork Mon Jan 14 10:02:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10762055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51C486C2 for ; Mon, 14 Jan 2019 10:32:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43A0628A6A for ; Mon, 14 Jan 2019 10:32:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3593728B37; Mon, 14 Jan 2019 10:32:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ADDD528A6A for ; Mon, 14 Jan 2019 10:32:46 +0000 (UTC) Received: from localhost ([127.0.0.1]:39195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizXv-0005MM-Vl for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:32:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz57-0005ii-HC for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz56-0007cl-87 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34544) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz56-0007cU-2o for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A96580E7B; Mon, 14 Jan 2019 10:02:55 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37C88101963E; Mon, 14 Jan 2019 10:02:54 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:16 +0100 Message-Id: <1547460140-1473-22-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 14 Jan 2019 10:02:55 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 21/25] linux-user: Fix compilation with clang 3.4 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang version 3.4.2 does not know the -Wpragmas option yet and bails out with an error when we try to disable it in linux-user/qemu.h. Fortunately, clang has a __has_warning() macro which allows us to add an explicit check for the option that we want to ignore. With that we can check for the availability of "-Waddress-of-packed-member" properly and do not need the "-Wpragmas" at all here. Fixes: 850d5e330a9c68cc998cecc02caf8a3c8d1ee8a3 Reviewed-by: Laurent Vivier Signed-off-by: Thomas Huth --- include/qemu/compiler.h | 4 ++++ linux-user/qemu.h | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 261842b..28fa438 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -113,6 +113,10 @@ #define GCC_FMT_ATTR(n, m) #endif +#ifndef __has_warning +#define __has_warning(x) 0 /* compatibility with non-clang compilers */ +#endif + #ifndef __has_feature #define __has_feature(x) 0 /* compatibility with non-clang compilers */ #endif diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 069df8f..ef400cb 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -474,17 +474,13 @@ static inline int access_ok(int type, abi_ulong addr, abi_ulong size) * functions than host-endian unaligned load/store plus tswapN. * - The pragmas are necessary only to silence a clang false-positive * warning: see https://bugs.llvm.org/show_bug.cgi?id=39113 . - * - We have to disable -Wpragmas warnings to avoid a complaint about - * an unknown warning type from older compilers that don't know about - * -Waddress-of-packed-member. * - gcc has bugs in its _Pragma() support in some versions, eg * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83256 -- so we only * include the warning-suppression pragmas for clang */ -#ifdef __clang__ +#if defined(__clang__) && __has_warning("-Waddress-of-packed-member") #define PRAGMA_DISABLE_PACKED_WARNING \ _Pragma("GCC diagnostic push"); \ - _Pragma("GCC diagnostic ignored \"-Wpragmas\""); \ _Pragma("GCC diagnostic ignored \"-Waddress-of-packed-member\"") #define PRAGMA_REENABLE_PACKED_WARNING \ From patchwork Mon Jan 14 10:02:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10762043 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDBEE139A for ; Mon, 14 Jan 2019 10:29:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D070A28A61 for ; Mon, 14 Jan 2019 10:29:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C490E28A6A; Mon, 14 Jan 2019 10:29:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AF14E28A61 for ; Mon, 14 Jan 2019 10:29:21 +0000 (UTC) Received: from localhost ([127.0.0.1]:38490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizUf-0002by-0M for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:29:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz58-0005jw-L0 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:03:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz57-0007dM-MK for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45122) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz57-0007d2-Dr for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:57 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A1C6DC05D3EF; Mon, 14 Jan 2019 10:02:56 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E3ED101963E; Mon, 14 Jan 2019 10:02:55 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:17 +0100 Message-Id: <1547460140-1473-23-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 14 Jan 2019 10:02:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 22/25] ppc: Move spapr-related prototypes from xics.h into a seperate header file 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP When compiling with Clang in -std=gnu99 mode, there is a warning/error: CC ppc64-softmmu/hw/intc/xics_spapr.o In file included from /home/thuth/devel/qemu/hw/intc/xics_spapr.c:34: /home/thuth/devel/qemu/include/hw/ppc/xics.h:203:34: error: redefinition of typedef 'sPAPRMachineState' is a C11 feature [-Werror,-Wtypedef-redefinition] typedef struct sPAPRMachineState sPAPRMachineState; ^ /home/thuth/devel/qemu/include/hw/ppc/spapr_irq.h:25:34: note: previous definition is here typedef struct sPAPRMachineState sPAPRMachineState; ^ We have to remove the duplicated typedef here and include "spapr.h" instead. But "spapr.h" should not be included for the pnv machine files. So move the spapr-related prototypes into a new file called "xics_spapr.h" instead. Reviewed-by: Greg Kurz Reviewed-by: Cédric Le Goater Reviewed-by: Daniel P. Berrangé Signed-off-by: Thomas Huth --- hw/intc/xics_kvm.c | 1 + hw/intc/xics_spapr.c | 1 + hw/ppc/spapr_irq.c | 1 + include/hw/ppc/xics.h | 7 ------- include/hw/ppc/xics_spapr.h | 37 +++++++++++++++++++++++++++++++++++++ 5 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 include/hw/ppc/xics_spapr.h diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index ac94594..dff1330 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -34,6 +34,7 @@ #include "sysemu/kvm.h" #include "hw/ppc/spapr.h" #include "hw/ppc/xics.h" +#include "hw/ppc/xics_spapr.h" #include "kvm_ppc.h" #include "qemu/config-file.h" #include "qemu/error-report.h" diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c index 9c1a90d..de6cc15 100644 --- a/hw/intc/xics_spapr.c +++ b/hw/intc/xics_spapr.c @@ -32,6 +32,7 @@ #include "qemu/timer.h" #include "hw/ppc/spapr.h" #include "hw/ppc/xics.h" +#include "hw/ppc/xics_spapr.h" #include "hw/ppc/fdt.h" #include "qapi/visitor.h" diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index 5fce72f..1da7a32 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -14,6 +14,7 @@ #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_xive.h" #include "hw/ppc/xics.h" +#include "hw/ppc/xics_spapr.h" #include "sysemu/kvm.h" #include "trace.h" diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 07508cb..fad786e 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -200,13 +200,6 @@ void ics_pic_print_info(ICSState *ics, Monitor *mon); void ics_resend(ICSState *ics); void icp_resend(ICPState *ss); -typedef struct sPAPRMachineState sPAPRMachineState; - -void spapr_dt_xics(sPAPRMachineState *spapr, uint32_t nr_servers, void *fdt, - uint32_t phandle); -int xics_kvm_init(sPAPRMachineState *spapr, Error **errp); -void xics_spapr_init(sPAPRMachineState *spapr); - Object *icp_create(Object *cpu, const char *type, XICSFabric *xi, Error **errp); diff --git a/include/hw/ppc/xics_spapr.h b/include/hw/ppc/xics_spapr.h new file mode 100644 index 0000000..b1ab27d --- /dev/null +++ b/include/hw/ppc/xics_spapr.h @@ -0,0 +1,37 @@ +/* + * QEMU PowerPC pSeries Logical Partition (aka sPAPR) hardware System Emulator + * + * PAPR Virtualized Interrupt System, aka ICS/ICP aka xics + * + * Copyright (c) 2010, 2011 David Gibson, IBM Corporation. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef XICS_SPAPR_H +#define XICS_SPAPR_H + +#include "hw/ppc/spapr.h" + +void spapr_dt_xics(sPAPRMachineState *spapr, uint32_t nr_servers, void *fdt, + uint32_t phandle); +int xics_kvm_init(sPAPRMachineState *spapr, Error **errp); +void xics_spapr_init(sPAPRMachineState *spapr); + +#endif /* XICS_SPAPR_H */ From patchwork Mon Jan 14 10:02:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761985 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D40A8139A for ; Mon, 14 Jan 2019 10:20:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7A8D2882F for ; Mon, 14 Jan 2019 10:20:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C611B28B7B; Mon, 14 Jan 2019 10:20:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 459082882F for ; Mon, 14 Jan 2019 10:20:56 +0000 (UTC) Received: from localhost ([127.0.0.1]:36822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizMU-0003zz-Mo for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:20:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz59-0005lG-Tu for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:03:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz59-0007fU-0P for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52662) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz58-0007dh-OW for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:02:58 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03DCD99D2E; Mon, 14 Jan 2019 10:02:58 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id EBBD8101963C; Mon, 14 Jan 2019 10:02:56 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:18 +0100 Message-Id: <1547460140-1473-24-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 14 Jan 2019 10:02:58 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 23/25] ppc: Fix duplicated typedefs to be able to compile with Clang in gnu99 mode 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP When compiling the ppc code with clang and -std=gnu99, there are a couple of warnings/errors like this one: CC ppc64-softmmu/hw/intc/xics.o In file included from hw/intc/xics.c:35: include/hw/ppc/xics.h:43:25: error: redefinition of typedef 'ICPState' is a C11 feature [-Werror,-Wtypedef-redefinition] typedef struct ICPState ICPState; ^ target/ppc/cpu.h:1181:25: note: previous definition is here typedef struct ICPState ICPState; ^ Work around the problems by including the proper headers instead. Reviewed-by: Cédric Le Goater Reviewed-by: Greg Kurz Reviewed-by: Daniel P. Berrangé Signed-off-by: Thomas Huth --- include/hw/ppc/spapr.h | 5 +++-- include/hw/ppc/spapr_xive.h | 2 -- target/ppc/cpu.h | 13 +++++++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 9e01a5a..a947a0a 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -8,15 +8,16 @@ #include "hw/mem/pc-dimm.h" #include "hw/ppc/spapr_ovec.h" #include "hw/ppc/spapr_irq.h" +#include "hw/ppc/spapr_xive.h" /* For sPAPRXive */ +#include "hw/ppc/xics.h" /* For ICSState */ struct VIOsPAPRBus; struct sPAPRPHBState; struct sPAPRNVRAM; + typedef struct sPAPREventLogEntry sPAPREventLogEntry; typedef struct sPAPREventSource sPAPREventSource; typedef struct sPAPRPendingHPT sPAPRPendingHPT; -typedef struct ICSState ICSState; -typedef struct sPAPRXive sPAPRXive; #define HPTE64_V_HPTE_DIRTY 0x0000000000000040ULL #define SPAPR_ENTRY_POINT 0x100 diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h index 7fdc250..9bec919 100644 --- a/include/hw/ppc/spapr_xive.h +++ b/include/hw/ppc/spapr_xive.h @@ -41,8 +41,6 @@ bool spapr_xive_irq_claim(sPAPRXive *xive, uint32_t lisn, bool lsi); bool spapr_xive_irq_free(sPAPRXive *xive, uint32_t lisn); void spapr_xive_pic_print_info(sPAPRXive *xive, Monitor *mon); -typedef struct sPAPRMachineState sPAPRMachineState; - void spapr_xive_hcall_init(sPAPRMachineState *spapr); void spapr_dt_xive(sPAPRMachineState *spapr, uint32_t nr_servers, void *fdt, uint32_t phandle); diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 486abaf..bde4dff 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -23,6 +23,11 @@ #include "qemu-common.h" #include "qemu/int128.h" +#ifndef CONFIG_USER_ONLY +#include "hw/ppc/xive.h" /* for XiveTCTX */ +#include "hw/ppc/xics.h" /* for ICPState */ +#endif + //#define PPC_EMULATE_32BITS_HYPV #if defined (TARGET_PPC64) @@ -1177,8 +1182,6 @@ do { \ typedef struct PPCVirtualHypervisor PPCVirtualHypervisor; typedef struct PPCVirtualHypervisorClass PPCVirtualHypervisorClass; -typedef struct XiveTCTX XiveTCTX; -typedef struct ICPState ICPState; /** * PowerPCCPU: @@ -1197,11 +1200,13 @@ struct PowerPCCPU { int vcpu_id; uint32_t compat_pvr; PPCVirtualHypervisor *vhyp; - ICPState *icp; - XiveTCTX *tctx; void *machine_data; int32_t node_id; /* NUMA node this CPU belongs to */ PPCHash64Options *hash64_opts; +#ifndef CONFIG_USER_ONLY + ICPState *icp; + XiveTCTX *tctx; +#endif /* Fields related to migration compatibility hacks */ bool pre_2_8_migration; From patchwork Mon Jan 14 10:02:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10761979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B0B2139A for ; Mon, 14 Jan 2019 10:17:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E5AE28AB7 for ; Mon, 14 Jan 2019 10:17:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42F5128AD2; Mon, 14 Jan 2019 10:17:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D853128AB7 for ; Mon, 14 Jan 2019 10:17:01 +0000 (UTC) Received: from localhost ([127.0.0.1]:36098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizIj-0000ng-1u for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:17:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz5B-0005lR-HX for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:03:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz5A-0007gU-G7 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:03:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57699) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz5A-0007fr-AX for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:03:00 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B95280F7C; Mon, 14 Jan 2019 10:02:59 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D0A0101963C; Mon, 14 Jan 2019 10:02:58 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:19 +0100 Message-Id: <1547460140-1473-25-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 14 Jan 2019 10:02:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 24/25] configure: Force the C standard to gnu99 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Different versions of GCC and Clang use different versions of the C standard. This repeatedly caused problems already, e.g. with duplicated typedefs: https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg05829.html or with for-loop variable initializers: https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg00237.html To avoid these problems, we should enforce the C language version to the same level for all compilers. Since our minimum compiler versions is GCC v4.8, our best option is "gnu99" for C code right now ("gnu17" is not available there yet, and "gnu11" is marked as "experimental"), and "gnu++98" for the few C++ code that we have in the repository. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Greg Kurz Reviewed-by: Daniel P. Berrangé Reviewed-by: Alex Bennée Signed-off-by: Thomas Huth --- configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure b/configure index e0915da..05b7e85 100755 --- a/configure +++ b/configure @@ -107,6 +107,9 @@ update_cxxflags() { -Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\ -Wold-style-declaration|-Wold-style-definition|-Wredundant-decls) ;; + -std=gnu99) + QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }"-std=gnu++98" + ;; *) QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }$arg ;; @@ -585,7 +588,7 @@ ARFLAGS="${ARFLAGS-rv}" # left shift of signed integers is well defined and has the expected # 2s-complement style results. (Both clang and gcc agree that it # provides these semantics.) -QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv $QEMU_CFLAGS" +QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv -std=gnu99 $QEMU_CFLAGS" QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" From patchwork Mon Jan 14 10:02:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10762035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 36561139A for ; Mon, 14 Jan 2019 10:24:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9CD628A38 for ; Mon, 14 Jan 2019 10:24:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B1CC28B14; Mon, 14 Jan 2019 10:24:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3D5A628A38 for ; Mon, 14 Jan 2019 10:24:29 +0000 (UTC) Received: from localhost ([127.0.0.1]:37464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gizPw-0006mL-Gp for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 05:24:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giz5D-0005nm-Bd for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:03:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giz5B-0007gy-Lh for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:03:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54342) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giz5B-0007ga-FD for qemu-devel@nongnu.org; Mon, 14 Jan 2019 05:03:01 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AFA7D13A90; Mon, 14 Jan 2019 10:03:00 +0000 (UTC) Received: from thuth.com (ovpn-116-190.ams2.redhat.com [10.36.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id A48D4101963C; Mon, 14 Jan 2019 10:02:59 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 11:02:20 +0100 Message-Id: <1547460140-1473-26-git-send-email-thuth@redhat.com> In-Reply-To: <1547460140-1473-1-git-send-email-thuth@redhat.com> References: <1547460140-1473-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 14 Jan 2019 10:03:00 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 25/25] tests/hexloader-test: Don't pass -nographic to the QEMU under test 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: Li Qiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Maydell The hexloader test invokes QEMU with the -nographic argument. This is unnecessary, because the qtest_initf() function will pass it -display none, which suffices to disable the graphical window. It also means that the QEMU process will make the stdin/stdout O_NONBLOCK. Since O_NONBLOCK is not per-file descriptor but per "file description", this non-blocking behaviour is then shared with any other process that's using the stdin/stdout of the 'make check' run, including make itself. This can result in make falling over with "make: write error: stdout" because it got an unexpected EINTR trying to write output messages to the terminal. This is particularly noticable if running 'make check' in a loop with while make check; do true; done (It does not affect single make check runs so much because the shell will remove the O_NONBLOCK status before it reads the terminal for interactive input.) Remove the unwanted -nographic argument. Signed-off-by: Peter Maydell Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/hexloader-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hexloader-test.c b/tests/hexloader-test.c index 834ed52..8b7aa2d 100644 --- a/tests/hexloader-test.c +++ b/tests/hexloader-test.c @@ -23,7 +23,7 @@ static void hex_loader_test(void) const unsigned int base_addr = 0x00010000; QTestState *s = qtest_initf( - "-M vexpress-a9 -nographic -device loader,file=tests/data/hex-loader/test.hex"); + "-M vexpress-a9 -device loader,file=tests/data/hex-loader/test.hex"); for (i = 0; i < 256; ++i) { uint8_t val = qtest_readb(s, base_addr + i);