From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150583954368820.760700275261684; Tue, 19 Sep 2017 09:45:43 -0700 (PDT) Received: from localhost ([::1]:44089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLeZ-0006gM-0V for importer@patchew.org; Tue, 19 Sep 2017 12:45:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLcl-0005Ui-Hs for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLck-0002Hb-FN for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:43:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47480) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLck-0002H1-9W for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:43:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3286A4FD; Tue, 19 Sep 2017 16:43:49 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2C405D75D; Tue, 19 Sep 2017 16:43:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3286A4FD Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:00 +0200 Message-Id: <20170919164337.18555-2-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 19 Sep 2017 16:43:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 01/38] s390x/css: fix cc handling for XSCH 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, Halil Pasic , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Halil Pasic The function ioinst_handle_xsch is presenting cc 2 when it's supposed to present cc 1 and the other way around, because css_do_xsch has the error codes mixed up. Because cc 1 has precedence over cc 2 we also have to swap the two checks. Let us fix this. Signed-off-by: Halil Pasic Reported-by: Pierre Morel Message-Id: <20170831121828.85885-1-pasic@linux.vnet.ibm.com> Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/css.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 901dc6a0f3..5d3de71c4c 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -1276,16 +1276,16 @@ int css_do_xsch(SubchDev *sch) goto out; } =20 + if (s->ctrl & SCSW_CTRL_MASK_STCTL) { + ret =3D -EINPROGRESS; + goto out; + } + if (!(s->ctrl & SCSW_CTRL_MASK_FCTL) || ((s->ctrl & SCSW_CTRL_MASK_FCTL) !=3D SCSW_FCTL_START_FUNC) || (!(s->ctrl & (SCSW_ACTL_RESUME_PEND | SCSW_ACTL_START_PEND | SCSW_ACTL_SUSP)= )) || (s->ctrl & SCSW_ACTL_SUBCH_ACTIVE)) { - ret =3D -EINPROGRESS; - goto out; - } - - if (s->ctrl & SCSW_CTRL_MASK_STCTL) { ret =3D -EBUSY; goto out; } --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505839554826601.1333728267068; Tue, 19 Sep 2017 09:45:54 -0700 (PDT) Received: from localhost ([::1]:44090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLej-0006rd-Q1 for importer@patchew.org; Tue, 19 Sep 2017 12:45:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLcs-0005ZX-Gb for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLcp-0002LU-LG for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:43:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42672) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLcp-0002L2-BZ for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:43:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 50478800A4; Tue, 19 Sep 2017 16:43:54 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6392A5C541; Tue, 19 Sep 2017 16:43:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 50478800A4 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:01 +0200 Message-Id: <20170919164337.18555-3-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 19 Sep 2017 16:43:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 02/38] tests: Enable the drive_del test also on s390x 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth We can use the drive_del test on s390x, too, to check that adding and deleting also works fine with the virtio-ccw bus. But we have to make sure that we use the devices with the "-ccw" suffix instead of the "-pci" suffix for the virtio-ccw transport on s390x. Introduce a helper function called qvirtio_get_dev_type() that returns the correct string for the current architecture. Signed-off-by: Thomas Huth Message-Id: <1504190408-11143-1-git-send-email-thuth@redhat.com> Reviewed-by: David Hildenbrand Signed-off-by: Cornelia Huck --- tests/Makefile.include | 3 ++- tests/drive_del-test.c | 25 ++++++++++++++++--------- tests/libqos/virtio.c | 17 +++++++++++++++++ tests/libqos/virtio.h | 3 +++ 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index d680cda833..abc6707ef2 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -366,6 +366,7 @@ check-qtest-s390x-$(CONFIG_SLIRP) +=3D tests/pxe-test$(= EXESUF) check-qtest-s390x-$(CONFIG_SLIRP) +=3D tests/test-netfilter$(EXESUF) check-qtest-s390x-$(CONFIG_POSIX) +=3D tests/test-filter-mirror$(EXESUF) check-qtest-s390x-$(CONFIG_POSIX) +=3D tests/test-filter-redirector$(EXESU= F) +check-qtest-s390x-y +=3D tests/drive_del-test$(EXESUF) =20 check-qtest-generic-y +=3D tests/qom-test$(EXESUF) check-qtest-generic-y +=3D tests/test-hmp$(EXESUF) @@ -766,7 +767,7 @@ tests/display-vga-test$(EXESUF): tests/display-vga-test= .o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o tests/test-hmp$(EXESUF): tests/test-hmp.o -tests/drive_del-test$(EXESUF): tests/drive_del-test.o $(libqos-pc-obj-y) +tests/drive_del-test$(EXESUF): tests/drive_del-test.o $(libqos-virtio-obj-= y) tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-ob= j-y) tests/nvme-test$(EXESUF): tests/nvme-test.o tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o diff --git a/tests/drive_del-test.c b/tests/drive_del-test.c index 2175139abb..c9ac997555 100644 --- a/tests/drive_del-test.c +++ b/tests/drive_del-test.c @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/virtio.h" =20 static void drive_add(void) { @@ -65,14 +66,14 @@ static void test_after_failed_device_add(void) =20 qtest_start("-drive if=3Dnone,id=3Ddrive0"); =20 - /* Make device_add fail. If this leaks the virtio-blk-pci device then= a + /* Make device_add fail. If this leaks the virtio-blk device then a * reference to drive0 will also be held (via qdev properties). */ response =3D qmp("{'execute': 'device_add'," " 'arguments': {" - " 'driver': 'virtio-blk-pci'," + " 'driver': 'virtio-blk-%s'," " 'drive': 'drive0'" - "}}"); + "}}", qvirtio_get_dev_type()); g_assert(response); error =3D qdict_get_qdict(response, "error"); g_assert_cmpstr(qdict_get_try_str(error, "class"), =3D=3D, "GenericErr= or"); @@ -82,7 +83,7 @@ static void test_after_failed_device_add(void) drive_del(); =20 /* Try to re-add the drive. This fails with duplicate IDs if a leaked - * virtio-blk-pci exists that holds a reference to the old drive0. + * virtio-blk device exists that holds a reference to the old drive0. */ drive_add(); =20 @@ -91,10 +92,14 @@ static void test_after_failed_device_add(void) =20 static void test_drive_del_device_del(void) { + char *args; + /* Start with a drive used by a device that unplugs instantaneously */ - qtest_start("-drive if=3Dnone,id=3Ddrive0,file=3Dnull-co://,format=3Dr= aw" - " -device virtio-scsi-pci" - " -device scsi-hd,drive=3Ddrive0,id=3Ddev0"); + args =3D g_strdup_printf("-drive if=3Dnone,id=3Ddrive0,file=3Dnull-co:= //,format=3Draw" + " -device virtio-scsi-%s" + " -device scsi-hd,drive=3Ddrive0,id=3Ddev0", + qvirtio_get_dev_type()); + qtest_start(args); =20 /* * Delete the drive, and then the device @@ -104,6 +109,7 @@ static void test_drive_del_device_del(void) device_del(); =20 qtest_end(); + g_free(args); } =20 int main(int argc, char **argv) @@ -114,9 +120,10 @@ int main(int argc, char **argv) =20 qtest_add_func("/drive_del/without-dev", test_drive_without_dev); =20 - /* TODO I guess any arch with PCI would do */ + /* TODO I guess any arch with a hot-pluggable virtio bus would do */ if (!strcmp(arch, "i386") || !strcmp(arch, "x86_64") || - !strcmp(arch, "ppc") || !strcmp(arch, "ppc64")) { + !strcmp(arch, "ppc") || !strcmp(arch, "ppc64") || + !strcmp(arch, "s390x")) { qtest_add_func("/drive_del/after_failed_device_add", test_after_failed_device_add); qtest_add_func("/blockdev/drive_del_device_del", diff --git a/tests/libqos/virtio.c b/tests/libqos/virtio.c index 9880a6964e..0879a621c8 100644 --- a/tests/libqos/virtio.c +++ b/tests/libqos/virtio.c @@ -339,3 +339,20 @@ void qvirtqueue_set_used_event(QVirtQueue *vq, uint16_= t idx) /* vq->avail->used_event */ writew(vq->avail + 4 + (2 * vq->size), idx); } + +/* + * qvirtio_get_dev_type: + * Returns: the preferred virtio bus/device type for the current architect= ure. + */ +const char *qvirtio_get_dev_type(void) +{ + const char *arch =3D qtest_get_arch(); + + if (g_str_equal(arch, "arm") || g_str_equal(arch, "aarch64")) { + return "device"; /* for virtio-mmio */ + } else if (g_str_equal(arch, "s390x")) { + return "ccw"; + } else { + return "pci"; + } +} diff --git a/tests/libqos/virtio.h b/tests/libqos/virtio.h index 8fbcd1869c..0a04740adf 100644 --- a/tests/libqos/virtio.h +++ b/tests/libqos/virtio.h @@ -143,4 +143,7 @@ void qvirtqueue_kick(QVirtioDevice *d, QVirtQueue *vq, = uint32_t free_head); bool qvirtqueue_get_buf(QVirtQueue *vq, uint32_t *desc_idx); =20 void qvirtqueue_set_used_event(QVirtQueue *vq, uint16_t idx); + +const char *qvirtio_get_dev_type(void); + #endif --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150583985375537.51762769056131; Tue, 19 Sep 2017 09:50:53 -0700 (PDT) Received: from localhost ([::1]:44112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLjY-0002x0-SH for importer@patchew.org; Tue, 19 Sep 2017 12:50:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLcv-0005b9-P5 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLcu-0002P0-J4 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40682) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLcu-0002OS-BG for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:00 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 41915C047B9A; Tue, 19 Sep 2017 16:43:59 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B7796061E; Tue, 19 Sep 2017 16:43:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 41915C047B9A Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:02 +0200 Message-Id: <20170919164337.18555-4-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 19 Sep 2017 16:43:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 03/38] s390x/pci: remove idx from msix msg data 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: thuth@redhat.com, Yi Min Zhao , david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yi Min Zhao PCIDevice pointer has been a parameter of kvm_arch_fixup_msi_route(). So we don't need to store zpci idx in msix message data to find out the specific zpci device. Instead, we could use pci device id to find its corresponding zpci device. Signed-off-by: Yi Min Zhao Message-Id: <1504606380-49341-2-git-send-email-zyimin@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- hw/s390x/s390-pci-bus.c | 16 +++++----------- hw/s390x/s390-pci-bus.h | 2 ++ hw/s390x/s390-pci-inst.c | 24 ------------------------ hw/s390x/s390-pci-stub.c | 3 ++- target/s390x/kvm.c | 10 +++++++--- 5 files changed, 16 insertions(+), 39 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 0a31a4ae88..bd8a3e1e1c 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -199,8 +199,8 @@ static S390PCIBusDevice *s390_pci_find_dev_by_uid(S390p= ciState *s, uint16_t uid) return NULL; } =20 -static S390PCIBusDevice *s390_pci_find_dev_by_target(S390pciState *s, - const char *target) +S390PCIBusDevice *s390_pci_find_dev_by_target(S390pciState *s, + const char *target) { S390PCIBusDevice *pbdev; =20 @@ -465,19 +465,13 @@ static void s390_msi_ctrl_write(void *opaque, hwaddr = addr, uint64_t data, unsigned int size) { S390PCIBusDevice *pbdev =3D opaque; - uint32_t idx =3D data >> ZPCI_MSI_VEC_BITS; uint32_t vec =3D data & ZPCI_MSI_VEC_MASK; uint64_t ind_bit; uint32_t sum_bit; - uint32_t e =3D 0; =20 - DPRINTF("write_msix data 0x%" PRIx64 " idx %d vec 0x%x\n", data, idx, = vec); - - if (!pbdev) { - e |=3D (vec << ERR_EVENT_MVN_OFFSET); - s390_pci_generate_error_event(ERR_EVENT_NOMSI, idx, 0, addr, e); - return; - } + assert(pbdev); + DPRINTF("write_msix data 0x%" PRIx64 " idx %d vec 0x%x\n", data, + pbdev->idx, vec); =20 if (pbdev->state !=3D ZPCI_FS_ENABLED) { return; diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h index bd636abc28..560bd82a0f 100644 --- a/hw/s390x/s390-pci-bus.h +++ b/hw/s390x/s390-pci-bus.h @@ -322,6 +322,8 @@ void s390_pci_generate_error_event(uint16_t pec, uint32= _t fh, uint32_t fid, S390PCIBusDevice *s390_pci_find_dev_by_idx(S390pciState *s, uint32_t idx); S390PCIBusDevice *s390_pci_find_dev_by_fh(S390pciState *s, uint32_t fh); S390PCIBusDevice *s390_pci_find_dev_by_fid(S390pciState *s, uint32_t fid); +S390PCIBusDevice *s390_pci_find_dev_by_target(S390pciState *s, + const char *target); S390PCIBusDevice *s390_pci_find_next_avail_dev(S390pciState *s, S390PCIBusDevice *pbdev); =20 diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index eba9ffb5f2..8e088f3dc9 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -413,29 +413,6 @@ int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8= _t r2) return 0; } =20 -static void update_msix_table_msg_data(S390PCIBusDevice *pbdev, uint64_t o= ffset, - uint64_t *data, uint8_t len) -{ - uint32_t val; - uint8_t *msg_data; - - if (offset % PCI_MSIX_ENTRY_SIZE !=3D 8) { - return; - } - - if (len !=3D 4) { - DPRINTF("access msix table msg data but len is %d\n", len); - return; - } - - msg_data =3D (uint8_t *)data - offset % PCI_MSIX_ENTRY_SIZE + - PCI_MSIX_ENTRY_VECTOR_CTRL; - val =3D pci_get_long(msg_data) | - ((pbdev->fh & FH_MASK_INDEX) << ZPCI_MSI_VEC_BITS); - pci_set_long(msg_data, val); - DPRINTF("update msix msg_data to 0x%" PRIx64 "\n", *data); -} - static int trap_msix(S390PCIBusDevice *pbdev, uint64_t offset, uint8_t pci= as) { if (pbdev->msix.available && pbdev->msix.table_bar =3D=3D pcias && @@ -508,7 +485,6 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8= _t r2) if (trap_msix(pbdev, offset, pcias)) { offset =3D offset - pbdev->msix.table_offset; mr =3D &pbdev->pdev->msix_table_mmio; - update_msix_table_msg_data(pbdev, offset, &data, len); } else { mr =3D pbdev->pdev->io_regions[pcias].memory; } diff --git a/hw/s390x/s390-pci-stub.c b/hw/s390x/s390-pci-stub.c index 7a642d376c..ad4c5a7719 100644 --- a/hw/s390x/s390-pci-stub.c +++ b/hw/s390x/s390-pci-stub.c @@ -70,7 +70,8 @@ S390pciState *s390_get_phb(void) return NULL; } =20 -S390PCIBusDevice *s390_pci_find_dev_by_idx(S390pciState *s, uint32_t idx) +S390PCIBusDevice *s390_pci_find_dev_by_target(S390pciState *s, + const char *target) { return NULL; } diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index ad7ce9fc70..1130a391d4 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2423,12 +2423,16 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing= _entry *route, uint64_t address, uint32_t data, PCIDevice *d= ev) { S390PCIBusDevice *pbdev; - uint32_t idx =3D data >> ZPCI_MSI_VEC_BITS; uint32_t vec =3D data & ZPCI_MSI_VEC_MASK; =20 - pbdev =3D s390_pci_find_dev_by_idx(s390_get_phb(), idx); + if (!dev) { + DPRINTF("add_msi_route no pci device\n"); + return -ENODEV; + } + + pbdev =3D s390_pci_find_dev_by_target(s390_get_phb(), DEVICE(dev)->id); if (!pbdev) { - DPRINTF("add_msi_route no dev\n"); + DPRINTF("add_msi_route no zpci device\n"); return -ENODEV; } =20 --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505839566201480.31353949678646; Tue, 19 Sep 2017 09:46:06 -0700 (PDT) Received: from localhost ([::1]:44092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLev-00073L-4S for importer@patchew.org; Tue, 19 Sep 2017 12:46:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLd2-0005gd-Ec for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLcz-0002Ri-Kj for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45820) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLcz-0002RU-Ew for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:05 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FED225C25; Tue, 19 Sep 2017 16:44:04 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 35C625D6A6; Tue, 19 Sep 2017 16:44:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6FED225C25 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:03 +0200 Message-Id: <20170919164337.18555-5-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 19 Sep 2017 16:44:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 04/38] s390x/pci: fixup ind_offset of msix routing entry 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: thuth@redhat.com, Yi Min Zhao , david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yi Min Zhao The guest uses the mpcifc instruction to register the aibvo of a zpci device, which is the starting offset of indicators in the indicator area and thus remains constant. Each msix vector is an offset from the aibvo. When we map a msix route to an adapter route, we should not modify the starting offset, but instead add the vector to the starting offset to get the absolute offset in the specific route. Signed-off-by: Yi Min Zhao Message-Id: <1504606380-49341-3-git-send-email-zyimin@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- target/s390x/kvm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 1130a391d4..375369fd1c 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2436,14 +2436,12 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing= _entry *route, return -ENODEV; } =20 - pbdev->routes.adapter.ind_offset =3D vec; - route->type =3D KVM_IRQ_ROUTING_S390_ADAPTER; route->flags =3D 0; route->u.adapter.summary_addr =3D pbdev->routes.adapter.summary_addr; route->u.adapter.ind_addr =3D pbdev->routes.adapter.ind_addr; route->u.adapter.summary_offset =3D pbdev->routes.adapter.summary_offs= et; - route->u.adapter.ind_offset =3D pbdev->routes.adapter.ind_offset; + route->u.adapter.ind_offset =3D pbdev->routes.adapter.ind_offset + vec; route->u.adapter.adapter_id =3D pbdev->routes.adapter.adapter_id; return 0; } --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505839721218451.3949916846607; Tue, 19 Sep 2017 09:48:41 -0700 (PDT) Received: from localhost ([::1]:44100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLhQ-0000wE-8K for importer@patchew.org; Tue, 19 Sep 2017 12:48:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLd7-0005li-Rn for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLd6-0002Wc-K0 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25506) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLd6-0002Vr-Eg for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:12 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7AED37E44E; Tue, 19 Sep 2017 16:44:11 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5BE7461342; Tue, 19 Sep 2017 16:44:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7AED37E44E Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:04 +0200 Message-Id: <20170919164337.18555-6-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 19 Sep 2017 16:44:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 05/38] s390x/pci: add iommu replay callback 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: thuth@redhat.com, Yi Min Zhao , david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yi Min Zhao Let's introduce iommu replay callback for s390 pci iommu memory region. Currently we don't need any dma mapping replay. So let it return directly. This implementation will avoid meaningless loops calling translation callback. Reviewed-by: Pierre Morel Reviewed-by: Halil Pasic Signed-off-by: Yi Min Zhao Message-Id: <1504606380-49341-4-git-send-email-zyimin@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- hw/s390x/s390-pci-bus.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index bd8a3e1e1c..3b9965fde0 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -397,6 +397,17 @@ static IOMMUTLBEntry s390_translate_iommu(IOMMUMemoryR= egion *mr, hwaddr addr, return ret; } =20 +static void s390_pci_iommu_replay(IOMMUMemoryRegion *iommu, + IOMMUNotifier *notifier) +{ + /* It's impossible to plug a pci device on s390x that already has iommu + * mappings which need to be replayed, that is due to the "one iommu p= er + * zpci device" construct. But when we support migration of vfio-pci + * devices in future, we need to revisit this. + */ + return; +} + static S390PCIIOMMU *s390_pci_get_iommu(S390pciState *s, PCIBus *bus, int devfn) { @@ -1045,6 +1056,7 @@ static void s390_iommu_memory_region_class_init(Objec= tClass *klass, void *data) IOMMUMemoryRegionClass *imrc =3D IOMMU_MEMORY_REGION_CLASS(klass); =20 imrc->translate =3D s390_translate_iommu; + imrc->replay =3D s390_pci_iommu_replay; } =20 static const TypeInfo s390_iommu_memory_region_info =3D { --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505839723785477.8904145690319; Tue, 19 Sep 2017 09:48:43 -0700 (PDT) Received: from localhost ([::1]:44101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLhS-0000yG-PR for importer@patchew.org; Tue, 19 Sep 2017 12:48:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLdC-0005qH-Qg for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdB-0002bB-Rx for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38204) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdB-0002aL-Lu for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:17 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2518883BF; Tue, 19 Sep 2017 16:44:16 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4BC505D980; Tue, 19 Sep 2017 16:44:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B2518883BF Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:05 +0200 Message-Id: <20170919164337.18555-7-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 19 Sep 2017 16:44:16 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 06/38] hw/misc/ivshmem: Fix ivshmem_recv_msg() to also work on big endian systems 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth The "slow" ivshmem-tests currently fail when they are running on a big endian host: $ uname -m ppc64 $ V=3D1 QTEST_QEMU_BINARY=3Dx86_64-softmmu/qemu-system-x86_64 tests/ivshmem= -test -m slow /x86_64/ivshmem/single: OK /x86_64/ivshmem/hotplug: OK /x86_64/ivshmem/memdev: OK /x86_64/ivshmem/pair: OK /x86_64/ivshmem/server-msi: qemu-system-x86_64: -device ivshmem-doorbell,chardev=3Dchr0,vectors=3D2: server sent invalid I= D message Broken pipe The problem is that the server side code in ivshmem_server_send_one_msg() correctly translates all messages IDs into little endian 64-bit values, but the client side code in the ivshmem_recv_msg() function does not swap the byte order back. Fix it by passing the value through le64_to_cpu(). Signed-off-by: Thomas Huth Message-Id: <1504100343-26607-1-git-send-email-thuth@redhat.com> Tested-by: Cornelia Huck Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Cornelia Huck --- hw/misc/ivshmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 47a015f072..b3ef3ec1e3 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -653,7 +653,7 @@ static int64_t ivshmem_recv_msg(IVShmemState *s, int *p= fd, Error **errp) } while (n < sizeof(msg)); =20 *pfd =3D qemu_chr_fe_get_msgfd(&s->server_chr); - return msg; + return le64_to_cpu(msg); } =20 static void ivshmem_recv_setup(IVShmemState *s, Error **errp) --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505839734860917.0091569976655; Tue, 19 Sep 2017 09:48:54 -0700 (PDT) Received: from localhost ([::1]:44102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLhe-00017P-5J for importer@patchew.org; Tue, 19 Sep 2017 12:48:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLdF-0005tb-24 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdE-0002di-66 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43358) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdE-0002cL-1L for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:20 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 11AD581235; Tue, 19 Sep 2017 16:44:19 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C8565D980; Tue, 19 Sep 2017 16:44:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 11AD581235 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:06 +0200 Message-Id: <20170919164337.18555-8-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 19 Sep 2017 16:44:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 07/38] s390x/css: drop data-check in interpretation 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, Halil Pasic , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Halil Pasic The architecture says that channel-data check is indicating that an uncorrected storage (memory) error has been detected in regard to the data residing in main storage (memory) that is currently used for an I/O operation. The described detection is done using the CBC technology. The ccw interpretation code is however generating a channel-data check effectively when the (device specific) ccw_cb returns -EFAULT. In case of virtio-ccw devices this happens when mapping memory fails, or when a NULL pointer is encountered. So this behavior is not architecture conform. Furthermore the best fit for these situations (null pointer, mapping a piece of guest memory fails) from architectural perspective the condition described as the channel subsystem refers to a location that is not available, which when encountered shall result in a channel-program check. To fix this, all we have to do is to get rid of the switch case matching -EFAULT: the default is generating a channel-program check. Signed-off-by: Halil Pasic Message-Id: <20170908152446.14606-2-pasic@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- hw/s390x/css.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 5d3de71c4c..bab78fc79a 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -980,15 +980,6 @@ static void sch_handle_start_func_virtual(SubchDev *sc= h) SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND; s->cpa =3D sch->channel_prog + 8; break; - case -EFAULT: - /* memory problem, generate channel data check */ - s->ctrl &=3D ~SCSW_ACTL_START_PEND; - s->cstat =3D SCSW_CSTAT_DATA_CHECK; - s->ctrl &=3D ~SCSW_CTRL_MASK_STCTL; - s->ctrl |=3D SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY | - SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND; - s->cpa =3D sch->channel_prog + 8; - break; case -EBUSY: /* subchannel busy, generate deferred cc 1 */ s->flags &=3D ~SCSW_FLAGS_MASK_CC; --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840020784250.78976592116805; Tue, 19 Sep 2017 09:53:40 -0700 (PDT) Received: from localhost ([::1]:44121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLmG-0005RU-1k for importer@patchew.org; Tue, 19 Sep 2017 12:53:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLdK-0005wh-1p for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdI-0002ht-NF for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50550) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdI-0002hZ-FC for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:24 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 75C76C0546F0; Tue, 19 Sep 2017 16:44:23 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DED415C542; Tue, 19 Sep 2017 16:44:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 75C76C0546F0 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:07 +0200 Message-Id: <20170919164337.18555-9-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 19 Sep 2017 16:44:23 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 08/38] s390x/css: fix NULL handling for CCW addresses 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, Halil Pasic , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Halil Pasic Back then in the time of df1fe5bb49 ("s390: Virtual channel subsystem support.", 2013-01-24) -EIO used to map to a channel-program check (via the default label of the switch statement). Then 2dc95b4cac ("s390x/3270: 3270 data stream handling", 2016-04-01) came along and that changed dramatically. Let us roll back this undesired side effect, and go back to channel-program check. Signed-off-by: Halil Pasic Fixes: 2dc95b4cac "s390x/3270: 3270 data stream handling" Message-Id: <20170908152446.14606-3-pasic@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- hw/s390x/css.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index bab78fc79a..6d599477b2 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -793,7 +793,7 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_= addr, CCW1 ccw; =20 if (!ccw_addr) { - return -EIO; + return -EINVAL; /* channel-program check */ } /* Check doubleword aligned and 31 or 24 (fmt 0) bit addressable. */ if (ccw_addr & (sch->ccw_fmt_1 ? 0x80000007 : 0xff000007)) { --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15058398973351014.3468829048163; Tue, 19 Sep 2017 09:51:37 -0700 (PDT) Received: from localhost ([::1]:44116 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLkG-0003YQ-I6 for importer@patchew.org; Tue, 19 Sep 2017 12:51:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLdM-0005ya-0G for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdL-0002kV-6K for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34864) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdL-0002jn-02 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:27 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 022A861466; Tue, 19 Sep 2017 16:44:26 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F46B60F89; Tue, 19 Sep 2017 16:44:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 022A861466 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:08 +0200 Message-Id: <20170919164337.18555-10-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 19 Sep 2017 16:44:26 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 09/38] s390x/css: remove unused error handling branch 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, Halil Pasic , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Halil Pasic The case in question actually never happens. Let us get rid of the dead code. Signed-off-by: Halil Pasic Message-Id: <20170908152446.14606-4-pasic@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- hw/s390x/css.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 6d599477b2..75d4f301fb 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -980,13 +980,6 @@ static void sch_handle_start_func_virtual(SubchDev *sc= h) SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND; s->cpa =3D sch->channel_prog + 8; break; - case -EBUSY: - /* subchannel busy, generate deferred cc 1 */ - s->flags &=3D ~SCSW_FLAGS_MASK_CC; - s->flags |=3D (1 << 8); - s->ctrl &=3D ~SCSW_CTRL_MASK_STCTL; - s->ctrl |=3D SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND; - break; case -EINPROGRESS: /* channel program has been suspended */ s->ctrl &=3D ~SCSW_ACTL_START_PEND; --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840180680864.3249370080506; Tue, 19 Sep 2017 09:56:20 -0700 (PDT) Received: from localhost ([::1]:44134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLop-0007p4-Nf for importer@patchew.org; Tue, 19 Sep 2017 12:56:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLdT-00065r-Je for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdQ-0002qN-QE for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17128) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdQ-0002pQ-KB for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:32 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 918AB7F3E0; Tue, 19 Sep 2017 16:44:31 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D782C6062F; Tue, 19 Sep 2017 16:44:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 918AB7F3E0 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:09 +0200 Message-Id: <20170919164337.18555-11-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 19 Sep 2017 16:44:31 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 10/38] s390: set DHCP client architecure id for netboot 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, Viktor Mihajlovski , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Viktor Mihajlovski Setting the client architecture DHCP option to 0x001f (s390 Basic) [1] allows the DHCP server to return a s390-specific bootfile if wanted. DHCP servers not configured for the option (or not yet recognizing the option value) will continue to work as they have done before. [1] https://www.iana.org/assignments/dhcpv6-parameters Signed-off-by: Viktor Mihajlovski Message-Id: <1505126027-1704-1-git-send-email-mihajlov@linux.vnet.ibm.com> Acked-by: Christian Borntraeger Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- pc-bios/s390-ccw/netboot.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak index a9e1374e97..a25d238144 100644 --- a/pc-bios/s390-ccw/netboot.mak +++ b/pc-bios/s390-ccw/netboot.mak @@ -50,7 +50,7 @@ libc.a: $(LIBCOBJS) =20 LIBNETOBJS :=3D args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \ dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o -LIBNETCFLAGS :=3D $(QEMU_CFLAGS) $(LIBC_INC) $(LIBNET_INC) +LIBNETCFLAGS :=3D $(QEMU_CFLAGS) -DDHCPARCH=3D0x1F $(LIBC_INC) $(LIBNET_IN= C) =20 %.o : $(SLOF_DIR)/lib/libnet/%.c $(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR= )$@") --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15058398899341020.0836993982239; Tue, 19 Sep 2017 09:51:29 -0700 (PDT) Received: from localhost ([::1]:44115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLk9-0003Qk-5e for importer@patchew.org; Tue, 19 Sep 2017 12:51:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLdX-00068E-3D for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdW-0002uu-2Y for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47300) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdV-0002u6-QH for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:37 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C852E267C8; Tue, 19 Sep 2017 16:44:36 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D9AD60F89; Tue, 19 Sep 2017 16:44:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C852E267C8 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:10 +0200 Message-Id: <20170919164337.18555-12-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 19 Sep 2017 16:44:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 11/38] exec, dump, i386, ppc, s390x: don't include exec/cpu-all.h explicitly 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand All but a handful of files include exec/cpu-all.h via cpu.h only. As these files already include cpu.h, let's just drop the additional include. Reviewed-by: Thomas Huth Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-2-david@redhat.com> Signed-off-by: Cornelia Huck --- dump.c | 1 - exec.c | 1 - target/i386/arch_dump.c | 1 - target/i386/arch_memory_mapping.c | 1 - target/i386/svm_helper.c | 1 - target/ppc/arch_dump.c | 1 - target/s390x/arch_dump.c | 1 - 7 files changed, 7 deletions(-) diff --git a/dump.c b/dump.c index d2093e141b..7ebcf553b2 100644 --- a/dump.c +++ b/dump.c @@ -15,7 +15,6 @@ #include "qemu/cutils.h" #include "elf.h" #include "cpu.h" -#include "exec/cpu-all.h" #include "exec/hwaddr.h" #include "monitor/monitor.h" #include "sysemu/kvm.h" diff --git a/exec.c b/exec.c index d20c34ca83..a25a4c6018 100644 --- a/exec.c +++ b/exec.c @@ -56,7 +56,6 @@ #endif =20 #endif -#include "exec/cpu-all.h" #include "qemu/rcu_queue.h" #include "qemu/main-loop.h" #include "translate-all.h" diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c index e682904052..35b55fc200 100644 --- a/target/i386/arch_dump.c +++ b/target/i386/arch_dump.c @@ -13,7 +13,6 @@ =20 #include "qemu/osdep.h" #include "cpu.h" -#include "exec/cpu-all.h" #include "sysemu/dump.h" #include "elf.h" #include "sysemu/memory_mapping.h" diff --git a/target/i386/arch_memory_mapping.c b/target/i386/arch_memory_ma= pping.c index 647cff2829..271cb5e41b 100644 --- a/target/i386/arch_memory_mapping.c +++ b/target/i386/arch_memory_mapping.c @@ -13,7 +13,6 @@ =20 #include "qemu/osdep.h" #include "cpu.h" -#include "exec/cpu-all.h" #include "sysemu/memory_mapping.h" =20 /* PAE Paging or IA-32e Paging */ diff --git a/target/i386/svm_helper.c b/target/i386/svm_helper.c index 59e8b5091c..f479239875 100644 --- a/target/i386/svm_helper.c +++ b/target/i386/svm_helper.c @@ -19,7 +19,6 @@ =20 #include "qemu/osdep.h" #include "cpu.h" -#include "exec/cpu-all.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" diff --git a/target/ppc/arch_dump.c b/target/ppc/arch_dump.c index 95b9ab6f29..351a65b22f 100644 --- a/target/ppc/arch_dump.c +++ b/target/ppc/arch_dump.c @@ -15,7 +15,6 @@ #include "qemu/osdep.h" #include "cpu.h" #include "elf.h" -#include "exec/cpu-all.h" #include "sysemu/dump.h" #include "sysemu/kvm.h" =20 diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c index 9b0bf92698..6f61ff95af 100644 --- a/target/s390x/arch_dump.c +++ b/target/s390x/arch_dump.c @@ -15,7 +15,6 @@ #include "cpu.h" #include "internal.h" #include "elf.h" -#include "exec/cpu-all.h" #include "sysemu/dump.h" =20 =20 --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840337024647.2042518875742; Tue, 19 Sep 2017 09:58:57 -0700 (PDT) Received: from localhost ([::1]:44142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLrM-0001qY-7v for importer@patchew.org; Tue, 19 Sep 2017 12:58:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLdZ-00069x-4t for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdY-0002wo-BH for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44324) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdY-0002w5-6J for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:40 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 28FCF81DF1; Tue, 19 Sep 2017 16:44:39 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B25C95C542; Tue, 19 Sep 2017 16:44:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 28FCF81DF1 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:11 +0200 Message-Id: <20170919164337.18555-13-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 19 Sep 2017 16:44:39 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 12/38] cpu: drop old comments describing members 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand These comments are obviously stale. Acked-by: Cornelia Huck Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-3-david@redhat.com> Signed-off-by: Cornelia Huck --- include/qom/cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 995a7beeb5..0dc767a753 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -388,10 +388,10 @@ struct CPUState { DECLARE_BITMAP(trace_dstate, CPU_TRACE_DSTATE_MAX_EVENTS); =20 /* TODO Move common fields from CPUArchState here. */ - int cpu_index; /* used by alpha TCG */ - uint32_t halted; /* used by alpha, cris, ppc TCG */ + int cpu_index; + uint32_t halted; uint32_t can_do_io; - int32_t exception_index; /* used by m68k TCG */ + int32_t exception_index; =20 /* shared by kvm, hax and hvf */ bool vcpu_dirty; --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840060766483.78886852554035; Tue, 19 Sep 2017 09:54:20 -0700 (PDT) Received: from localhost ([::1]:44123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLmt-00060U-Qm for importer@patchew.org; Tue, 19 Sep 2017 12:54:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLdg-0006Ge-5G for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdd-00030t-V0 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44462) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdd-000306-MC for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:45 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADD6681DF1; Tue, 19 Sep 2017 16:44:44 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 273275D6A8; Tue, 19 Sep 2017 16:44:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ADD6681DF1 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:12 +0200 Message-Id: <20170919164337.18555-14-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 19 Sep 2017 16:44:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 13/38] s390x: get rid of s390-virtio.c 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand It is a leftover from the days where we had still the !ccw virtio machine. As this one is long gone, let's move everything to s390-virtio-ccw.c. Suggested-by: Cornelia Huck Reviewed-by: Thomas Huth Acked-by: Christian Borntraeger Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-4-david@redhat.com> Signed-off-by: Cornelia Huck --- hw/s390x/Makefile.objs | 1 - hw/s390x/s390-virtio-ccw.c | 159 ++++++++++++++++++++++++++++++++++- hw/s390x/s390-virtio.c | 203 -----------------------------------------= ---- hw/s390x/s390-virtio.h | 15 ---- 4 files changed, 158 insertions(+), 220 deletions(-) delete mode 100644 hw/s390x/s390-virtio.c diff --git a/hw/s390x/Makefile.objs b/hw/s390x/Makefile.objs index 7ee19d3abc..dc704b57d6 100644 --- a/hw/s390x/Makefile.objs +++ b/hw/s390x/Makefile.objs @@ -1,4 +1,3 @@ -obj-y +=3D s390-virtio.o obj-y +=3D s390-virtio-hcall.o obj-y +=3D sclp.o obj-y +=3D event-facility.o diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index dd504dd5ae..57a5139a65 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -2,6 +2,7 @@ * virtio ccw machine * * Copyright 2012 IBM Corp. + * Copyright (c) 2009 Alexander Graf * Author(s): Cornelia Huck * * This work is licensed under the terms of the GNU GPL, version 2 or (at @@ -31,6 +32,46 @@ #include "hw/s390x/css-bridge.h" #include "migration/register.h" #include "cpu_models.h" +#include "qapi/qmp/qerror.h" +#include "hw/nmi.h" + +static S390CPU **cpu_states; + +S390CPU *s390_cpu_addr2state(uint16_t cpu_addr) +{ + if (cpu_addr >=3D max_cpus) { + return NULL; + } + + /* Fast lookup via CPU ID */ + return cpu_states[cpu_addr]; +} + +static void s390_init_cpus(MachineState *machine) +{ + int i; + gchar *name; + + if (machine->cpu_model =3D=3D NULL) { + machine->cpu_model =3D s390_default_cpu_model_name(); + } + + cpu_states =3D g_new0(S390CPU *, max_cpus); + + for (i =3D 0; i < max_cpus; i++) { + name =3D g_strdup_printf("cpu[%i]", i); + object_property_add_link(OBJECT(machine), name, TYPE_S390_CPU, + (Object **) &cpu_states[i], + object_property_allow_set_link, + OBJ_PROP_LINK_UNREF_ON_RELEASE, + &error_abort); + g_free(name); + } + + for (i =3D 0; i < smp_cpus; i++) { + s390x_new_cpu(machine->cpu_model, i, &error_fatal); + } +} =20 static const char *const reset_dev_types[] =3D { TYPE_VIRTUAL_CSS_BRIDGE, @@ -94,7 +135,7 @@ static void virtio_ccw_register_hcalls(void) virtio_ccw_hcall_early_printk); } =20 -void s390_memory_init(ram_addr_t mem_size) +static void s390_memory_init(ram_addr_t mem_size) { MemoryRegion *sysmem =3D get_system_memory(); MemoryRegion *ram =3D g_new(MemoryRegion, 1); @@ -109,11 +150,105 @@ void s390_memory_init(ram_addr_t mem_size) s390_stattrib_init(); } =20 +#define S390_TOD_CLOCK_VALUE_MISSING 0x00 +#define S390_TOD_CLOCK_VALUE_PRESENT 0x01 + +static void gtod_save(QEMUFile *f, void *opaque) +{ + uint64_t tod_low; + uint8_t tod_high; + int r; + + r =3D s390_get_clock(&tod_high, &tod_low); + if (r) { + warn_report("Unable to get guest clock for migration: %s", + strerror(-r)); + error_printf("Guest clock will not be migrated " + "which could cause the guest to hang."); + qemu_put_byte(f, S390_TOD_CLOCK_VALUE_MISSING); + return; + } + + qemu_put_byte(f, S390_TOD_CLOCK_VALUE_PRESENT); + qemu_put_byte(f, tod_high); + qemu_put_be64(f, tod_low); +} + +static int gtod_load(QEMUFile *f, void *opaque, int version_id) +{ + uint64_t tod_low; + uint8_t tod_high; + int r; + + if (qemu_get_byte(f) =3D=3D S390_TOD_CLOCK_VALUE_MISSING) { + warn_report("Guest clock was not migrated. This could " + "cause the guest to hang."); + return 0; + } + + tod_high =3D qemu_get_byte(f); + tod_low =3D qemu_get_be64(f); + + r =3D s390_set_clock(&tod_high, &tod_low); + if (r) { + warn_report("Unable to set guest clock for migration: %s", + strerror(-r)); + error_printf("Guest clock will not be restored " + "which could cause the guest to hang."); + } + + return 0; +} + static SaveVMHandlers savevm_gtod =3D { .save_state =3D gtod_save, .load_state =3D gtod_load, }; =20 +static void s390_init_ipl_dev(const char *kernel_filename, + const char *kernel_cmdline, + const char *initrd_filename, const char *fir= mware, + const char *netboot_fw, bool enforce_bios) +{ + Object *new =3D object_new(TYPE_S390_IPL); + DeviceState *dev =3D DEVICE(new); + + if (kernel_filename) { + qdev_prop_set_string(dev, "kernel", kernel_filename); + } + if (initrd_filename) { + qdev_prop_set_string(dev, "initrd", initrd_filename); + } + qdev_prop_set_string(dev, "cmdline", kernel_cmdline); + qdev_prop_set_string(dev, "firmware", firmware); + qdev_prop_set_string(dev, "netboot_fw", netboot_fw); + qdev_prop_set_bit(dev, "enforce_bios", enforce_bios); + object_property_add_child(qdev_get_machine(), TYPE_S390_IPL, + new, NULL); + object_unref(new); + qdev_init_nofail(dev); +} + +static void s390_create_virtio_net(BusState *bus, const char *name) +{ + int i; + + for (i =3D 0; i < nb_nics; i++) { + NICInfo *nd =3D &nd_table[i]; + DeviceState *dev; + + if (!nd->model) { + nd->model =3D g_strdup("virtio"); + } + + qemu_check_nic_model(nd, "virtio"); + + dev =3D qdev_create(bus, name); + qdev_set_nic_properties(dev, nd); + qdev_init_nofail(dev); + } +} + static void ccw_init(MachineState *machine) { int ret; @@ -177,6 +312,19 @@ static void s390_cpu_plug(HotplugHandler *hotplug_dev, g_free(name); } =20 +static void s390_machine_reset(void) +{ + S390CPU *ipl_cpu =3D S390_CPU(qemu_get_cpu(0)); + + s390_cmma_reset(); + qemu_devices_reset(); + s390_crypto_reset(); + + /* all cpus are stopped - configure and start the ipl cpu only */ + s390_ipl_prepare_cpu(ipl_cpu); + s390_cpu_set_state(CPU_STATE_OPERATING, ipl_cpu); +} + static void s390_machine_device_plug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { @@ -201,6 +349,15 @@ static void s390_hot_add_cpu(const int64_t id, Error *= *errp) s390x_new_cpu(machine->cpu_model, id, errp); } =20 +static void s390_nmi(NMIState *n, int cpu_index, Error **errp) +{ + CPUState *cs =3D qemu_get_cpu(cpu_index); + + if (s390_cpu_restart(S390_CPU(cs))) { + error_setg(errp, QERR_UNSUPPORTED); + } +} + static void ccw_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c deleted file mode 100644 index 0e91c465f2..0000000000 --- a/hw/s390x/s390-virtio.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - * QEMU S390 virtio target - * - * Copyright (c) 2009 Alexander Graf - * Copyright IBM Corp 2012 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * Contributions after 2012-10-29 are licensed under the terms of the - * GNU GPL, version 2 or (at your option) any later version. - * - * You should have received a copy of the GNU (Lesser) General Public - * License along with this library; if not, see . - */ - -#include "qemu/osdep.h" -#include "qapi/error.h" -#include "hw/hw.h" -#include "qapi/qmp/qerror.h" -#include "qemu/error-report.h" -#include "sysemu/block-backend.h" -#include "sysemu/blockdev.h" -#include "sysemu/sysemu.h" -#include "net/net.h" -#include "hw/boards.h" -#include "hw/loader.h" -#include "hw/virtio/virtio.h" -#include "exec/address-spaces.h" -#include "sysemu/qtest.h" - -#include "hw/s390x/sclp.h" -#include "hw/s390x/s390_flic.h" -#include "hw/s390x/s390-virtio.h" -#include "hw/s390x/storage-keys.h" -#include "hw/s390x/ipl.h" -#include "cpu.h" - -#define MAX_BLK_DEVS 10 - -#define S390_TOD_CLOCK_VALUE_MISSING 0x00 -#define S390_TOD_CLOCK_VALUE_PRESENT 0x01 - -static S390CPU **cpu_states; - -S390CPU *s390_cpu_addr2state(uint16_t cpu_addr) -{ - if (cpu_addr >=3D max_cpus) { - return NULL; - } - - /* Fast lookup via CPU ID */ - return cpu_states[cpu_addr]; -} - -void s390_init_ipl_dev(const char *kernel_filename, - const char *kernel_cmdline, - const char *initrd_filename, - const char *firmware, - const char *netboot_fw, - bool enforce_bios) -{ - Object *new =3D object_new(TYPE_S390_IPL); - DeviceState *dev =3D DEVICE(new); - - if (kernel_filename) { - qdev_prop_set_string(dev, "kernel", kernel_filename); - } - if (initrd_filename) { - qdev_prop_set_string(dev, "initrd", initrd_filename); - } - qdev_prop_set_string(dev, "cmdline", kernel_cmdline); - qdev_prop_set_string(dev, "firmware", firmware); - qdev_prop_set_string(dev, "netboot_fw", netboot_fw); - qdev_prop_set_bit(dev, "enforce_bios", enforce_bios); - object_property_add_child(qdev_get_machine(), TYPE_S390_IPL, - new, NULL); - object_unref(new); - qdev_init_nofail(dev); -} - -void s390_init_cpus(MachineState *machine) -{ - int i; - gchar *name; - - if (machine->cpu_model =3D=3D NULL) { - machine->cpu_model =3D s390_default_cpu_model_name(); - } - - cpu_states =3D g_new0(S390CPU *, max_cpus); - - for (i =3D 0; i < max_cpus; i++) { - name =3D g_strdup_printf("cpu[%i]", i); - object_property_add_link(OBJECT(machine), name, TYPE_S390_CPU, - (Object **) &cpu_states[i], - object_property_allow_set_link, - OBJ_PROP_LINK_UNREF_ON_RELEASE, - &error_abort); - g_free(name); - } - - for (i =3D 0; i < smp_cpus; i++) { - s390x_new_cpu(machine->cpu_model, i, &error_fatal); - } -} - - -void s390_create_virtio_net(BusState *bus, const char *name) -{ - int i; - - for (i =3D 0; i < nb_nics; i++) { - NICInfo *nd =3D &nd_table[i]; - DeviceState *dev; - - if (!nd->model) { - nd->model =3D g_strdup("virtio"); - } - - qemu_check_nic_model(nd, "virtio"); - - dev =3D qdev_create(bus, name); - qdev_set_nic_properties(dev, nd); - qdev_init_nofail(dev); - } -} - -void gtod_save(QEMUFile *f, void *opaque) -{ - uint64_t tod_low; - uint8_t tod_high; - int r; - - r =3D s390_get_clock(&tod_high, &tod_low); - if (r) { - warn_report("Unable to get guest clock for migration: %s", - strerror(-r)); - error_printf("Guest clock will not be migrated " - "which could cause the guest to hang."); - qemu_put_byte(f, S390_TOD_CLOCK_VALUE_MISSING); - return; - } - - qemu_put_byte(f, S390_TOD_CLOCK_VALUE_PRESENT); - qemu_put_byte(f, tod_high); - qemu_put_be64(f, tod_low); -} - -int gtod_load(QEMUFile *f, void *opaque, int version_id) -{ - uint64_t tod_low; - uint8_t tod_high; - int r; - - if (qemu_get_byte(f) =3D=3D S390_TOD_CLOCK_VALUE_MISSING) { - warn_report("Guest clock was not migrated. This could " - "cause the guest to hang."); - return 0; - } - - tod_high =3D qemu_get_byte(f); - tod_low =3D qemu_get_be64(f); - - r =3D s390_set_clock(&tod_high, &tod_low); - if (r) { - warn_report("Unable to set guest clock for migration: %s", - strerror(-r)); - error_printf("Guest clock will not be restored " - "which could cause the guest to hang."); - } - - return 0; -} - -void s390_nmi(NMIState *n, int cpu_index, Error **errp) -{ - CPUState *cs =3D qemu_get_cpu(cpu_index); - - if (s390_cpu_restart(S390_CPU(cs))) { - error_setg(errp, QERR_UNSUPPORTED); - } -} - -void s390_machine_reset(void) -{ - S390CPU *ipl_cpu =3D S390_CPU(qemu_get_cpu(0)); - - s390_cmma_reset(); - qemu_devices_reset(); - s390_crypto_reset(); - - /* all cpus are stopped - configure and start the ipl cpu only */ - s390_ipl_prepare_cpu(ipl_cpu); - s390_cpu_set_state(CPU_STATE_OPERATING, ipl_cpu); -} diff --git a/hw/s390x/s390-virtio.h b/hw/s390x/s390-virtio.h index ca97fd6814..d984cd4115 100644 --- a/hw/s390x/s390-virtio.h +++ b/hw/s390x/s390-virtio.h @@ -12,24 +12,9 @@ #ifndef HW_S390_VIRTIO_H #define HW_S390_VIRTIO_H =20 -#include "hw/nmi.h" #include "standard-headers/asm-s390/kvm_virtio.h" #include "standard-headers/asm-s390/virtio-ccw.h" =20 typedef int (*s390_virtio_fn)(const uint64_t *args); void s390_register_virtio_hypercall(uint64_t code, s390_virtio_fn fn); - -void s390_init_cpus(MachineState *machine); -void s390_init_ipl_dev(const char *kernel_filename, - const char *kernel_cmdline, - const char *initrd_filename, - const char *firmware, - const char *netboot_fw, - bool enforce_bios); -void s390_create_virtio_net(BusState *bus, const char *name); -void s390_nmi(NMIState *n, int cpu_index, Error **errp); -void s390_machine_reset(void); -void s390_memory_init(ram_addr_t mem_size); -void gtod_save(QEMUFile *f, void *opaque); -int gtod_load(QEMUFile *f, void *opaque, int version_id); #endif --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505839888350113.9191337332777; Tue, 19 Sep 2017 09:51:28 -0700 (PDT) Received: from localhost ([::1]:44114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLk6-0003P1-JL for importer@patchew.org; Tue, 19 Sep 2017 12:51:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLdn-0006N7-Og for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdk-00036k-VD for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8722) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdk-00035g-PU for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:52 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C03A5267C0; Tue, 19 Sep 2017 16:44:51 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 961E65C882; Tue, 19 Sep 2017 16:44:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C03A5267C0 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:13 +0200 Message-Id: <20170919164337.18555-15-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 19 Sep 2017 16:44:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 14/38] s390x: rename s390-virtio.h to s390-virtio-hcall.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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand The only interface left, so let's properly rename it. Reviewed-by: Thomas Huth Acked-by: Christian Borntraeger Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-5-david@redhat.com> Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 2 +- hw/s390x/s390-virtio-hcall.c | 2 +- hw/s390x/{s390-virtio.h =3D> s390-virtio-hcall.h} | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) rename hw/s390x/{s390-virtio.h =3D> s390-virtio-hcall.h} (77%) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 57a5139a65..c908f63543 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -16,7 +16,7 @@ #include "cpu.h" #include "hw/boards.h" #include "exec/address-spaces.h" -#include "s390-virtio.h" +#include "hw/s390x/s390-virtio-hcall.h" #include "hw/s390x/sclp.h" #include "hw/s390x/s390_flic.h" #include "hw/s390x/ioinst.h" diff --git a/hw/s390x/s390-virtio-hcall.c b/hw/s390x/s390-virtio-hcall.c index 23d67d6170..ec7cf8beb3 100644 --- a/hw/s390x/s390-virtio-hcall.c +++ b/hw/s390x/s390-virtio-hcall.c @@ -11,7 +11,7 @@ =20 #include "qemu/osdep.h" #include "cpu.h" -#include "hw/s390x/s390-virtio.h" +#include "hw/s390x/s390-virtio-hcall.h" =20 #define MAX_DIAG_SUBCODES 255 =20 diff --git a/hw/s390x/s390-virtio.h b/hw/s390x/s390-virtio-hcall.h similarity index 77% rename from hw/s390x/s390-virtio.h rename to hw/s390x/s390-virtio-hcall.h index d984cd4115..59fcba3a06 100644 --- a/hw/s390x/s390-virtio.h +++ b/hw/s390x/s390-virtio-hcall.h @@ -1,5 +1,5 @@ /* - * Virtio interfaces for s390 + * Support for virtio hypercalls on s390x * * Copyright 2012 IBM Corp. * Author(s): Cornelia Huck @@ -9,12 +9,12 @@ * directory. */ =20 -#ifndef HW_S390_VIRTIO_H -#define HW_S390_VIRTIO_H +#ifndef HW_S390_VIRTIO_HCALL_H +#define HW_S390_VIRTIO_HCALL_H =20 #include "standard-headers/asm-s390/kvm_virtio.h" #include "standard-headers/asm-s390/virtio-ccw.h" =20 typedef int (*s390_virtio_fn)(const uint64_t *args); void s390_register_virtio_hypercall(uint64_t code, s390_virtio_fn fn); -#endif +#endif /* HW_S390_VIRTIO_HCALL_H */ --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840066811185.22306000682704; Tue, 19 Sep 2017 09:54:26 -0700 (PDT) Received: from localhost ([::1]:44124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLn0-000678-2i for importer@patchew.org; Tue, 19 Sep 2017 12:54:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLdo-0006OD-Tv for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdo-00038l-0j for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51728) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdn-000388-RB for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:55 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D96AAC0546D5; Tue, 19 Sep 2017 16:44:54 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E17DF5D6A6; Tue, 19 Sep 2017 16:44:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D96AAC0546D5 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:14 +0200 Message-Id: <20170919164337.18555-16-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 19 Sep 2017 16:44:55 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 15/38] s390x: move s390_virtio_hypercall() to s390-virtio-hcall.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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Implemented in hw/s390x/s390-virtio-hcall.c, so let's move it to the right header file. Reviewed-by: Thomas Huth Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-6-david@redhat.com> Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-hcall.h | 1 + target/s390x/cpu.h | 1 - target/s390x/kvm.c | 1 + target/s390x/misc_helper.c | 1 + 4 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-hcall.h b/hw/s390x/s390-virtio-hcall.h index 59fcba3a06..cbc270eef3 100644 --- a/hw/s390x/s390-virtio-hcall.h +++ b/hw/s390x/s390-virtio-hcall.h @@ -17,4 +17,5 @@ =20 typedef int (*s390_virtio_fn)(const uint64_t *args); void s390_register_virtio_hypercall(uint64_t code, s390_virtio_fn fn); +int s390_virtio_hypercall(CPUS390XState *env); #endif /* HW_S390_VIRTIO_HCALL_H */ diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 0bd97a5670..7073fa59e9 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -723,6 +723,5 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uin= t8_t ar, void *hostbuf, S390CPU *s390_cpu_addr2state(uint16_t cpu_addr); extern void subsystem_reset(void); int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code); -int s390_virtio_hypercall(CPUS390XState *env); =20 #endif diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 375369fd1c..720cb1d833 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -48,6 +48,7 @@ #include "hw/s390x/ebcdic.h" #include "exec/memattrs.h" #include "hw/s390x/s390-virtio-ccw.h" +#include "hw/s390x/s390-virtio-hcall.h" =20 #ifndef DEBUG_KVM #define DEBUG_KVM 0 diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index 50cc046ca2..b142db71c6 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -34,6 +34,7 @@ #include "sysemu/cpus.h" #include "sysemu/sysemu.h" #include "hw/s390x/ebcdic.h" +#include "hw/s390x/s390-virtio-hcall.h" #endif =20 /* #define DEBUG_HELPER */ --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840284764843.3738021755995; Tue, 19 Sep 2017 09:58:04 -0700 (PDT) Received: from localhost ([::1]:44140 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLqV-000146-P5 for importer@patchew.org; Tue, 19 Sep 2017 12:58:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLdr-0006Pr-KK for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdq-0003BP-PS for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51568) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdq-0003Ae-JV for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:44:58 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A5D880F7A; Tue, 19 Sep 2017 16:44:57 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8D605C542; Tue, 19 Sep 2017 16:44:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9A5D880F7A Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:15 +0200 Message-Id: <20170919164337.18555-17-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 19 Sep 2017 16:44:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 16/38] s390x: move subsystem_reset() to s390-virtio-ccw.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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Implemented in s390-virtio-ccw.c, so move it to the right header. We can also drop the extern. Fix up one include. Reviewed-by: Thomas Huth Acked-by: Christian Borntraeger Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-7-david@redhat.com> Signed-off-by: Cornelia Huck --- include/hw/s390x/s390-virtio-ccw.h | 2 ++ target/s390x/cpu.h | 1 - target/s390x/diag.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index 41a9d2862b..a9a90c2022 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -56,4 +56,6 @@ bool gs_allowed(void); */ bool css_migration_enabled(void); =20 +void subsystem_reset(void); + #endif diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 7073fa59e9..372f7d8885 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -721,7 +721,6 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uin= t8_t ar, void *hostbuf, =20 /* outside of target/s390x/ */ S390CPU *s390_cpu_addr2state(uint16_t cpu_addr); -extern void subsystem_reset(void); int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code); =20 #endif diff --git a/target/s390x/diag.c b/target/s390x/diag.c index e6b5e6de37..82a623948d 100644 --- a/target/s390x/diag.c +++ b/target/s390x/diag.c @@ -20,6 +20,7 @@ #include "hw/watchdog/wdt_diag288.h" #include "sysemu/cpus.h" #include "hw/s390x/ipl.h" +#include "hw/s390x/s390-virtio-ccw.h" =20 static int modified_clear_reset(S390CPU *cpu) { --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840495438176.31844295332542; Tue, 19 Sep 2017 10:01:35 -0700 (PDT) Received: from localhost ([::1]:44159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLtu-0004Ac-Ew for importer@patchew.org; Tue, 19 Sep 2017 13:01:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLe0-0006YZ-5u for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdx-0003Gh-CZ for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40312) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdx-0003Fw-54 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:05 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 105B4883C1; Tue, 19 Sep 2017 16:45:04 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D33161342; Tue, 19 Sep 2017 16:44:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 105B4883C1 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:16 +0200 Message-Id: <20170919164337.18555-18-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 19 Sep 2017 16:45:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 17/38] target/s390x: move some s390x typedefs to cpu-qom.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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand This allows us to drop inclusion of cpu_models.h in cpu-qom.h, and prepares for using cpu-qom.h as a s390 specific version of typedefs.h Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-8-david@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- target/s390x/cpu-qom.h | 5 ++++- target/s390x/cpu.h | 5 +++-- target/s390x/cpu_models.h | 8 ++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/target/s390x/cpu-qom.h b/target/s390x/cpu-qom.h index 4e936e7788..2435cd8390 100644 --- a/target/s390x/cpu-qom.h +++ b/target/s390x/cpu-qom.h @@ -21,7 +21,6 @@ #define QEMU_S390_CPU_QOM_H =20 #include "qom/cpu.h" -#include "cpu_models.h" =20 #define TYPE_S390_CPU "s390-cpu" =20 @@ -32,6 +31,9 @@ #define S390_CPU_GET_CLASS(obj) \ OBJECT_GET_CLASS(S390CPUClass, (obj), TYPE_S390_CPU) =20 +typedef struct S390CPUModel S390CPUModel; +typedef struct S390CPUDef S390CPUDef; + /** * S390CPUClass: * @parent_realize: The parent class' realize handler. @@ -62,5 +64,6 @@ typedef struct S390CPUClass { } S390CPUClass; =20 typedef struct S390CPU S390CPU; +typedef struct CPUS390XState CPUS390XState; =20 #endif diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 372f7d8885..4a0a59dfbc 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -25,6 +25,7 @@ =20 #include "qemu-common.h" #include "cpu-qom.h" +#include "cpu_models.h" =20 #define TARGET_LONG_BITS 64 =20 @@ -80,7 +81,7 @@ typedef struct MchkQueue { uint16_t type; } MchkQueue; =20 -typedef struct CPUS390XState { +struct CPUS390XState { uint64_t regs[16]; /* GP registers */ /* * The floating point registers are part of the vector registers. @@ -174,7 +175,7 @@ typedef struct CPUS390XState { /* currently processed sigp order */ uint8_t sigp_order; =20 -} CPUS390XState; +}; =20 static inline CPU_DoubleU *get_freg(CPUS390XState *cs, int nr) { diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h index c0bee15d7a..4c6dee1871 100644 --- a/target/s390x/cpu_models.h +++ b/target/s390x/cpu_models.h @@ -17,7 +17,7 @@ #include "qom/cpu.h" =20 /* static CPU definition */ -typedef struct S390CPUDef { +struct S390CPUDef { const char *name; /* name exposed to the user */ const char *desc; /* description exposed to the user */ uint8_t gen; /* hw generation identification */ @@ -37,10 +37,10 @@ typedef struct S390CPUDef { S390FeatBitmap full_feat; /* used to init full_feat from generated data */ S390FeatInit full_init; -} S390CPUDef; +}; =20 /* CPU model based on a CPU definition */ -typedef struct S390CPUModel { +struct S390CPUModel { const S390CPUDef *def; S390FeatBitmap features; /* values copied from the "host" model, can change during migration */ @@ -48,7 +48,7 @@ typedef struct S390CPUModel { uint32_t cpu_id; /* CPU id */ uint8_t cpu_id_format; /* CPU id format bit */ uint8_t cpu_ver; /* CPU version, usually "ff" for kvm */ -} S390CPUModel; +}; =20 /* * CPU ID --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15058404370821005.124548265554; Tue, 19 Sep 2017 10:00:37 -0700 (PDT) Received: from localhost ([::1]:44155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLsy-0003JM-90 for importer@patchew.org; Tue, 19 Sep 2017 13:00:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLe0-0006Yw-J0 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLdz-0003I1-Ix for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36568) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLdz-0003HI-Ck for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:07 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6327225B9A; Tue, 19 Sep 2017 16:45:06 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF83C60590; Tue, 19 Sep 2017 16:45:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6327225B9A Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:17 +0200 Message-Id: <20170919164337.18555-19-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 19 Sep 2017 16:45:06 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 18/38] s390x: move sclp_service_call() to sclp.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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Implemented in sclp.c, so let's move it to the right include file. Also adjust some includes. Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-9-david@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- include/hw/s390x/sclp.h | 2 ++ target/s390x/cpu.h | 1 - target/s390x/misc_helper.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h index a72d096081..847ff32f85 100644 --- a/include/hw/s390x/sclp.h +++ b/include/hw/s390x/sclp.h @@ -16,6 +16,7 @@ =20 #include "hw/sysbus.h" #include "hw/qdev.h" +#include "target/s390x/cpu-qom.h" =20 #define SCLP_CMD_CODE_MASK 0xffff00ff =20 @@ -242,5 +243,6 @@ sclpMemoryHotplugDev *init_sclp_memory_hotplug_dev(void= ); sclpMemoryHotplugDev *get_sclp_memory_hotplug_dev(void); void sclp_service_interrupt(uint32_t sccb); void raise_irq_cpu_hotplug(void); +int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code); =20 #endif diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 4a0a59dfbc..5295bd3c66 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -722,6 +722,5 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uin= t8_t ar, void *hostbuf, =20 /* outside of target/s390x/ */ S390CPU *s390_cpu_addr2state(uint16_t cpu_addr); -int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code); =20 #endif diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index b142db71c6..8b07535b02 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -35,6 +35,7 @@ #include "sysemu/sysemu.h" #include "hw/s390x/ebcdic.h" #include "hw/s390x/s390-virtio-hcall.h" +#include "hw/s390x/sclp.h" #endif =20 /* #define DEBUG_HELPER */ --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840227692788.2498325053838; Tue, 19 Sep 2017 09:57:07 -0700 (PDT) Received: from localhost ([::1]:44137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLpa-0008SU-U0 for importer@patchew.org; Tue, 19 Sep 2017 12:57:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLeA-0006ld-De for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLe7-0003RD-Dm for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36890) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLe7-0003QR-82 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:15 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 325A025B9D; Tue, 19 Sep 2017 16:45:14 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79A7060E3B; Tue, 19 Sep 2017 16:45:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 325A025B9D Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:18 +0200 Message-Id: <20170919164337.18555-20-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 19 Sep 2017 16:45:14 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 19/38] target/s390x: use trigger_pgm_exception() in s390_cpu_handle_mmu_fault() 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand This looks cleaner. linux-user will not use the ilen field, so setting it doesn't do any harm. Reviewed-by: Thomas Huth Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-10-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/excp_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index 361f970db3..14d3160e92 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -59,8 +59,7 @@ int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr address, { S390CPU *cpu =3D S390_CPU(cs); =20 - cs->exception_index =3D EXCP_PGM; - cpu->env.int_pgm_code =3D PGM_ADDRESSING; + trigger_pgm_exception(&cpu->env, PGM_ADDRESSING, ILEN_AUTO); /* On real machines this value is dropped into LowMem. Since this is userland, simply put this someplace that cpu_loop can find it. = */ cpu->env.__excp_addr =3D address; --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840605827827.7189027095703; Tue, 19 Sep 2017 10:03:25 -0700 (PDT) Received: from localhost ([::1]:44166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLvg-0005qe-IZ for importer@patchew.org; Tue, 19 Sep 2017 13:03:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLeA-0006lh-Jx for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLe9-0003T1-PB for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46012) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLe9-0003Sf-KV for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:17 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A1CA80E6A; Tue, 19 Sep 2017 16:45:16 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3416160466; Tue, 19 Sep 2017 16:45:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9A1CA80E6A Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:19 +0200 Message-Id: <20170919164337.18555-21-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 19 Sep 2017 16:45:16 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 20/38] target/s390x: use program_interrupt() in per_check_exception() 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Clean it up by reusing program_interrupt(). Add a concern regarding ilen. Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-11-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/misc_helper.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index 8b07535b02..f3624d75eb 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -447,14 +447,17 @@ void HELPER(chsc)(CPUS390XState *env, uint64_t inst) #ifndef CONFIG_USER_ONLY void HELPER(per_check_exception)(CPUS390XState *env) { - CPUState *cs =3D CPU(s390_env_get_cpu(env)); + uint32_t ilen; =20 if (env->per_perc_atmid) { - env->int_pgm_code =3D PGM_PER; - env->int_pgm_ilen =3D get_ilen(cpu_ldub_code(env, env->per_address= )); - - cs->exception_index =3D EXCP_PGM; - cpu_loop_exit(cs); + /* + * FIXME: ILEN_AUTO is most probably the right thing to use. ilen + * always has to match the instruction referenced in the PSW. E.g. + * if a PER interrupt is triggered via EXECUTE, we have to use ilen + * of EXECUTE, while per_address contains the target of EXECUTE. + */ + ilen =3D get_ilen(cpu_ldub_code(env, env->per_address)); + program_interrupt(env, PGM_PER, ilen); } } =20 --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840667540565.9004004201771; Tue, 19 Sep 2017 10:04:27 -0700 (PDT) Received: from localhost ([::1]:44169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLwg-0006r4-MJ for importer@patchew.org; Tue, 19 Sep 2017 13:04:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLeG-0006sX-BC for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLeF-0003Wl-HI for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40714) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLeF-0003WT-A7 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:23 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 49228D6F19; Tue, 19 Sep 2017 16:45:22 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89B316061E; Tue, 19 Sep 2017 16:45:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 49228D6F19 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:20 +0200 Message-Id: <20170919164337.18555-22-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Sep 2017 16:45:22 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 21/38] s390x: allow only 1 CPU with TCG 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Specifying more than 1 CPU (e.g. -smp 5) leads to SIGP errors (the guest tries to bring these CPUs up but fails), because we don't support multiple CPUs on s390x under TCG. Let's bail out if more than 1 is specified, so we don't raise people's hope. Tested-by: Matthew Rosato Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-12-david@redhat.com> Reviewed-by: Igor Mammedov Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index c908f63543..56f8200851 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -23,6 +23,7 @@ #include "hw/s390x/css.h" #include "virtio-ccw.h" #include "qemu/config-file.h" +#include "qemu/error-report.h" #include "s390-pci-bus.h" #include "hw/s390x/storage-keys.h" #include "hw/s390x/storage-attributes.h" @@ -55,6 +56,11 @@ static void s390_init_cpus(MachineState *machine) if (machine->cpu_model =3D=3D NULL) { machine->cpu_model =3D s390_default_cpu_model_name(); } + if (tcg_enabled() && max_cpus > 1) { + error_report("Number of SMP CPUs requested (%d) exceeds max CPUs " + "supported by TCG (1) on s390x", max_cpus); + exit(1); + } =20 cpu_states =3D g_new0(S390CPU *, max_cpus); =20 --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840198614541.6926621827331; Tue, 19 Sep 2017 09:56:38 -0700 (PDT) Received: from localhost ([::1]:44135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLp6-00082B-Su for importer@patchew.org; Tue, 19 Sep 2017 12:56:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLeL-0006xa-LQ for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLeK-0003c0-Or for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41240) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLeK-0003a1-Jp for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:28 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93A45D6F12; Tue, 19 Sep 2017 16:45:27 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4910260590; Tue, 19 Sep 2017 16:45:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 93A45D6F12 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:21 +0200 Message-Id: <20170919164337.18555-23-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Sep 2017 16:45:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 22/38] target/s390x: set cpu->id for linux user when realizing 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand scc->next_cpu_id is updated when realizing. Setting it just before that point looks cleaner. Reviewed-by: Matthew Rosato Reviewed-by: Igor Mammedov Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-13-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/cpu.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 74b3e4fd0d..5f9315fb16 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -194,7 +194,11 @@ static void s390_cpu_realizefn(DeviceState *dev, Error= **errp) ", max allowed: %d", cpu->id, max_cpus - 1); goto out; } +#else + /* implicitly set for linux-user only */ + cpu->id =3D scc->next_cpu_id; #endif + if (cpu_exists(cpu->id)) { error_setg(&err, "Unable to add CPU: %" PRIi64 ", it already exists", cpu->id); @@ -306,13 +310,6 @@ static void s390_cpu_initfn(Object *obj) inited =3D true; s390x_translate_init(); } - -#if defined(CONFIG_USER_ONLY) - { - S390CPUClass *scc =3D S390_CPU_GET_CLASS(obj); - cpu->id =3D scc->next_cpu_id; - } -#endif } =20 static void s390_cpu_finalize(Object *obj) --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840783865179.86319185095658; Tue, 19 Sep 2017 10:06:23 -0700 (PDT) Received: from localhost ([::1]:44180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLyY-0008W2-U6 for importer@patchew.org; Tue, 19 Sep 2017 13:06:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLeU-00074W-Qw for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLeR-0003kW-Lk for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2290) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLeR-0003jL-DS for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:35 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C4A8C071886; Tue, 19 Sep 2017 16:45:34 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 814195D983; Tue, 19 Sep 2017 16:45:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6C4A8C071886 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:22 +0200 Message-Id: <20170919164337.18555-24-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 19 Sep 2017 16:45:34 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 23/38] target/s390x: use "core-id" for cpu number/address/id handling 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Some time ago we discussed that using "id" as property name is not the right thing to do, as it is a reserved property for other devices and will not work with device_add. Switch to the term "core-id" instead, and use it as an equivalent to "CPU address" mentioned in the PoP. There is no such thing as cpu number, so rename env.cpu_num to env.core_id. We use "core-id" as this is the common term to use for device_add later on (x86 and ppc). We can get rid of cpu->id now. Keep cpu_index and env->core_id in sync. cpu_index was already implicitly used by e.g. cpu_exists(), so keeping both in sync seems to be the right thing to do. cpu_index will now no longer automatically get set via cpu_exec_realizefn(). For now, we were lucky that both implicitly stayed in sync. Our new cpu property "core-id" can be a static property. Range checks can be avoided by using the correct type and the "setting after realized" check is done implicitly. device_add will later need the reserved "id" property. Hotplugging a CPU on s390x will then be: "device_add host-s390-cpu,id=3Dcpu2,core-id=3D2". Reviewed-by: Matthew Rosato Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-14-david@redhat.com> Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 2 +- target/s390x/cpu.c | 72 +++++++++++++-----------------------------= ---- target/s390x/cpu.h | 5 ++-- target/s390x/cpu_models.c | 2 +- target/s390x/excp_helper.c | 2 +- target/s390x/helper.c | 4 +-- target/s390x/misc_helper.c | 4 +-- target/s390x/translate.c | 5 +--- 8 files changed, 30 insertions(+), 66 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 56f8200851..99c36a1315 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -312,7 +312,7 @@ static void s390_cpu_plug(HotplugHandler *hotplug_dev, S390CPU *cpu =3D S390_CPU(dev); CPUState *cs =3D CPU(dev); =20 - name =3D g_strdup_printf("cpu[%i]", cpu->env.cpu_num); + name =3D g_strdup_printf("cpu[%i]", cpu->env.core_id); object_property_set_link(OBJECT(hotplug_dev), OBJECT(cs), name, errp); g_free(name); diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 5f9315fb16..87ebbe5b28 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -36,6 +36,7 @@ #include "trace.h" #include "qapi/visitor.h" #include "exec/exec-all.h" +#include "hw/qdev-properties.h" #ifndef CONFIG_USER_ONLY #include "hw/hw.h" #include "sysemu/arch_init.h" @@ -189,28 +190,31 @@ static void s390_cpu_realizefn(DeviceState *dev, Erro= r **errp) } =20 #if !defined(CONFIG_USER_ONLY) - if (cpu->id >=3D max_cpus) { - error_setg(&err, "Unable to add CPU: %" PRIi64 - ", max allowed: %d", cpu->id, max_cpus - 1); + if (cpu->env.core_id >=3D max_cpus) { + error_setg(&err, "Unable to add CPU with core-id: %" PRIu32 + ", maximum core-id: %d", cpu->env.core_id, + max_cpus - 1); goto out; } #else /* implicitly set for linux-user only */ - cpu->id =3D scc->next_cpu_id; + cpu->env.core_id =3D scc->next_cpu_id; #endif =20 - if (cpu_exists(cpu->id)) { - error_setg(&err, "Unable to add CPU: %" PRIi64 - ", it already exists", cpu->id); + if (cpu_exists(cpu->env.core_id)) { + error_setg(&err, "Unable to add CPU with core-id: %" PRIu32 + ", it already exists", cpu->env.core_id); goto out; } - if (cpu->id !=3D scc->next_cpu_id) { - error_setg(&err, "Unable to add CPU: %" PRIi64 - ", The next available id is %" PRIi64, cpu->id, + if (cpu->env.core_id !=3D scc->next_cpu_id) { + error_setg(&err, "Unable to add CPU with core-id: %" PRIu32 + ", the next available core-id is %" PRIi64, cpu->env.co= re_id, scc->next_cpu_id); goto out; } =20 + /* sync cs->cpu_index and env->core_id. The latter is needed for TCG. = */ + cs->cpu_index =3D env->core_id; cpu_exec_realizefn(cs, &err); if (err !=3D NULL) { goto out; @@ -220,7 +224,6 @@ static void s390_cpu_realizefn(DeviceState *dev, Error = **errp) #if !defined(CONFIG_USER_ONLY) qemu_register_reset(s390_cpu_machine_reset_cb, cpu); #endif - env->cpu_num =3D cpu->id; s390_cpu_gdb_init(cs); qemu_init_vcpu(cs); #if !defined(CONFIG_USER_ONLY) @@ -241,45 +244,6 @@ out: error_propagate(errp, err); } =20 -static void s390x_cpu_get_id(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - S390CPU *cpu =3D S390_CPU(obj); - int64_t value =3D cpu->id; - - visit_type_int(v, name, &value, errp); -} - -static void s390x_cpu_set_id(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - S390CPU *cpu =3D S390_CPU(obj); - DeviceState *dev =3D DEVICE(obj); - const int64_t min =3D 0; - const int64_t max =3D UINT32_MAX; - Error *err =3D NULL; - int64_t value; - - if (dev->realized) { - error_setg(errp, "Attempt to set property '%s' on '%s' after " - "it was realized", name, object_get_typename(obj)); - return; - } - - visit_type_int(v, name, &value, &err); - if (err) { - error_propagate(errp, err); - return; - } - if (value < min || value > max) { - error_setg(errp, "Property %s.%s doesn't take value %" PRId64 - " (minimum: %" PRId64 ", maximum: %" PRId64 ")" , - object_get_typename(obj), name, value, min, max); - return; - } - cpu->id =3D value; -} - static void s390_cpu_initfn(Object *obj) { CPUState *cs =3D CPU(obj); @@ -293,8 +257,6 @@ static void s390_cpu_initfn(Object *obj) cs->env_ptr =3D env; cs->halted =3D 1; cs->exception_index =3D EXCP_HLT; - object_property_add(OBJECT(cpu), "id", "int64_t", s390x_cpu_get_id, - s390x_cpu_set_id, NULL, NULL, NULL); s390_cpu_model_register_props(obj); #if !defined(CONFIG_USER_ONLY) qemu_get_timedate(&tm, 0); @@ -491,6 +453,11 @@ static gchar *s390_gdb_arch_name(CPUState *cs) return g_strdup("s390:64-bit"); } =20 +static Property s390x_cpu_properties[] =3D { + DEFINE_PROP_UINT32("core-id", S390CPU, env.core_id, 0), + DEFINE_PROP_END_OF_LIST() +}; + static void s390_cpu_class_init(ObjectClass *oc, void *data) { S390CPUClass *scc =3D S390_CPU_CLASS(oc); @@ -500,6 +467,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *= data) scc->next_cpu_id =3D 0; scc->parent_realize =3D dc->realize; dc->realize =3D s390_cpu_realizefn; + dc->props =3D s390x_cpu_properties; =20 scc->parent_reset =3D cc->reset; #if !defined(CONFIG_USER_ONLY) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 5295bd3c66..1c8456fa57 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -150,7 +150,7 @@ struct CPUS390XState { =20 CPU_COMMON =20 - uint32_t cpu_num; + uint32_t core_id; /* PoP "CPU address", same as cpu_index */ uint64_t cpuid; =20 uint64_t tod_offset; @@ -194,7 +194,6 @@ struct S390CPU { /*< public >*/ =20 CPUS390XState env; - int64_t id; S390CPUModel *model; /* needed for live migration */ void *irqstate; @@ -690,7 +689,7 @@ const char *s390_default_cpu_model_name(void); =20 /* helper.c */ #define cpu_init(cpu_model) cpu_generic_init(TYPE_S390_CPU, cpu_model) -S390CPU *s390x_new_cpu(const char *cpu_model, int64_t id, Error **errp); +S390CPU *s390x_new_cpu(const char *cpu_model, uint32_t core_id, Error **er= rp); /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 18cbf91d9c..8e20e7637b 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -915,7 +915,7 @@ void s390_realize_cpu_model(CPUState *cs, Error **errp) cpu->env.cpuid =3D s390_cpuid_from_cpu_model(cpu->model); if (tcg_enabled()) { /* basic mode, write the cpu address into the first 4 bit of the I= D */ - cpu->env.cpuid =3D deposit64(cpu->env.cpuid, 54, 4, cpu->env.cpu_n= um); + cpu->env.cpuid =3D deposit64(cpu->env.cpuid, 54, 4, cpu->env.core_= id); } } =20 diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index 14d3160e92..470cf8f5bc 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -250,7 +250,7 @@ static void do_ext_interrupt(CPUS390XState *env) lowcore->ext_params2 =3D cpu_to_be64(q->param64); lowcore->external_old_psw.mask =3D cpu_to_be64(get_psw_mask(env)); lowcore->external_old_psw.addr =3D cpu_to_be64(env->psw.addr); - lowcore->cpu_addr =3D cpu_to_be16(env->cpu_num | VIRTIO_SUBCODE_64); + lowcore->cpu_addr =3D cpu_to_be16(env->core_id | VIRTIO_SUBCODE_64); mask =3D be64_to_cpu(lowcore->external_new_psw.mask); addr =3D be64_to_cpu(lowcore->external_new_psw.addr); =20 diff --git a/target/s390x/helper.c b/target/s390x/helper.c index ba29504476..dfb24ef5b2 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -104,7 +104,7 @@ S390CPU *cpu_s390x_create(const char *cpu_model, Error = **errp) return S390_CPU(CPU(object_new(typename))); } =20 -S390CPU *s390x_new_cpu(const char *cpu_model, int64_t id, Error **errp) +S390CPU *s390x_new_cpu(const char *cpu_model, uint32_t core_id, Error **er= rp) { S390CPU *cpu; Error *err =3D NULL; @@ -114,7 +114,7 @@ S390CPU *s390x_new_cpu(const char *cpu_model, int64_t i= d, Error **errp) goto out; } =20 - object_property_set_int(OBJECT(cpu), id, "id", &err); + object_property_set_int(OBJECT(cpu), core_id, "core-id", &err); if (err !=3D NULL) { goto out; } diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index f3624d75eb..293fc8428a 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -232,7 +232,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, /* XXX make different for different CPUs? */ ebcdic_put(sysib.sequence, "QEMUQEMUQEMUQEMU", 16); ebcdic_put(sysib.plant, "QEMU", 4); - stw_p(&sysib.cpu_addr, env->cpu_num); + stw_p(&sysib.cpu_addr, env->core_id); cpu_physical_memory_write(a0, &sysib, sizeof(sysib)); } else if ((sel1 =3D=3D 2) && (sel2 =3D=3D 2)) { /* Basic Machine CPUs */ @@ -260,7 +260,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, /* XXX make different for different CPUs? */ ebcdic_put(sysib.sequence, "QEMUQEMUQEMUQEMU", 16); ebcdic_put(sysib.plant, "QEMU", 4); - stw_p(&sysib.cpu_addr, env->cpu_num); + stw_p(&sysib.cpu_addr, env->core_id); stw_p(&sysib.cpu_id, 0); cpu_physical_memory_write(a0, &sysib, sizeof(sysib)); } else if ((sel1 =3D=3D 2) && (sel2 =3D=3D 2)) { diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 909b12818d..5abd34fb34 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -3823,10 +3823,7 @@ static ExitStatus op_ssm(DisasContext *s, DisasOps *= o) static ExitStatus op_stap(DisasContext *s, DisasOps *o) { check_privileged(s); - /* ??? Surely cpu address !=3D cpu number. In any case the previous - version of this stored more than the required half-word, so it - is unlikely this has ever been tested. */ - tcg_gen_ld32u_i64(o->out, cpu_env, offsetof(CPUS390XState, cpu_num)); + tcg_gen_ld32u_i64(o->out, cpu_env, offsetof(CPUS390XState, core_id)); return NO_EXIT; } =20 --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840842068549.850467790491; Tue, 19 Sep 2017 10:07:22 -0700 (PDT) Received: from localhost ([::1]:44182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLzU-0000up-2l for importer@patchew.org; Tue, 19 Sep 2017 13:07:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLeV-00074v-Bu for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLeU-0003nE-H9 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41898) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLeU-0003me-9P for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:38 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 048CD806CD; Tue, 19 Sep 2017 16:45:37 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7E4175D983; Tue, 19 Sep 2017 16:45:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 048CD806CD Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:23 +0200 Message-Id: <20170919164337.18555-25-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 19 Sep 2017 16:45:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 24/38] target/s390x: rename next_cpu_id to next_core_id 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Adapt to the new term "core_id". While at it, fix the type and drop the initialization to 0 (which is superfluous). Reviewed-by: Matthew Rosato Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-15-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/cpu-qom.h | 2 +- target/s390x/cpu.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/target/s390x/cpu-qom.h b/target/s390x/cpu-qom.h index 2435cd8390..2e446fab51 100644 --- a/target/s390x/cpu-qom.h +++ b/target/s390x/cpu-qom.h @@ -54,7 +54,7 @@ typedef struct S390CPUClass { bool is_migration_safe; const char *desc; =20 - int64_t next_cpu_id; + uint32_t next_core_id; =20 DeviceRealize parent_realize; void (*parent_reset)(CPUState *cpu); diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 87ebbe5b28..8c1c644057 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -198,7 +198,7 @@ static void s390_cpu_realizefn(DeviceState *dev, Error = **errp) } #else /* implicitly set for linux-user only */ - cpu->env.core_id =3D scc->next_cpu_id; + cpu->env.core_id =3D scc->next_core_id; #endif =20 if (cpu_exists(cpu->env.core_id)) { @@ -206,10 +206,10 @@ static void s390_cpu_realizefn(DeviceState *dev, Erro= r **errp) ", it already exists", cpu->env.core_id); goto out; } - if (cpu->env.core_id !=3D scc->next_cpu_id) { + if (cpu->env.core_id !=3D scc->next_core_id) { error_setg(&err, "Unable to add CPU with core-id: %" PRIu32 - ", the next available core-id is %" PRIi64, cpu->env.co= re_id, - scc->next_cpu_id); + ", the next available core-id is %" PRIu32, cpu->env.co= re_id, + scc->next_core_id); goto out; } =20 @@ -219,7 +219,7 @@ static void s390_cpu_realizefn(DeviceState *dev, Error = **errp) if (err !=3D NULL) { goto out; } - scc->next_cpu_id++; + scc->next_core_id++; =20 #if !defined(CONFIG_USER_ONLY) qemu_register_reset(s390_cpu_machine_reset_cb, cpu); @@ -464,7 +464,6 @@ static void s390_cpu_class_init(ObjectClass *oc, void *= data) CPUClass *cc =3D CPU_CLASS(scc); DeviceClass *dc =3D DEVICE_CLASS(oc); =20 - scc->next_cpu_id =3D 0; scc->parent_realize =3D dc->realize; dc->realize =3D s390_cpu_realizefn; dc->props =3D s390x_cpu_properties; --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150584101308841.65876668849876; Tue, 19 Sep 2017 10:10:13 -0700 (PDT) Received: from localhost ([::1]:44191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duM2F-0003RD-RD for importer@patchew.org; Tue, 19 Sep 2017 13:10:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLee-0007D1-95 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLeb-0003ss-Eu for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53756) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLea-0003rn-Vb for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:45 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EAA777E42C; Tue, 19 Sep 2017 16:45:43 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1D2165D6A6; Tue, 19 Sep 2017 16:45:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EAA777E42C Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:24 +0200 Message-Id: <20170919164337.18555-26-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 19 Sep 2017 16:45:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 25/38] s390x: print CPU definitions in sorted order 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Other architectures provide nicely sorted lists, let's do it similarly on s390x. While at it, clean up the code we have to touch either way. Acked-by: Christian Borntraeger Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-16-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/cpu_models.c | 56 ++++++++++++++++++++++++++++++++++---------= ---- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 8e20e7637b..c295e641e6 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -270,16 +270,11 @@ const S390CPUDef *s390_find_cpu_def(uint16_t type, ui= nt8_t gen, uint8_t ec_ga, return last_compatible; } =20 -struct S390PrintCpuListInfo { - FILE *f; - fprintf_function print; -}; - -static void print_cpu_model_list(ObjectClass *klass, void *opaque) +static void s390_print_cpu_model_list_entry(gpointer data, gpointer user_d= ata) { - struct S390PrintCpuListInfo *info =3D opaque; - S390CPUClass *scc =3D S390_CPU_CLASS(klass); - char *name =3D g_strdup(object_class_get_name(klass)); + CPUListState *s =3D user_data; + const S390CPUClass *scc =3D S390_CPU_CLASS((ObjectClass *)data); + char *name =3D g_strdup(object_class_get_name((ObjectClass *)data)); const char *details =3D ""; =20 if (scc->is_static) { @@ -290,21 +285,52 @@ static void print_cpu_model_list(ObjectClass *klass, = void *opaque) =20 /* strip off the -s390-cpu */ g_strrstr(name, "-" TYPE_S390_CPU)[0] =3D 0; - (*info->print)(info->f, "s390 %-15s %-35s %s\n", name, scc->desc, - details); + (*s->cpu_fprintf)(s->file, "s390 %-15s %-35s %s\n", name, scc->desc, + details); g_free(name); } =20 +static gint s390_cpu_list_compare(gconstpointer a, gconstpointer b) +{ + const S390CPUClass *cc_a =3D S390_CPU_CLASS((ObjectClass *)a); + const S390CPUClass *cc_b =3D S390_CPU_CLASS((ObjectClass *)b); + const char *name_a =3D object_class_get_name((ObjectClass *)a); + const char *name_b =3D object_class_get_name((ObjectClass *)b); + + /* move qemu and host to the top of the list, qemu first, host second = */ + if (name_a[0] =3D=3D 'q') { + return -1; + } else if (name_b[0] =3D=3D 'q') { + return 1; + } else if (name_a[0] =3D=3D 'h') { + return -1; + } else if (name_b[0] =3D=3D 'h') { + return 1; + } + + /* keep the same order we have in our table (sorted by release date) */ + if (cc_a->cpu_def !=3D cc_b->cpu_def) { + return cc_a->cpu_def - cc_b->cpu_def; + } + + /* exact same definition - list base model first */ + return cc_a->is_static ? -1 : 1; +} + void s390_cpu_list(FILE *f, fprintf_function print) { - struct S390PrintCpuListInfo info =3D { - .f =3D f, - .print =3D print, + CPUListState s =3D { + .file =3D f, + .cpu_fprintf =3D print, }; S390FeatGroup group; S390Feat feat; + GSList *list; =20 - object_class_foreach(print_cpu_model_list, TYPE_S390_CPU, false, &info= ); + list =3D object_class_get_list(TYPE_S390_CPU, false); + list =3D g_slist_sort(list, s390_cpu_list_compare); + g_slist_foreach(list, s390_print_cpu_model_list_entry, &s); + g_slist_free(list); =20 (*print)(f, "\nRecognized feature flags:\n"); for (feat =3D 0; feat < S390_FEAT_MAX; feat++) { --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840382068453.3418904643479; Tue, 19 Sep 2017 09:59:42 -0700 (PDT) Received: from localhost ([::1]:44145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLs5-0002Tl-A9 for importer@patchew.org; Tue, 19 Sep 2017 12:59:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLeh-0007Fd-6T for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLeg-0003wW-AC for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50580) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLeg-0003vW-5A for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:50 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E828D3D97B; Tue, 19 Sep 2017 16:45:48 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09BAC5C88F; Tue, 19 Sep 2017 16:45:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E828D3D97B Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:25 +0200 Message-Id: <20170919164337.18555-27-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 19 Sep 2017 16:45:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 26/38] s390x: allow cpu hotplug via device_add 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand E.g. the following now works: device_add host-s390-cpu,id=3Dcpu1,core-id=3D1 The system will perform the same checks as when using cpu_add: - If the core_id is already in use - If the next sequential core_id isn't used - If core-id >=3D max_cpu is specified In addition, mixed CPU models are checked. E.g. if starting with -cpu host and trying to hotplug "qemu-s390-cpu": "Mixed CPU models are not supported on s390x." Reviewed-by: Matthew Rosato Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-17-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 8c1c644057..5724dffb88 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -467,6 +467,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *= data) scc->parent_realize =3D dc->realize; dc->realize =3D s390_cpu_realizefn; dc->props =3D s390x_cpu_properties; + dc->user_creatable =3D true; =20 scc->parent_reset =3D cc->reset; #if !defined(CONFIG_USER_ONLY) --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840353685466.2425168849792; Tue, 19 Sep 2017 09:59:13 -0700 (PDT) Received: from localhost ([::1]:44143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLrd-00025J-0Q for importer@patchew.org; Tue, 19 Sep 2017 12:59:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLeo-0007LA-3T for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLel-00041g-AZ for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39228) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLel-00040A-5A for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:45:55 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F6DA5F7AD; Tue, 19 Sep 2017 16:45:54 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F3968610B0; Tue, 19 Sep 2017 16:45:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2F6DA5F7AD Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:26 +0200 Message-Id: <20170919164337.18555-28-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 19 Sep 2017 16:45:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 27/38] s390x: CPU hot unplug via device_del cannot work for now 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand device_del on a CPU will currently do nothing. Let's emit an error telling that this is will currently not work (there is no architecture support on s390x). Error message copied from ppc. (qemu) device_del cpu1 device_del cpu1 CPU hot unplug not supported on this machine Reviewed-by: Matthew Rosato Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-18-david@redhat.com> Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 99c36a1315..acdd53573c 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -339,6 +339,15 @@ static void s390_machine_device_plug(HotplugHandler *h= otplug_dev, } } =20 +static void s390_machine_device_unplug_request(HotplugHandler *hotplug_dev, + DeviceState *dev, Error **e= rrp) +{ + if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { + error_setg(errp, "CPU hot unplug not supported on this machine"); + return; + } +} + static HotplugHandler *s390_get_hotplug_handler(MachineState *machine, DeviceState *dev) { @@ -388,6 +397,7 @@ static void ccw_machine_class_init(ObjectClass *oc, voi= d *data) mc->max_cpus =3D 248; mc->get_hotplug_handler =3D s390_get_hotplug_handler; hc->plug =3D s390_machine_device_plug; + hc->unplug_request =3D s390_machine_device_unplug_request; nc->nmi_monitor_handler =3D s390_nmi; } =20 --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150584117455871.01008198082036; Tue, 19 Sep 2017 10:12:54 -0700 (PDT) Received: from localhost ([::1]:44205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duM4r-0005lo-4D for importer@patchew.org; Tue, 19 Sep 2017 13:12:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLes-0007OK-6s for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLer-00046e-4A for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56308) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLeq-00045d-QN for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:01 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9672AC0587C5; Tue, 19 Sep 2017 16:45:59 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 348855D97D; Tue, 19 Sep 2017 16:45:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9672AC0587C5 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:27 +0200 Message-Id: <20170919164337.18555-29-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 19 Sep 2017 16:45:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 28/38] s390x: implement query-hotpluggable-cpus 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand CPU hotplug is only possible on a per core basis on s390x. So let's add possible_cpus and wire everything up properly. Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-19-david@redhat.com> Acked-by: Igor Mammedov Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 41 +++++++++++++++++++++++++++++++++++++++++ qapi-schema.json | 16 ++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index acdd53573c..b7b2b7ebcd 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -50,6 +50,7 @@ S390CPU *s390_cpu_addr2state(uint16_t cpu_addr) =20 static void s390_init_cpus(MachineState *machine) { + MachineClass *mc =3D MACHINE_GET_CLASS(machine); int i; gchar *name; =20 @@ -74,6 +75,9 @@ static void s390_init_cpus(MachineState *machine) g_free(name); } =20 + /* initialize possible_cpus */ + mc->possible_cpu_arch_ids(machine); + for (i =3D 0; i < smp_cpus; i++) { s390x_new_cpu(machine->cpu_model, i, &error_fatal); } @@ -309,6 +313,7 @@ static void s390_cpu_plug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { gchar *name; + MachineState *ms =3D MACHINE(hotplug_dev); S390CPU *cpu =3D S390_CPU(dev); CPUState *cs =3D CPU(dev); =20 @@ -316,6 +321,9 @@ static void s390_cpu_plug(HotplugHandler *hotplug_dev, object_property_set_link(OBJECT(hotplug_dev), OBJECT(cs), name, errp); g_free(name); + + g_assert(!ms->possible_cpus->cpus[cpu->env.core_id].cpu); + ms->possible_cpus->cpus[cpu->env.core_id].cpu =3D OBJECT(dev); } =20 static void s390_machine_reset(void) @@ -348,6 +356,36 @@ static void s390_machine_device_unplug_request(Hotplug= Handler *hotplug_dev, } } =20 +static CpuInstanceProperties s390_cpu_index_to_props(MachineState *machine, + unsigned cpu_index) +{ + g_assert(machine->possible_cpus && cpu_index < machine->possible_cpus-= >len); + + return machine->possible_cpus->cpus[cpu_index].props; +} + +static const CPUArchIdList *s390_possible_cpu_arch_ids(MachineState *ms) +{ + int i; + + if (ms->possible_cpus) { + g_assert(ms->possible_cpus && ms->possible_cpus->len =3D=3D max_cp= us); + return ms->possible_cpus; + } + + ms->possible_cpus =3D g_malloc0(sizeof(CPUArchIdList) + + sizeof(CPUArchId) * max_cpus); + ms->possible_cpus->len =3D max_cpus; + for (i =3D 0; i < ms->possible_cpus->len; i++) { + ms->possible_cpus->cpus[i].vcpus_count =3D 1; + ms->possible_cpus->cpus[i].arch_id =3D i; + ms->possible_cpus->cpus[i].props.has_core_id =3D true; + ms->possible_cpus->cpus[i].props.core_id =3D i; + } + + return ms->possible_cpus; +} + static HotplugHandler *s390_get_hotplug_handler(MachineState *machine, DeviceState *dev) { @@ -395,7 +433,10 @@ static void ccw_machine_class_init(ObjectClass *oc, vo= id *data) mc->no_sdcard =3D 1; mc->use_sclp =3D 1; mc->max_cpus =3D 248; + mc->has_hotpluggable_cpus =3D true; mc->get_hotplug_handler =3D s390_get_hotplug_handler; + mc->cpu_index_to_instance_props =3D s390_cpu_index_to_props; + mc->possible_cpu_arch_ids =3D s390_possible_cpu_arch_ids; hc->plug =3D s390_machine_device_plug; hc->unplug_request =3D s390_machine_device_unplug_request; nc->nmi_monitor_handler =3D s390_nmi; diff --git a/qapi-schema.json b/qapi-schema.json index cdff39a456..a3ba1c9a1c 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3153,6 +3153,22 @@ # } # ]} # +# For s390x-virtio-ccw machine type started with -smp 1,maxcpus=3D2 -cpu q= emu +# (Since: 2.11): +# +# -> { "execute": "query-hotpluggable-cpus" } +# <- {"return": [ +# { +# "type": "qemu-s390-cpu", "vcpus-count": 1, +# "props": { "core-id": 1 } +# }, +# { +# "qom-path": "/machine/unattached/device[0]", +# "type": "qemu-s390-cpu", "vcpus-count": 1, +# "props": { "core-id": 0 } +# } +# ]} +# ## { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] } =20 --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840509520839.9832019401042; Tue, 19 Sep 2017 10:01:49 -0700 (PDT) Received: from localhost ([::1]:44161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLu8-0004QA-FZ for importer@patchew.org; Tue, 19 Sep 2017 13:01:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLez-0007Tx-BM for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLet-00048J-D3 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55174) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLet-00047p-4K for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:03 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1986D7E443; Tue, 19 Sep 2017 16:46:02 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72BC45D97D; Tue, 19 Sep 2017 16:46:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1986D7E443 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:28 +0200 Message-Id: <20170919164337.18555-30-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 19 Sep 2017 16:46:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 29/38] s390x: get rid of cpu_states and use possible_cpus instead 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Now that we have possible_cpus, we can get rid of the global variable and rewrite s390_cpu_addr2state() to use it. Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-20-david@redhat.com> Reviewed-by: Igor Mammedov Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index b7b2b7ebcd..0caf20b719 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -36,23 +36,26 @@ #include "qapi/qmp/qerror.h" #include "hw/nmi.h" =20 -static S390CPU **cpu_states; - S390CPU *s390_cpu_addr2state(uint16_t cpu_addr) { - if (cpu_addr >=3D max_cpus) { - return NULL; + static MachineState *ms; + + if (!ms) { + ms =3D MACHINE(qdev_get_machine()); + g_assert(ms->possible_cpus); } =20 - /* Fast lookup via CPU ID */ - return cpu_states[cpu_addr]; + /* CPU address corresponds to the core_id and the index */ + if (cpu_addr >=3D ms->possible_cpus->len) { + return NULL; + } + return S390_CPU(ms->possible_cpus->cpus[cpu_addr].cpu); } =20 static void s390_init_cpus(MachineState *machine) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); int i; - gchar *name; =20 if (machine->cpu_model =3D=3D NULL) { machine->cpu_model =3D s390_default_cpu_model_name(); @@ -63,18 +66,6 @@ static void s390_init_cpus(MachineState *machine) exit(1); } =20 - cpu_states =3D g_new0(S390CPU *, max_cpus); - - for (i =3D 0; i < max_cpus; i++) { - name =3D g_strdup_printf("cpu[%i]", i); - object_property_add_link(OBJECT(machine), name, TYPE_S390_CPU, - (Object **) &cpu_states[i], - object_property_allow_set_link, - OBJ_PROP_LINK_UNREF_ON_RELEASE, - &error_abort); - g_free(name); - } - /* initialize possible_cpus */ mc->possible_cpu_arch_ids(machine); =20 @@ -312,15 +303,8 @@ static void ccw_init(MachineState *machine) static void s390_cpu_plug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { - gchar *name; MachineState *ms =3D MACHINE(hotplug_dev); S390CPU *cpu =3D S390_CPU(dev); - CPUState *cs =3D CPU(dev); - - name =3D g_strdup_printf("cpu[%i]", cpu->env.core_id); - object_property_set_link(OBJECT(hotplug_dev), OBJECT(cs), name, - errp); - g_free(name); =20 g_assert(!ms->possible_cpus->cpus[cpu->env.core_id].cpu); ms->possible_cpus->cpus[cpu->env.core_id].cpu =3D OBJECT(dev); --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505841329477415.85470553025345; Tue, 19 Sep 2017 10:15:29 -0700 (PDT) Received: from localhost ([::1]:44216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duM7L-00089z-HT for importer@patchew.org; Tue, 19 Sep 2017 13:15:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLf1-0007VW-4k for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLey-0004Ay-Av for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43846) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLey-0004AG-3U for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:08 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 098A312987B; Tue, 19 Sep 2017 16:46:07 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 075EF17527; Tue, 19 Sep 2017 16:46:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 098A312987B Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:29 +0200 Message-Id: <20170919164337.18555-31-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Sep 2017 16:46:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 30/38] s390x: get rid of cpu_s390x_create() 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Now that there is only one user of cpu_s390x_create() left, make cpu creation look like on x86. - Perform the model/properties split and checks in s390_init_cpus() - Parse features only once without having to remember if already parsed - Pass only the typename to s390x_new_cpu() - Use the typename of an existing CPU for hotplug via cpu-add Acked-by: Igor Mammedov Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-21-david@redhat.com> Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 29 +++++++++++++++++++++++++++-- target/s390x/cpu.h | 2 +- target/s390x/helper.c | 45 ++----------------------------------------= --- target/s390x/internal.h | 1 - 4 files changed, 30 insertions(+), 47 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 0caf20b719..fafbc6d4fe 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -55,6 +55,10 @@ S390CPU *s390_cpu_addr2state(uint16_t cpu_addr) static void s390_init_cpus(MachineState *machine) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); + const char *typename; + gchar **model_pieces; + ObjectClass *oc; + CPUClass *cc; int i; =20 if (machine->cpu_model =3D=3D NULL) { @@ -69,8 +73,25 @@ static void s390_init_cpus(MachineState *machine) /* initialize possible_cpus */ mc->possible_cpu_arch_ids(machine); =20 + model_pieces =3D g_strsplit(machine->cpu_model, ",", 2); + if (!model_pieces[0]) { + error_report("Invalid/empty CPU model name"); + exit(1); + } + + oc =3D cpu_class_by_name(TYPE_S390_CPU, model_pieces[0]); + if (!oc) { + error_report("Unable to find CPU definition: %s", model_pieces[0]); + exit(1); + } + typename =3D object_class_get_name(oc); + cc =3D CPU_CLASS(oc); + /* after parsing, properties will be applied to all *typename* instanc= es */ + cc->parse_features(typename, model_pieces[1], &error_fatal); + g_strfreev(model_pieces); + for (i =3D 0; i < smp_cpus; i++) { - s390x_new_cpu(machine->cpu_model, i, &error_fatal); + s390x_new_cpu(typename, i, &error_fatal); } } =20 @@ -382,8 +403,12 @@ static HotplugHandler *s390_get_hotplug_handler(Machin= eState *machine, static void s390_hot_add_cpu(const int64_t id, Error **errp) { MachineState *machine =3D MACHINE(qdev_get_machine()); + ObjectClass *oc; + + g_assert(machine->possible_cpus->cpus[0].cpu); + oc =3D OBJECT_CLASS(CPU_GET_CLASS(machine->possible_cpus->cpus[0].cpu)= ); =20 - s390x_new_cpu(machine->cpu_model, id, errp); + s390x_new_cpu(object_class_get_name(oc), id, errp); } =20 static void s390_nmi(NMIState *n, int cpu_index, Error **errp) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 1c8456fa57..9b549dc491 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -689,7 +689,7 @@ const char *s390_default_cpu_model_name(void); =20 /* helper.c */ #define cpu_init(cpu_model) cpu_generic_init(TYPE_S390_CPU, cpu_model) -S390CPU *s390x_new_cpu(const char *cpu_model, uint32_t core_id, Error **er= rp); +S390CPU *s390x_new_cpu(const char *typename, uint32_t core_id, Error **err= p); /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ diff --git a/target/s390x/helper.c b/target/s390x/helper.c index dfb24ef5b2..97adbcc86d 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -68,52 +68,11 @@ void s390x_cpu_timer(void *opaque) } #endif =20 -S390CPU *cpu_s390x_create(const char *cpu_model, Error **errp) +S390CPU *s390x_new_cpu(const char *typename, uint32_t core_id, Error **err= p) { - static bool features_parsed; - char *name, *features; - const char *typename; - ObjectClass *oc; - CPUClass *cc; - - name =3D g_strdup(cpu_model); - features =3D strchr(name, ','); - if (features) { - features[0] =3D 0; - features++; - } - - oc =3D cpu_class_by_name(TYPE_S390_CPU, name); - if (!oc) { - error_setg(errp, "Unknown CPU definition \'%s\'", name); - g_free(name); - return NULL; - } - typename =3D object_class_get_name(oc); - - if (!features_parsed) { - features_parsed =3D true; - cc =3D CPU_CLASS(oc); - cc->parse_features(typename, features, errp); - } - g_free(name); - - if (*errp) { - return NULL; - } - return S390_CPU(CPU(object_new(typename))); -} - -S390CPU *s390x_new_cpu(const char *cpu_model, uint32_t core_id, Error **er= rp) -{ - S390CPU *cpu; + S390CPU *cpu =3D S390_CPU(object_new(typename)); Error *err =3D NULL; =20 - cpu =3D cpu_s390x_create(cpu_model, &err); - if (err !=3D NULL) { - goto out; - } - object_property_set_int(OBJECT(cpu), core_id, "core-id", &err); if (err !=3D NULL) { goto out; diff --git a/target/s390x/internal.h b/target/s390x/internal.h index b4d3583b24..bc8f83129a 100644 --- a/target/s390x/internal.h +++ b/target/s390x/internal.h @@ -337,7 +337,6 @@ uint64_t get_psw_mask(CPUS390XState *env); void s390_cpu_recompute_watchpoints(CPUState *cs); void s390x_tod_timer(void *opaque); void s390x_cpu_timer(void *opaque); -S390CPU *cpu_s390x_create(const char *cpu_model, Error **errp); void do_restart_interrupt(CPUS390XState *env); #ifndef CONFIG_USER_ONLY LowCore *cpu_map_lowcore(CPUS390XState *env); --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840686022729.5616532126264; Tue, 19 Sep 2017 10:04:46 -0700 (PDT) Received: from localhost ([::1]:44170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLwy-000740-9i for importer@patchew.org; Tue, 19 Sep 2017 13:04:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLf1-0007Vz-K8 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLf0-0004CN-Ll for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49182) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLf0-0004Bp-DW for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:10 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 634BE81236; Tue, 19 Sep 2017 16:46:09 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE63A5D97D; Tue, 19 Sep 2017 16:46:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 634BE81236 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:30 +0200 Message-Id: <20170919164337.18555-32-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 19 Sep 2017 16:46:09 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 31/38] s390x: generate sclp cpu information from possible_cpus 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand This is the first step to allow hot plugging of CPUs in a non-sequential order. If a cpu is available ("plugged") can directly be decided by looking at the cpu state pointer. This makes sure, that really only cpus attached to the machine are reported. Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-22-david@redhat.com> Signed-off-by: Cornelia Huck --- hw/s390x/sclp.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index fd097262c7..30aefbfd15 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -34,16 +34,21 @@ static inline SCLPDevice *get_sclp_device(void) return sclp; } =20 -static void prepare_cpu_entries(SCLPDevice *sclp, CPUEntry *entry, int cou= nt) +static void prepare_cpu_entries(SCLPDevice *sclp, CPUEntry *entry, int *co= unt) { + MachineState *ms =3D MACHINE(qdev_get_machine()); uint8_t features[SCCB_CPU_FEATURE_LEN] =3D { 0 }; int i; =20 s390_get_feat_block(S390_FEAT_TYPE_SCLP_CPU, features); - for (i =3D 0; i < count; i++) { - entry[i].address =3D i; - entry[i].type =3D 0; - memcpy(entry[i].features, features, sizeof(entry[i].features)); + for (i =3D 0, *count =3D 0; i < ms->possible_cpus->len; i++) { + if (!ms->possible_cpus->cpus[i].cpu) { + continue; + } + entry[*count].address =3D ms->possible_cpus->cpus[i].arch_id; + entry[*count].type =3D 0; + memcpy(entry[*count].features, features, sizeof(features)); + (*count)++; } } =20 @@ -53,17 +58,13 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) ReadInfo *read_info =3D (ReadInfo *) sccb; MachineState *machine =3D MACHINE(qdev_get_machine()); sclpMemoryHotplugDev *mhd =3D get_sclp_memory_hotplug_dev(); - CPUState *cpu; - int cpu_count =3D 0; + int cpu_count; int rnsize, rnmax; int slots =3D MIN(machine->ram_slots, s390_get_memslot_count()); IplParameterBlock *ipib =3D s390_ipl_get_iplb(); =20 - CPU_FOREACH(cpu) { - cpu_count++; - } - /* CPU information */ + prepare_cpu_entries(sclp, read_info->entries, &cpu_count); read_info->entries_cpu =3D cpu_to_be16(cpu_count); read_info->offset_cpu =3D cpu_to_be16(offsetof(ReadInfo, entries)); read_info->highest_cpu =3D cpu_to_be16(max_cpus); @@ -76,8 +77,6 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) s390_get_feat_block(S390_FEAT_TYPE_SCLP_CONF_CHAR_EXT, read_info->conf_char_ext); =20 - prepare_cpu_entries(sclp, read_info->entries, cpu_count); - read_info->facilities =3D cpu_to_be64(SCLP_HAS_CPU_INFO | SCLP_HAS_IOA_RECONFIG); =20 @@ -333,13 +332,9 @@ static void unassign_storage(SCLPDevice *sclp, SCCB *s= ccb) static void sclp_read_cpu_info(SCLPDevice *sclp, SCCB *sccb) { ReadCpuInfo *cpu_info =3D (ReadCpuInfo *) sccb; - CPUState *cpu; - int cpu_count =3D 0; - - CPU_FOREACH(cpu) { - cpu_count++; - } + int cpu_count; =20 + prepare_cpu_entries(sclp, cpu_info->entries, &cpu_count); cpu_info->nr_configured =3D cpu_to_be16(cpu_count); cpu_info->offset_configured =3D cpu_to_be16(offsetof(ReadCpuInfo, entr= ies)); cpu_info->nr_standby =3D cpu_to_be16(0); @@ -348,7 +343,6 @@ static void sclp_read_cpu_info(SCLPDevice *sclp, SCCB *= sccb) cpu_info->offset_standby =3D cpu_to_be16(cpu_info->offset_configured + cpu_info->nr_configured*sizeof(CPUEntry)); =20 - prepare_cpu_entries(sclp, cpu_info->entries, cpu_count); =20 sccb->h.response_code =3D cpu_to_be16(SCLP_RC_NORMAL_READ_COMPLETION); } --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840543962986.3935547967114; Tue, 19 Sep 2017 10:02:23 -0700 (PDT) Received: from localhost ([::1]:44163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLug-0004q3-RL for importer@patchew.org; Tue, 19 Sep 2017 13:02:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLf6-0007aM-2D for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLf4-0004F2-Vz for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44592) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLf4-0004Eb-R9 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:14 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D0E904E33A; Tue, 19 Sep 2017 16:46:13 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4337F5D6A4; Tue, 19 Sep 2017 16:46:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D0E904E33A Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:31 +0200 Message-Id: <20170919164337.18555-33-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Sep 2017 16:46:14 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 32/38] s390x: allow CPU hotplug in random core-id order 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand SCLP correctly indicates the core-id aka. CPU address for each available CPU. As the core-id corresponds to cpu_index, also a newly created kvm vcpu gets assigned this core-id as vcpu id. So SIGP in the kernel works correctly (it uses the vcpu id to lookup the correct CPU). So there should be nothing hindering us from hotplugging CPUs in random core-id order. This now makes sure that the output from "query-hotpluggable-cpus" is completely true. Until now, a specific order is implicit. Performance vice, hotplugging CPUs in non-sequential order might not be the best thing to do, as VCPU lookup inside KVM might be a little slower. But that doesn't hinder us from supporting it. next_core_id is now used by linux user only. Signed-off-by: David Hildenbrand Message-Id: <20170913132417.24384-23-david@redhat.com> Reviewed-by: Igor Mammedov Signed-off-by: Cornelia Huck --- target/s390x/cpu.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 5724dffb88..34538c3ab9 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -199,6 +199,7 @@ static void s390_cpu_realizefn(DeviceState *dev, Error = **errp) #else /* implicitly set for linux-user only */ cpu->env.core_id =3D scc->next_core_id; + scc->next_core_id++; #endif =20 if (cpu_exists(cpu->env.core_id)) { @@ -206,12 +207,6 @@ static void s390_cpu_realizefn(DeviceState *dev, Error= **errp) ", it already exists", cpu->env.core_id); goto out; } - if (cpu->env.core_id !=3D scc->next_core_id) { - error_setg(&err, "Unable to add CPU with core-id: %" PRIu32 - ", the next available core-id is %" PRIu32, cpu->env.co= re_id, - scc->next_core_id); - goto out; - } =20 /* sync cs->cpu_index and env->core_id. The latter is needed for TCG. = */ cs->cpu_index =3D env->core_id; @@ -219,7 +214,6 @@ static void s390_cpu_realizefn(DeviceState *dev, Error = **errp) if (err !=3D NULL) { goto out; } - scc->next_core_id++; =20 #if !defined(CONFIG_USER_ONLY) qemu_register_reset(s390_cpu_machine_reset_cb, cpu); --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840713906724.8532886559452; Tue, 19 Sep 2017 10:05:13 -0700 (PDT) Received: from localhost ([::1]:44172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLxR-0007WN-44 for importer@patchew.org; Tue, 19 Sep 2017 13:05:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLfC-0007gx-7t for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLfA-0004Jj-Kx for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54356) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLfA-0004IJ-GD for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:20 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 800FF13A49; Tue, 19 Sep 2017 16:46:19 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA44260590; Tue, 19 Sep 2017 16:46:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 800FF13A49 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:32 +0200 Message-Id: <20170919164337.18555-34-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 19 Sep 2017 16:46:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 33/38] virtio-ccw: remove stale comments on endianness 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, Halil Pasic , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Halil Pasic We have two stale comments suggesting one should think about virtio config space endianness a bit longer. We have just done that, and came to the conclusion we are fine as is: it's the responsibility of the virtio device and not of the transport (and that is how it works now). Putting the responsibility into the transport isn't even possible, because the transport would have to know about the config space layout of each device. Let us remove the stale comments. Signed-off-by: Halil Pasic Suggested-by: Cornelia Huck Message-Id: <20170914105535.47941-1-pasic@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index b1976fdd19..2262b0cc9a 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -487,7 +487,6 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) ret =3D -EFAULT; } else { virtio_bus_get_vdev_config(&dev->bus, vdev->config); - /* XXX config space endianness */ cpu_physical_memory_write(ccw.cda, vdev->config, len); sch->curr_status.scsw.count =3D ccw.count - len; ret =3D 0; @@ -510,7 +509,6 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) ret =3D -EFAULT; } else { len =3D hw_len; - /* XXX config space endianness */ memcpy(vdev->config, config, len); cpu_physical_memory_unmap(config, hw_len, 0, hw_len); virtio_bus_set_vdev_config(&dev->bus, vdev->config); --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840858752616.4949459013276; Tue, 19 Sep 2017 10:07:38 -0700 (PDT) Received: from localhost ([::1]:44183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLzm-00017r-06 for importer@patchew.org; Tue, 19 Sep 2017 13:07:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLfD-0007iC-SQ for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLfD-0004Lq-4y for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40530) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLfC-0004LJ-Vw for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:23 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F1D475F7AD; Tue, 19 Sep 2017 16:46:21 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C08A5D6A4; Tue, 19 Sep 2017 16:46:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F1D475F7AD Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:33 +0200 Message-Id: <20170919164337.18555-35-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 19 Sep 2017 16:46:22 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 34/38] configure: Allow --enable-seccomp on s390x, too X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth libseccomp supports s390x since version 2.3.0, and I was able to start a VM with "-sandbox on" without any obvious problems by using this patch, so it should be safe to allow --enable-seccomp on s390x nowadays, too. Signed-off-by: Thomas Huth Message-Id: <1505385363-27717-1-git-send-email-thuth@redhat.com> Acked-by: Christian Borntraeger Acked-by: Eduardo Otubo Acked-by: Halil Pasic Signed-off-by: Cornelia Huck --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 94db2d103e..cb0f7ed0ab 100755 --- a/configure +++ b/configure @@ -2025,7 +2025,7 @@ if test "$seccomp" !=3D "no" ; then arm|aarch64) libseccomp_minver=3D"2.2.3" ;; - ppc|ppc64) + ppc|ppc64|s390x) libseccomp_minver=3D"2.3.0" ;; *) --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505840886792586.2149522990463; Tue, 19 Sep 2017 10:08:06 -0700 (PDT) Received: from localhost ([::1]:44185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duM0E-0001X0-1P for importer@patchew.org; Tue, 19 Sep 2017 13:08:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLfH-0007kd-0k for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLfG-0004Oc-2n for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49956) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLfF-0004No-Ts for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:26 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6535881E1D; Tue, 19 Sep 2017 16:46:24 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DAE415D6A4; Tue, 19 Sep 2017 16:46:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6535881E1D Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:34 +0200 Message-Id: <20170919164337.18555-36-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 19 Sep 2017 16:46:25 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 35/38] s390x/ccw: create s390 phb for compat reasons as well 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" d32bd032d8 ("s390x/ccw: create s390 phb conditionally") made registering the s390 pci host bridge conditional on presense of the zpci facility bit. Sadly, that breaks migration from machines that did not use the cpu model (2.7 and previous). Create the s390 phb for pre-cpu model machines as well: We can tweak s390_has_feat() to always indicate the zpci facility bit when no cpu model is available (on 2.7 and previous compat machines). Fixes: d32bd032d8 ("s390x/ccw: create s390 phb conditionally") Acked-by: Christian Borntraeger Signed-off-by: Cornelia Huck --- target/s390x/cpu_models.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index c295e641e6..5169379db5 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -196,6 +196,9 @@ bool s390_has_feat(S390Feat feat) } } #endif + if (feat =3D=3D S390_FEAT_ZPCI) { + return true; + } return 0; } return test_bit(feat, cpu->model->features); --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505841031916152.86044518641017; Tue, 19 Sep 2017 10:10:31 -0700 (PDT) Received: from localhost ([::1]:44192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duM2Y-0003fE-Qf for importer@patchew.org; Tue, 19 Sep 2017 13:10:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLfO-0007ro-Hf for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLfK-0004Qn-3Q for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57366) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLfJ-0004QL-RX for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:30 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7976C058EA8; Tue, 19 Sep 2017 16:46:28 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C6155D97D; Tue, 19 Sep 2017 16:46:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C7976C058EA8 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:35 +0200 Message-Id: <20170919164337.18555-37-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 19 Sep 2017 16:46:28 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 36/38] virtio-gpu: Handle endian conversion 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: thuth@redhat.com, Cornelia Huck , david@redhat.com, Farhan Ali , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Farhan Ali Virtio GPU code currently only supports litte endian format, and so using the Virtio GPU device on a big endian machine does not work. Let's fix it by supporting the correct host cpu byte order. Signed-off-by: Farhan Ali Message-Id: Reviewed-by: Gerd Hoffmann Signed-off-by: Cornelia Huck --- hw/display/virtio-gpu.c | 70 +++++++++++++++++++++++++++++++++++++++++++--= ---- 1 file changed, 62 insertions(+), 8 deletions(-) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 622ee300f9..3a8f1e1a2d 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -30,6 +30,48 @@ virtio_gpu_find_resource(VirtIOGPU *g, uint32_t resource= _id); =20 static void virtio_gpu_cleanup_mapping(struct virtio_gpu_simple_resource *= res); =20 +static void +virtio_gpu_ctrl_hdr_bswap(struct virtio_gpu_ctrl_hdr *hdr) +{ + le32_to_cpus(&hdr->type); + le32_to_cpus(&hdr->flags); + le64_to_cpus(&hdr->fence_id); + le32_to_cpus(&hdr->ctx_id); + le32_to_cpus(&hdr->padding); +} + +static void virtio_gpu_bswap_32(void *ptr, + size_t size) +{ +#ifdef HOST_WORDS_BIGENDIAN + + size_t i; + struct virtio_gpu_ctrl_hdr *hdr =3D (struct virtio_gpu_ctrl_hdr *) ptr; + + virtio_gpu_ctrl_hdr_bswap(hdr); + + i =3D sizeof(struct virtio_gpu_ctrl_hdr); + while (i < size) { + le32_to_cpus((uint32_t *)(ptr + i)); + i =3D i + sizeof(uint32_t); + } + +#endif +} + +static void +virtio_gpu_t2d_bswap(struct virtio_gpu_transfer_to_host_2d *t2d) +{ + virtio_gpu_ctrl_hdr_bswap(&t2d->hdr); + le32_to_cpus(&t2d->r.x); + le32_to_cpus(&t2d->r.y); + le32_to_cpus(&t2d->r.width); + le32_to_cpus(&t2d->r.height); + le64_to_cpus(&t2d->offset); + le32_to_cpus(&t2d->resource_id); + le32_to_cpus(&t2d->padding); +} + #ifdef CONFIG_VIRGL #include #define VIRGL(_g, _virgl, _simple, ...) \ @@ -205,6 +247,7 @@ void virtio_gpu_ctrl_response(VirtIOGPU *g, resp->fence_id =3D cmd->cmd_hdr.fence_id; resp->ctx_id =3D cmd->cmd_hdr.ctx_id; } + virtio_gpu_ctrl_hdr_bswap(resp); s =3D iov_from_buf(cmd->elem.in_sg, cmd->elem.in_num, 0, resp, resp_le= n); if (s !=3D resp_len) { qemu_log_mask(LOG_GUEST_ERROR, @@ -236,8 +279,8 @@ virtio_gpu_fill_display_info(VirtIOGPU *g, for (i =3D 0; i < g->conf.max_outputs; i++) { if (g->enabled_output_bitmask & (1 << i)) { dpy_info->pmodes[i].enabled =3D 1; - dpy_info->pmodes[i].r.width =3D g->req_state[i].width; - dpy_info->pmodes[i].r.height =3D g->req_state[i].height; + dpy_info->pmodes[i].r.width =3D cpu_to_le32(g->req_state[i].wi= dth); + dpy_info->pmodes[i].r.height =3D cpu_to_le32(g->req_state[i].h= eight); } } } @@ -287,6 +330,7 @@ static void virtio_gpu_resource_create_2d(VirtIOGPU *g, struct virtio_gpu_resource_create_2d c2d; =20 VIRTIO_GPU_FILL_CMD(c2d); + virtio_gpu_bswap_32(&c2d, sizeof(c2d)); trace_virtio_gpu_cmd_res_create_2d(c2d.resource_id, c2d.format, c2d.width, c2d.height); =20 @@ -360,6 +404,7 @@ static void virtio_gpu_resource_unref(VirtIOGPU *g, struct virtio_gpu_resource_unref unref; =20 VIRTIO_GPU_FILL_CMD(unref); + virtio_gpu_bswap_32(&unref, sizeof(unref)); trace_virtio_gpu_cmd_res_unref(unref.resource_id); =20 res =3D virtio_gpu_find_resource(g, unref.resource_id); @@ -383,6 +428,7 @@ static void virtio_gpu_transfer_to_host_2d(VirtIOGPU *g, struct virtio_gpu_transfer_to_host_2d t2d; =20 VIRTIO_GPU_FILL_CMD(t2d); + virtio_gpu_t2d_bswap(&t2d); trace_virtio_gpu_cmd_res_xfer_toh_2d(t2d.resource_id); =20 res =3D virtio_gpu_find_resource(g, t2d.resource_id); @@ -439,6 +485,7 @@ static void virtio_gpu_resource_flush(VirtIOGPU *g, int i; =20 VIRTIO_GPU_FILL_CMD(rf); + virtio_gpu_bswap_32(&rf, sizeof(rf)); trace_virtio_gpu_cmd_res_flush(rf.resource_id, rf.r.width, rf.r.height, rf.r.x, rf.r.y= ); =20 @@ -511,6 +558,7 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g, struct virtio_gpu_set_scanout ss; =20 VIRTIO_GPU_FILL_CMD(ss); + virtio_gpu_bswap_32(&ss, sizeof(ss)); trace_virtio_gpu_cmd_set_scanout(ss.scanout_id, ss.resource_id, ss.r.width, ss.r.height, ss.r.x, ss.r= .y); =20 @@ -633,13 +681,15 @@ int virtio_gpu_create_mapping_iov(struct virtio_gpu_r= esource_attach_backing *ab, *addr =3D g_malloc0(sizeof(uint64_t) * ab->nr_entries); } for (i =3D 0; i < ab->nr_entries; i++) { - hwaddr len =3D ents[i].length; - (*iov)[i].iov_len =3D ents[i].length; - (*iov)[i].iov_base =3D cpu_physical_memory_map(ents[i].addr, &len,= 1); + uint64_t a =3D le64_to_cpu(ents[i].addr); + uint32_t l =3D le32_to_cpu(ents[i].length); + hwaddr len =3D l; + (*iov)[i].iov_len =3D l; + (*iov)[i].iov_base =3D cpu_physical_memory_map(a, &len, 1); if (addr) { - (*addr)[i] =3D ents[i].addr; + (*addr)[i] =3D a; } - if (!(*iov)[i].iov_base || len !=3D ents[i].length) { + if (!(*iov)[i].iov_base || len !=3D l) { qemu_log_mask(LOG_GUEST_ERROR, "%s: failed to map MMIO memory = for" " resource %d element %d\n", __func__, ab->resource_id, i); @@ -686,6 +736,7 @@ virtio_gpu_resource_attach_backing(VirtIOGPU *g, int ret; =20 VIRTIO_GPU_FILL_CMD(ab); + virtio_gpu_bswap_32(&ab, sizeof(ab)); trace_virtio_gpu_cmd_res_back_attach(ab.resource_id); =20 res =3D virtio_gpu_find_resource(g, ab.resource_id); @@ -718,6 +769,7 @@ virtio_gpu_resource_detach_backing(VirtIOGPU *g, struct virtio_gpu_resource_detach_backing detach; =20 VIRTIO_GPU_FILL_CMD(detach); + virtio_gpu_bswap_32(&detach, sizeof(detach)); trace_virtio_gpu_cmd_res_back_detach(detach.resource_id); =20 res =3D virtio_gpu_find_resource(g, detach.resource_id); @@ -734,6 +786,7 @@ static void virtio_gpu_simple_process_cmd(VirtIOGPU *g, struct virtio_gpu_ctrl_command *= cmd) { VIRTIO_GPU_FILL_CMD(cmd->cmd_hdr); + virtio_gpu_ctrl_hdr_bswap(&cmd->cmd_hdr); =20 switch (cmd->cmd_hdr.type) { case VIRTIO_GPU_CMD_GET_DISPLAY_INFO: @@ -879,6 +932,7 @@ static void virtio_gpu_handle_cursor(VirtIODevice *vdev= , VirtQueue *vq) "%s: cursor size incorrect %zu vs %zu\n", __func__, s, sizeof(cursor_info)); } else { + virtio_gpu_bswap_32(&cursor_info, sizeof(cursor_info)); update_cursor(g, &cursor_info); } virtqueue_push(vq, elem, 0); @@ -1135,7 +1189,7 @@ static void virtio_gpu_device_realize(DeviceState *qd= ev, Error **errp) } =20 g->config_size =3D sizeof(struct virtio_gpu_config); - g->virtio_config.num_scanouts =3D g->conf.max_outputs; + g->virtio_config.num_scanouts =3D cpu_to_le32(g->conf.max_outputs); virtio_init(VIRTIO_DEVICE(g), "virtio-gpu", VIRTIO_ID_GPU, g->config_size); =20 --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505841059357787.73848254168; Tue, 19 Sep 2017 10:10:59 -0700 (PDT) Received: from localhost ([::1]:44199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duM30-00047Q-GZ for importer@patchew.org; Tue, 19 Sep 2017 13:10:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLfQ-0007tc-D9 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLfP-0004Ui-FN for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45570) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLfP-0004U6-87 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:35 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C0173A260; Tue, 19 Sep 2017 16:46:34 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1DDB2610B0; Tue, 19 Sep 2017 16:46:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4C0173A260 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:36 +0200 Message-Id: <20170919164337.18555-38-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Sep 2017 16:46:34 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 37/38] virtio-ccw: Create a virtio gpu device for the ccw bus 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: thuth@redhat.com, Cornelia Huck , david@redhat.com, Farhan Ali , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Farhan Ali Wire up the virtio-gpu device for the CCW bus. The virtio-gpu is a virtio-1 device, so disable revision 0. Signed-off-by: Farhan Ali Acked-by: Christian Borntraeger Reviewed-by: Halil Pasic Reviewed-by: Thomas Huth Message-Id: <6c53f939cf2d64b66d2a6878b29c9bf3820f3d5b.1505485574.git.alifm@= linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++= ++ hw/s390x/virtio-ccw.h | 10 ++++++++++ 2 files changed, 59 insertions(+) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 2262b0cc9a..ff1bb1534c 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -1005,6 +1005,15 @@ static void virtio_ccw_crypto_realize(VirtioCcwDevic= e *ccw_dev, Error **errp) NULL); } =20 +static void virtio_ccw_gpu_realize(VirtioCcwDevice *ccw_dev, Error **errp) +{ + VirtIOGPUCcw *dev =3D VIRTIO_GPU_CCW(ccw_dev); + DeviceState *vdev =3D DEVICE(&dev->vdev); + + qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus)); + object_property_set_bool(OBJECT(vdev), true, "realized", errp); +} + /* DeviceState to VirtioCcwDevice. Note: used on datapath, * be careful and test performance if you change this. */ @@ -1614,6 +1623,45 @@ static const TypeInfo virtio_ccw_crypto =3D { .class_init =3D virtio_ccw_crypto_class_init, }; =20 +static Property virtio_ccw_gpu_properties[] =3D { + DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, + VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), + DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, + VIRTIO_CCW_MAX_REV), + DEFINE_PROP_END_OF_LIST(), +}; + +static void virtio_ccw_gpu_instance_init(Object *obj) +{ + VirtIOGPUCcw *dev =3D VIRTIO_GPU_CCW(obj); + VirtioCcwDevice *ccw_dev =3D VIRTIO_CCW_DEVICE(obj); + + ccw_dev->force_revision_1 =3D true; + virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev), + TYPE_VIRTIO_GPU); +} + +static void virtio_ccw_gpu_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + VirtIOCCWDeviceClass *k =3D VIRTIO_CCW_DEVICE_CLASS(klass); + + k->realize =3D virtio_ccw_gpu_realize; + k->exit =3D virtio_ccw_exit; + dc->reset =3D virtio_ccw_reset; + dc->props =3D virtio_ccw_gpu_properties; + dc->hotpluggable =3D false; + set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); +} + +static const TypeInfo virtio_ccw_gpu =3D { + .name =3D TYPE_VIRTIO_GPU_CCW, + .parent =3D TYPE_VIRTIO_CCW_DEVICE, + .instance_size =3D sizeof(VirtIOGPUCcw), + .instance_init =3D virtio_ccw_gpu_instance_init, + .class_init =3D virtio_ccw_gpu_class_init, +}; + static void virtio_ccw_busdev_realize(DeviceState *dev, Error **errp) { VirtioCcwDevice *_dev =3D (VirtioCcwDevice *)dev; @@ -1813,6 +1861,7 @@ static void virtio_ccw_register(void) type_register_static(&vhost_vsock_ccw_info); #endif type_register_static(&virtio_ccw_crypto); + type_register_static(&virtio_ccw_gpu); } =20 type_init(virtio_ccw_register) diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h index 41d4010378..541fdd2994 100644 --- a/hw/s390x/virtio-ccw.h +++ b/hw/s390x/virtio-ccw.h @@ -27,6 +27,7 @@ #ifdef CONFIG_VHOST_VSOCK #include "hw/virtio/vhost-vsock.h" #endif /* CONFIG_VHOST_VSOCK */ +#include "hw/virtio/virtio-gpu.h" =20 #include "hw/s390x/s390_flic.h" #include "hw/s390x/css.h" @@ -223,4 +224,13 @@ typedef struct VHostVSockCCWState { =20 #endif /* CONFIG_VHOST_VSOCK */ =20 +#define TYPE_VIRTIO_GPU_CCW "virtio-gpu-ccw" +#define VIRTIO_GPU_CCW(obj) \ + OBJECT_CHECK(VirtIOGPUCcw, (obj), TYPE_VIRTIO_GPU_CCW) + +typedef struct VirtIOGPUCcw { + VirtioCcwDevice parent_obj; + VirtIOGPU vdev; +} VirtIOGPUCcw; + #endif --=20 2.13.5 From nobody Sat May 4 14:01:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505841122012957.8116993771863; Tue, 19 Sep 2017 10:12:02 -0700 (PDT) Received: from localhost ([::1]:44202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duM41-00050F-5G for importer@patchew.org; Tue, 19 Sep 2017 13:12:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLfW-00082k-Vo for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLfU-0004Z8-Kq for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54888) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLfU-0004YV-F9 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:46:40 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 789604FD; Tue, 19 Sep 2017 16:46:39 +0000 (UTC) Received: from localhost (unknown [10.36.117.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D33E600C2; Tue, 19 Sep 2017 16:46:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 789604FD Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Tue, 19 Sep 2017 18:43:37 +0200 Message-Id: <20170919164337.18555-39-cohuck@redhat.com> In-Reply-To: <20170919164337.18555-1-cohuck@redhat.com> References: <20170919164337.18555-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 19 Sep 2017 16:46:39 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 38/38] MAINTAINERS/s390x: add terminal3270.c 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Christian Borntraeger Signed-off-by: Christian Borntraeger Acked-by: Halil Pasic Message-Id: <20170918130455.144262-1-borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index ef7c191dbb..3d735979ef 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -789,6 +789,7 @@ M: Christian Borntraeger M: Alexander Graf S: Supported F: hw/char/sclp*.[hc] +F: hw/char/terminal3270.c F: hw/s390x/ F: include/hw/s390x/ F: pc-bios/s390-ccw/ --=20 2.13.5