various s390x patches (+some fixes)
The following changes since commit 7ec6a364916c0d1eba01128481e503a550a2b466:
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-09-19 15:44:07 +0100)
are available in the git repository at:
git://github.com/cohuck/qemu tags/s390x-20170919-v2
for you to fetch changes up to 9d1c4449218d8a2e98a6a11688b09b9137f25c1c:
MAINTAINERS/s390x: add terminal3270.c (2017-09-19 18:31:32 +0200)
----------------------------------------------------------------
Assorted s390x patches:
- introduce virtio-gpu-ccw, with virtio-gpu endian fixes
- lots of cleanup in the s390x code
- make device_add work for s390x cpus
- enable seccomp on s390x
- an ivshmem endian fix
- set the reserved DHCP client architecture id for netboot
- fixes in the css and pci support
----------------------------------------------------------------
Christian Borntraeger (1):
MAINTAINERS/s390x: add terminal3270.c
Cornelia Huck (1):
s390x/ccw: create s390 phb for compat reasons as well
David Hildenbrand (22):
exec,dump,i386,ppc,s390x: don't include exec/cpu-all.h explicitly
cpu: drop old comments describing members
s390x: get rid of s390-virtio.c
s390x: rename s390-virtio.h to s390-virtio-hcall.h
s390x: move s390_virtio_hypercall() to s390-virtio-hcall.h
s390x: move subsystem_reset() to s390-virtio-ccw.h target/s390x: move some s390x typedefs to cpu-qom.h
s390x: move sclp_service_call() to sclp.h target/s390x: use trigger_pgm_exception() in
s390_cpu_handle_mmu_fault()
target/s390x: use program_interrupt() in per_check_exception()
s390x: allow only 1 CPU with TCG
target/s390x: set cpu->id for linux user when realizing target/s390x: use "core-id" for cpu number/address/id handling target/s390x: rename next_cpu_id to next_core_id
s390x: print CPU definitions in sorted order
s390x: allow cpu hotplug via device_add
s390x: CPU hot unplug via device_del cannot work for now
s390x: implement query-hotpluggable-cpus
s390x: get rid of cpu_states and use possible_cpus instead
s390x: get rid of cpu_s390x_create()
s390x: generate sclp cpu information from possible_cpus
s390x: allow CPU hotplug in random core-id order
Farhan Ali (2):
virtio-gpu: Handle endian conversion
virtio-ccw: Create a virtio gpu device for the ccw bus
Halil Pasic (5):
s390x/css: fix cc handling for XSCH
s390x/css: drop data-check in interpretation
s390x/css: fix NULL handling for CCW addresses
s390x/css: remove unused error handling branch
virtio-ccw: remove stale comments on endianness
Thomas Huth (3):
tests: Enable the drive_del test also on s390x hw/misc/ivshmem: Fix ivshmem_recv_msg() to also work on big endian
systems
configure: Allow --enable-seccomp on s390x, too
Viktor Mihajlovski (1):
s390: set DHCP client architecure id for netboot
Yi Min Zhao (3):
s390x/pci: remove idx from msix msg data s390x/pci: fixup ind_offset of msix routing entry s390x/pci: add iommu replay callback
MAINTAINERS | 1 + configure | 2 +- dump.c | 1 - exec.c | 1 - hw/display/virtio-gpu.c | 70 +++++++++-- hw/misc/ivshmem.c | 2 +- hw/s390x/Makefile.objs | 1 - hw/s390x/css.c | 28 +---- hw/s390x/s390-pci-bus.c | 28 +++-- hw/s390x/s390-pci-bus.h | 2 + hw/s390x/s390-pci-inst.c | 24 ---- hw/s390x/s390-pci-stub.c | 3 +- hw/s390x/s390-virtio-ccw.c | 241 +++++++++++++++++++++++++++++++++++-- hw/s390x/s390-virtio-hcall.c | 2 +- hw/s390x/s390-virtio-hcall.h | 21 ++++ hw/s390x/s390-virtio.c | 203 ------------------------------- hw/s390x/s390-virtio.h | 35 ------ hw/s390x/sclp.c | 34 +++--- hw/s390x/virtio-ccw.c | 51 +++++++- hw/s390x/virtio-ccw.h | 10 ++ include/hw/s390x/s390-virtio-ccw.h | 2 + include/hw/s390x/sclp.h | 2 + include/qom/cpu.h | 6 +- pc-bios/s390-ccw/netboot.mak | 2 +- qapi-schema.json | 16 +++ 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 - target/s390x/cpu-qom.h | 7 +- target/s390x/cpu.c | 85 ++++--------- target/s390x/cpu.h | 13 +- target/s390x/cpu_models.c | 61 +++++++--- target/s390x/cpu_models.h | 8 +- target/s390x/diag.c | 1 + target/s390x/excp_helper.c | 5 +- target/s390x/helper.c | 47 +------- target/s390x/internal.h | 1 - target/s390x/kvm.c | 15 ++- target/s390x/misc_helper.c | 21 ++-- target/s390x/translate.c | 5 +- tests/Makefile.include | 3 +- tests/drive_del-test.c | 25 ++-- tests/libqos/virtio.c | 17 +++ tests/libqos/virtio.h | 3 + 46 files changed, 591 insertions(+), 519 deletions(-) create mode 100644 hw/s390x/s390-virtio-hcall.h delete mode 100644 hw/s390x/s390-virtio.c delete mode 100644 hw/s390x/s390-virtio.h
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 01/38] s390x/css: fix cc handling for XSCH
From: Halil Pasic <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/s390x/css.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
hw/s390x/css.c +5 -5
@@ -1276,16 +1276,16 @@ int css_do_xsch(SubchDev *sch) goto out; } +if (s->ctrl &SCSW_CTRL_MASK_STCTL ) { + ret = -EINPROGRESS ; + goto out; + } +if (!(s->ctrl &SCSW_CTRL_MASK_FCTL ) || ((s->ctrl &SCSW_CTRL_MASK_FCTL ) !=SCSW_FCTL_START_FUNC ) || (!(s->ctrl & (SCSW_ACTL_RESUME_PEND |SCSW_ACTL_START_PEND |SCSW_ACTL_SUSP ))) || (s->ctrl &SCSW_ACTL_SUBCH_ACTIVE )) { - ret = -EINPROGRESS ; - goto out; - } - -if (s->ctrl &SCSW_CTRL_MASK_STCTL ) { ret = -EBUSY ; goto out; }
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 02/38] tests: Enable the drive_del test also on s390x
In reply to Cornelia HuckFrom: Thomas Huth <[email protected]>
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.
Message-Id: <[email protected]>
--- 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(-)
tests/Makefile.include +2 -1
@@ -366,6 +366,7 @@ check-qtest-s390x-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF) check-qtest-s390x-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF) check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF) check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF) +check-qtest-s390x-y += tests/drive_del-test$(EXESUF) check-qtest-generic-y += tests/qom-test$(EXESUF) check-qtest-generic-y += 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-obj-y) tests/nvme-test$(EXESUF): tests/nvme-test.o tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o
tests/drive_del-test.c +16 -9
@@ -12,6 +12,7 @@#include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/virtio.h" static void drive_add (void ) {
@@ -65,14 +66,14 @@ static void test_after_failed_device_add(void)qtest_start ("-drive if=none,id=drive0" ); -/* 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 =qmp ("{'execute': 'device_add'," " 'arguments': {" -" 'driver': 'virtio-blk-pci'," +" 'driver': 'virtio-blk-%s'," " 'drive': 'drive0'" -"}}" ); +"}}" ,qvirtio_get_dev_type ());g_assert (response); error =qdict_get_qdict (response,"error" ); g_assert_cmpstr(qdict_get_try_str(error, "class"), ==, "GenericError");
@@ -82,7 +83,7 @@ static void test_after_failed_device_add(void)drive_del ();/* 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 ();
@@ -91,10 +92,14 @@ static void test_after_failed_device_add(void)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=none,id=drive0,file=null-co://,format=raw" -" -device virtio-scsi-pci" -" -device scsi-hd,drive=drive0,id=dev0" ); + args =g_strdup_printf ("-drive if=none,id=drive0,file=null-co://,format=raw" +" -device virtio-scsi-%s" +" -device scsi-hd,drive=drive0,id=dev0" , +qvirtio_get_dev_type ()); +qtest_start (args);/* * Delete the drive, and then the device
@@ -104,6 +109,7 @@ static void test_drive_del_device_del(void)device_del ();qtest_end (); +g_free (args); }int main (int argc,char **argv)
@@ -114,9 +120,10 @@ int main(int argc, char **argv)qtest_add_func ("/drive_del/without-dev" , test_drive_without_dev); -/* 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",
tests/libqos/virtio.c +17 -0
@@ -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 architecture. +*/ +const char *qvirtio_get_dev_type (void ) +{ +const char *arch =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" ; + } +}
tests/libqos/virtio.h +3 -0
@@ -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);void qvirtqueue_set_used_event (QVirtQueue *vq,uint16_t idx); + +const char *qvirtio_get_dev_type (void ); +#endif
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 03/38] s390x/pci: remove idx from msix msg data
In reply to Cornelia HuckFrom: Yi Min Zhao <[email protected]>
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.
Message-Id: <[email protected]>
--- 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(-)
hw/s390x/s390-pci-bus.c +5 -11
@@ -199,8 +199,8 @@ static S390PCIBusDevice *s390_pci_find_dev_by_uid(S390pciState *s, uint16_t uid)return NULL ; } -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;
@@ -465,19 +465,13 @@ static void s390_msi_ctrl_write(void *opaque, hwaddr addr, uint64_t data, unsigned int size) {S390PCIBusDevice *pbdev = opaque; -uint32_t idx = data >>ZPCI_MSI_VEC_BITS ;uint32_t vec = data &ZPCI_MSI_VEC_MASK ;uint64_t ind_bit;uint32_t sum_bit; -uint32_t e =0 ; -DPRINTF ("write_msix data 0x%" PRIx64" idx %d vec 0x%x\n" , data, idx, vec); - -if (!pbdev) { - e |= (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);if (pbdev->state !=ZPCI_FS_ENABLED ) {return ;
hw/s390x/s390-pci-bus.h +2 -0
@@ -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);
hw/s390x/s390-pci-inst.c +0 -24
@@ -413,29 +413,6 @@ int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)return 0 ; } -static void update_msix_table_msg_data (S390PCIBusDevice *pbdev,uint64_t offset, -uint64_t *data,uint8_t len) -{ -uint32_t val; -uint8_t *msg_data; - -if (offset %PCI_MSIX_ENTRY_SIZE !=8 ) { -return ; - } - -if (len !=4 ) { -DPRINTF ("access msix table msg data but len is %d\n" , len); -return ; - } - - msg_data = (uint8_t *)data - offset %PCI_MSIX_ENTRY_SIZE + -PCI_MSIX_ENTRY_VECTOR_CTRL ; - val =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 pcias) { if (pbdev->msix.available && pbdev->msix.table_bar == pcias &&
@@ -508,7 +485,6 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)if (trap_msix (pbdev, offset, pcias)) { offset = offset - pbdev->msix.table_offset; mr = &pbdev->pdev->msix_table_mmio; -update_msix_table_msg_data (pbdev, offset, &data, len); }else { mr = pbdev->pdev->io_regions[pcias].memory; }
hw/s390x/s390-pci-stub.c +2 -1
@@ -70,7 +70,8 @@ S390pciState *s390_get_phb(void)return NULL ; } -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 ; }
target/s390x/kvm.c +7 -3
@@ -2423,12 +2423,16 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route, uint64_t address, uint32_t data, PCIDevice *dev) { S390PCIBusDevice *pbdev; -uint32_t idx = data >>ZPCI_MSI_VEC_BITS ;uint32_t vec = data &ZPCI_MSI_VEC_MASK ; - pbdev =s390_pci_find_dev_by_idx (s390_get_phb (), idx); +if (!dev) { +DPRINTF ("add_msi_route no pci device\n" ); +return -ENODEV ; + } + + pbdev =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 ; }
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 04/38] s390x/pci: fixup ind_offset of msix routing entry
In reply to Cornelia HuckFrom: Yi Min Zhao <[email protected]>
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.
Message-Id: <[email protected]>
--- target/s390x/kvm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
target/s390x/kvm.c +1 -3
@@ -2436,14 +2436,12 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,return -ENODEV ; } - pbdev->routes.adapter.ind_offset = vec; - route->type =KVM_IRQ_ROUTING_S390_ADAPTER ; route->flags =0 ; route->u.adapter.summary_addr = pbdev->routes.adapter.summary_addr; route->u.adapter.ind_addr = pbdev->routes.adapter.ind_addr; route->u.adapter.summary_offset = pbdev->routes.adapter.summary_offset; - route->u.adapter.ind_offset = pbdev->routes.adapter.ind_offset; + route->u.adapter.ind_offset = pbdev->routes.adapter.ind_offset + vec; route->u.adapter.adapter_id = pbdev->routes.adapter.adapter_id;return 0 ; }
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 05/38] s390x/pci: add iommu replay callback
In reply to Cornelia HuckFrom: Yi Min Zhao <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/s390x/s390-pci-bus.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
hw/s390x/s390-pci-bus.c +12 -0
@@ -397,6 +397,17 @@ static IOMMUTLBEntry s390_translate_iommu(IOMMUMemoryRegion *mr, hwaddr addr,return ret; } +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 per +* 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(ObjectClass *klass, void *data)IOMMUMemoryRegionClass *imrc =IOMMU_MEMORY_REGION_CLASS (klass); imrc->translate = s390_translate_iommu; + imrc->replay = s390_pci_iommu_replay; }static const TypeInfo s390_iommu_memory_region_info = {
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 06/38] hw/misc/ivshmem: Fix ivshmem_recv_msg() to also work on big endian systems
In reply to Cornelia HuckFrom: Thomas Huth <[email protected]>
The "slow" ivshmem-tests currently fail when they are running on a big endian host:
$ uname -m ppc64 $ V=1 QTEST_QEMU_BINARY=x86_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=chr0,vectors=2: server sent invalid ID 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().
Message-Id: <[email protected]>
--- hw/misc/ivshmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/ivshmem.c +1 -1
@@ -653,7 +653,7 @@ static int64_t ivshmem_recv_msg(IVShmemState *s, int *pfd, Error **errp) }while (n <sizeof (msg)); *pfd =qemu_chr_fe_get_msgfd (&s->server_chr); -return msg; +return le64_to_cpu (msg); }static void ivshmem_recv_setup (IVShmemState *s,Error **errp)
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 07/38] s390x/css: drop data-check in interpretation
In reply to Cornelia HuckFrom: Halil Pasic <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/s390x/css.c | 9 --------- 1 file changed, 9 deletions(-)
hw/s390x/css.c +0 -9
@@ -980,15 +980,6 @@ static void sch_handle_start_func_virtual(SubchDev *sch)SCSW_STCTL_ALERT |SCSW_STCTL_STATUS_PEND ; s->cpa = sch->channel_prog +8 ;break ; -case -EFAULT : -/* memory problem, generate channel data check */ - s->ctrl &= ~SCSW_ACTL_START_PEND ; - s->cstat =SCSW_CSTAT_DATA_CHECK ; - s->ctrl &= ~SCSW_CTRL_MASK_STCTL ; - s->ctrl |=SCSW_STCTL_PRIMARY |SCSW_STCTL_SECONDARY | -SCSW_STCTL_ALERT |SCSW_STCTL_STATUS_PEND ; - s->cpa = sch->channel_prog +8 ; -break ;case -EBUSY :/* subchannel busy, generate deferred cc 1 */ s->flags &= ~SCSW_FLAGS_MASK_CC ;
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 08/38] s390x/css: fix NULL handling for CCW addresses
In reply to Cornelia HuckFrom: Halil Pasic <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/s390x/css.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/css.c +1 -1
@@ -793,7 +793,7 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr,CCW1 ccw;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 )) {
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 09/38] s390x/css: remove unused error handling branch
In reply to Cornelia HuckFrom: Halil Pasic <[email protected]>
The case in question actually never happens. Let us get rid of the dead code.
Message-Id: <[email protected]>
--- hw/s390x/css.c | 7 ------- 1 file changed, 7 deletions(-)
hw/s390x/css.c +0 -7
@@ -980,13 +980,6 @@ static void sch_handle_start_func_virtual(SubchDev *sch)SCSW_STCTL_ALERT |SCSW_STCTL_STATUS_PEND ; s->cpa = sch->channel_prog +8 ;break ; -case -EBUSY : -/* subchannel busy, generate deferred cc 1 */ - s->flags &= ~SCSW_FLAGS_MASK_CC ; - s->flags |= (1 <<8 ); - s->ctrl &= ~SCSW_CTRL_MASK_STCTL ; - s->ctrl |=SCSW_STCTL_ALERT |SCSW_STCTL_STATUS_PEND ; -break ;case -EINPROGRESS :/* channel program has been suspended */ s->ctrl &= ~SCSW_ACTL_START_PEND ;
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 10/38] s390: set DHCP client architecure id for netboot
In reply to Cornelia HuckFrom: Viktor Mihajlovski <[email protected]>
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
Message-Id: <[email protected]>
--- pc-bios/s390-ccw/netboot.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pc-bios/s390-ccw/netboot.mak +1 -1
@@ -50,7 +50,7 @@ libc.a: $(LIBCOBJS) LIBNETOBJS := 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 := $(QEMU_CFLAGS) $(LIBC_INC) $(LIBNET_INC) +LIBNETCFLAGS := $(QEMU_CFLAGS) -DDHCPARCH=0x1F $(LIBC_INC) $(LIBNET_INC) %.o : $(SLOF_DIR)/lib/libnet/%.c $(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 11/38] exec, dump, i386, ppc, s390x: don't include exec/cpu-all.h explicitly
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
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.
Message-Id: <[email protected]>
--- 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(-)
dump.c +0 -1
@@ -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"
exec.c +0 -1
@@ -56,7 +56,6 @@#endif #endif -#include "exec/cpu-all.h" #include "qemu/rcu_queue.h" #include "qemu/main-loop.h" #include "translate-all.h"
target/i386/arch_dump.c +0 -1
@@ -13,7 +13,6 @@#include "qemu/osdep.h" #include "cpu.h" -#include "exec/cpu-all.h" #include "sysemu/dump.h" #include "elf.h" #include "sysemu/memory_mapping.h"
target/i386/arch_memory_mapping.c +0 -1
@@ -13,7 +13,6 @@#include "qemu/osdep.h" #include "cpu.h" -#include "exec/cpu-all.h" #include "sysemu/memory_mapping.h" /* PAE Paging or IA-32e Paging */
target/i386/svm_helper.c +0 -1
@@ -19,7 +19,6 @@#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"
target/ppc/arch_dump.c +0 -1
@@ -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"
target/s390x/arch_dump.c +0 -1
@@ -15,7 +15,6 @@#include "cpu.h" #include "internal.h" #include "elf.h" -#include "exec/cpu-all.h" #include "sysemu/dump.h"
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 12/38] cpu: drop old comments describing members
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
These comments are obviously stale.
Message-Id: <[email protected]>
--- include/qom/cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/qom/cpu.h +3 -3
@@ -388,10 +388,10 @@ struct CPUState {DECLARE_BITMAP (trace_dstate,CPU_TRACE_DSTATE_MAX_EVENTS );/* 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;/* shared by kvm, hax and hvf */ bool vcpu_dirty;
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 13/38] s390x: get rid of s390-virtio.c
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
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.
Message-Id: <[email protected]>
--- 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
hw/s390x/Makefile.objs +0 -1
@@ -1,4 +1,3 @@ -obj-y += s390-virtio.o obj-y += s390-virtio-hcall.o obj-y += sclp.o obj-y += event-facility.o
hw/s390x/s390-virtio-ccw.c +158 -1
200 lines not on this page · raw message
hw/s390x/s390-virtio.c deleted +0 -203
203 lines not on this page · raw message
hw/s390x/s390-virtio.h +0 -15
@@ -12,24 +12,9 @@#ifndef HW_S390_VIRTIO_H #define HW_S390_VIRTIO_H -#include "hw/nmi.h" #include "standard-headers/asm-s390/kvm_virtio.h" #include "standard-headers/asm-s390/virtio-ccw.h" 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
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 14/38] s390x: rename s390-virtio.h to s390-virtio-hcall.h
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
The only interface left, so let's properly rename it.
Message-Id: <[email protected]>
---
hw/s390x/s390-virtio-ccw.c | 2 +-
hw/s390x/s390-virtio-hcall.c | 2 +-
hw/s390x/{s390-virtio.h => s390-virtio-hcall.h} | 8 ++++----
3 files changed, 6 insertions(+), 6 deletions(-)
rename hw/s390x/{s390-virtio.h => s390-virtio-hcall.h} (77%)hw/s390x/s390-virtio-ccw.c +1 -1
@@ -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"
hw/s390x/s390-virtio-hcall.c +1 -1
@@ -11,7 +11,7 @@#include "qemu/osdep.h" #include "cpu.h" -#include "hw/s390x/s390-virtio.h" +#include "hw/s390x/s390-virtio-hcall.h" #define MAX_DIAG_SUBCODES 255
hw/s390x/s390-virtio-hcall.h renamed from hw/s390x/s390-virtio.h +4 -4
@@ -1,5 +1,5 @@/* -* Virtio interfaces for s390 +* Support for virtio hypercalls on s390x * * Copyright 2012 IBM Corp. * Author(s): Cornelia Huck <[email protected]>
@@ -9,12 +9,12 @@* directory. */ -#ifndef HW_S390_VIRTIO_H -#define HW_S390_VIRTIO_H +#ifndef HW_S390_VIRTIO_HCALL_H +#define HW_S390_VIRTIO_HCALL_H #include "standard-headers/asm-s390/kvm_virtio.h" #include "standard-headers/asm-s390/virtio-ccw.h" 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 */
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 15/38] s390x: move s390_virtio_hypercall() to s390-virtio-hcall.h
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
Implemented in hw/s390x/s390-virtio-hcall.c, so let's move it to the right header file.
Message-Id: <[email protected]>
--- 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(-)
hw/s390x/s390-virtio-hcall.h +1 -0
@@ -17,4 +17,5 @@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 */
target/s390x/cpu.h +0 -1
@@ -723,6 +723,5 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uint8_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);#endif
target/s390x/kvm.c +1 -0
@@ -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" #ifndef DEBUG_KVM #define DEBUG_KVM 0
target/s390x/misc_helper.c +1 -0
@@ -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 /* #define DEBUG_HELPER */
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 16/38] s390x: move subsystem_reset() to s390-virtio-ccw.h
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
Implemented in s390-virtio-ccw.c, so move it to the right header. We can also drop the extern. Fix up one include.
Message-Id: <[email protected]>
--- 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(-)
include/hw/s390x/s390-virtio-ccw.h +2 -0
@@ -56,4 +56,6 @@ bool gs_allowed(void);*/ bool css_migration_enabled (void ); +void subsystem_reset (void ); +#endif
target/s390x/cpu.h +0 -1
@@ -721,7 +721,6 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uint8_t ar, void *hostbuf,/* 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);#endif
target/s390x/diag.c +1 -0
@@ -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" static int modified_clear_reset (S390CPU *cpu) {
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 17/38] target/s390x: move some s390x typedefs to cpu-qom.h
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
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
Message-Id: <[email protected]>
--- target/s390x/cpu-qom.h | 5 ++++- target/s390x/cpu.h | 5 +++-- target/s390x/cpu_models.h | 8 ++++---- 3 files changed, 11 insertions(+), 7 deletions(-)
target/s390x/cpu-qom.h +4 -1
@@ -21,7 +21,6 @@#define QEMU_S390_CPU_QOM_H #include "qom/cpu.h" -#include "cpu_models.h" #define TYPE_S390_CPU "s390-cpu"
@@ -32,6 +31,9 @@#define S390_CPU_GET_CLASS (obj) \ OBJECT_GET_CLASS(S390CPUClass, (obj), TYPE_S390_CPU) +typedef struct S390CPUModel S390CPUModel ; +typedef struct S390CPUDef S390CPUDef ; +/** * S390CPUClass: * @parent_realize: The parent class' realize handler.
@@ -62,5 +64,6 @@ typedef struct S390CPUClass { } S390CPUClass;typedef struct S390CPU S390CPU ; +typedef struct CPUS390XState CPUS390XState ;#endif
target/s390x/cpu.h +3 -2
@@ -25,6 +25,7 @@#include "qemu-common.h" #include "cpu-qom.h" +#include "cpu_models.h" #define TARGET_LONG_BITS 64
@@ -80,7 +81,7 @@ typedef struct MchkQueue {uint16_t type; } MchkQueue; -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; -} CPUS390XState; +};static inline CPU_DoubleU *get_freg (CPUS390XState *cs,int nr) {
target/s390x/cpu_models.h +4 -4
@@ -17,7 +17,7 @@#include "qom/cpu.h" /* 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; +};/* 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; +};/* * CPU ID
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 18/38] s390x: move sclp_service_call() to sclp.h
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
Implemented in sclp.c, so let's move it to the right include file. Also adjust some includes.
Message-Id: <[email protected]>
--- include/hw/s390x/sclp.h | 2 ++ target/s390x/cpu.h | 1 - target/s390x/misc_helper.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
include/hw/s390x/sclp.h +2 -0
@@ -16,6 +16,7 @@#include "hw/sysbus.h" #include "hw/qdev.h" +#include "target/s390x/cpu-qom.h" #define SCLP_CMD_CODE_MASK 0xffff00ff
@@ -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);#endif
target/s390x/cpu.h +0 -1
@@ -722,6 +722,5 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uint8_t ar, void *hostbuf,/* outside of target/s390x/ */ S390CPU *s390_cpu_addr2state (uint16_t cpu_addr); -int sclp_service_call (CPUS390XState *env,uint64_t sccb,uint32_t code);#endif
target/s390x/misc_helper.c +1 -0
@@ -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 /* #define DEBUG_HELPER */
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 19/38] target/s390x: use trigger_pgm_exception() in s390_cpu_handle_mmu_fault()
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
This looks cleaner. linux-user will not use the ilen field, so setting it doesn't do any harm.
Message-Id: <[email protected]>
--- target/s390x/excp_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
target/s390x/excp_helper.c +1 -2
@@ -59,8 +59,7 @@ int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr address, {S390CPU *cpu =S390_CPU (cs); - cs->exception_index =EXCP_PGM ; - cpu->env.int_pgm_code =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 = address;
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 20/38] target/s390x: use program_interrupt() in per_check_exception()
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
Clean it up by reusing program_interrupt(). Add a concern regarding ilen.
Message-Id: <[email protected]>
--- target/s390x/misc_helper.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
target/s390x/misc_helper.c +9 -6
@@ -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 =CPU (s390_env_get_cpu (env)); +uint32_t ilen;if (env->per_perc_atmid) { - env->int_pgm_code =PGM_PER ; - env->int_pgm_ilen =get_ilen (cpu_ldub_code (env, env->per_address)); - - cs->exception_index =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 =get_ilen (cpu_ldub_code (env, env->per_address)); +program_interrupt (env,PGM_PER , ilen); } }
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 21/38] s390x: allow only 1 CPU with TCG
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/s390x/s390-virtio-ccw.c | 6 ++++++ 1 file changed, 6 insertions(+)
hw/s390x/s390-virtio-ccw.c +6 -0
@@ -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 ==NULL ) { machine->cpu_model =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 ); + } cpu_states = g_new0(S390CPU *, max_cpus);
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 22/38] target/s390x: set cpu->id for linux user when realizing
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
scc->next_cpu_id is updated when realizing. Setting it just before that point looks cleaner.
Message-Id: <[email protected]>
--- target/s390x/cpu.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
target/s390x/cpu.c +4 -7
@@ -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 = 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 = true;s390x_translate_init (); } - -#if defined(CONFIG_USER_ONLY ) - { -S390CPUClass *scc =S390_CPU_GET_CLASS (obj); - cpu->id = scc->next_cpu_id; - } -#endif }static void s390_cpu_finalize (Object *obj)
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 23/38] target/s390x: use "core-id" for cpu number/address/id handling
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
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=cpu2,core-id=2".
Message-Id: <[email protected]>
--- 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(-)
hw/s390x/s390-virtio-ccw.c +1 -1
@@ -312,7 +312,7 @@ static void s390_cpu_plug(HotplugHandler *hotplug_dev,S390CPU *cpu =S390_CPU (dev);CPUState *cs =CPU (dev); - name =g_strdup_printf ("cpu[%i]" , cpu->env.cpu_num); + name =g_strdup_printf ("cpu[%i]" , cpu->env.core_id);object_property_set_link (OBJECT (hotplug_dev),OBJECT (cs), name, errp);g_free (name);
target/s390x/cpu.c +20 -52
126 lines not on this page · raw message
target/s390x/cpu.h +2 -3
@@ -150,7 +150,7 @@ struct CPUS390XState {CPU_COMMON - uint32_t cpu_num; + uint32_t core_id; /* PoP "CPU address", same as cpu_index */uint64_t cpuid;uint64_t tod_offset;
@@ -194,7 +194,6 @@ struct S390CPU {/*< public >*/ 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);/* 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 **errp);/* 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. */
target/s390x/cpu_models.c +1 -1
@@ -915,7 +915,7 @@ void s390_realize_cpu_model(CPUState *cs, Error **errp) cpu->env.cpuid =s390_cpuid_from_cpu_model (cpu->model);if (tcg_enabled ()) {/* basic mode, write the cpu address into the first 4 bit of the ID */ - cpu->env.cpuid =deposit64 (cpu->env.cpuid,54 ,4 , cpu->env.cpu_num); + cpu->env.cpuid =deposit64 (cpu->env.cpuid,54 ,4 , cpu->env.core_id); } }
target/s390x/excp_helper.c +1 -1
@@ -250,7 +250,7 @@ static void do_ext_interrupt(CPUS390XState *env) lowcore->ext_params2 =cpu_to_be64 (q->param64); lowcore->external_old_psw.mask =cpu_to_be64 (get_psw_mask (env)); lowcore->external_old_psw.addr =cpu_to_be64 (env->psw.addr); - lowcore->cpu_addr =cpu_to_be16 (env->cpu_num |VIRTIO_SUBCODE_64 ); + lowcore->cpu_addr =cpu_to_be16 (env->core_id |VIRTIO_SUBCODE_64 ); mask =be64_to_cpu (lowcore->external_new_psw.mask); addr =be64_to_cpu (lowcore->external_new_psw.addr);
target/s390x/helper.c +2 -2
@@ -104,7 +104,7 @@ S390CPU *cpu_s390x_create(const char *cpu_model, Error **errp)return S390_CPU (CPU (object_new (typename))); } -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 **errp) {S390CPU *cpu;Error *err =NULL ;
@@ -114,7 +114,7 @@ S390CPU *s390x_new_cpu(const char *cpu_model, int64_t id, Error **errp) goto out; } -object_property_set_int (OBJECT (cpu), id,"id" , &err); +object_property_set_int (OBJECT (cpu), core_id,"core-id" , &err);if (err !=NULL ) { goto out; }
target/s390x/misc_helper.c +2 -2
@@ -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 ==2 ) && (sel2 ==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 ==2 ) && (sel2 ==2 )) {
target/s390x/translate.c +1 -4
@@ -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 != 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 ; }
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 24/38] target/s390x: rename next_cpu_id to next_core_id
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
Adapt to the new term "core_id". While at it, fix the type and drop the initialization to 0 (which is superfluous).
Message-Id: <[email protected]>
--- target/s390x/cpu-qom.h | 2 +- target/s390x/cpu.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-)
target/s390x/cpu-qom.h +1 -1
@@ -54,7 +54,7 @@ typedef struct S390CPUClass {bool is_migration_safe;const char *desc; -int64_t next_cpu_id; +uint32_t next_core_id;DeviceRealize parent_realize;void (*parent_reset)(CPUState *cpu);
target/s390x/cpu.c +5 -6
@@ -198,7 +198,7 @@ static void s390_cpu_realizefn(DeviceState *dev, Error **errp) }#else /* implicitly set for linux-user only */ - cpu->env.core_id = scc->next_cpu_id; + cpu->env.core_id = scc->next_core_id;#endif if (cpu_exists (cpu->env.core_id)) {
@@ -206,10 +206,10 @@ static void s390_cpu_realizefn(DeviceState *dev, Error **errp) ", it already exists", cpu->env.core_id); goto out; } -if (cpu->env.core_id != scc->next_cpu_id) { +if (cpu->env.core_id != scc->next_core_id) {error_setg (&err,"Unable to add CPU with core-id: %" PRIu32 -", the next available core-id is %" PRIi64, cpu->env.core_id, - scc->next_cpu_id); +", the next available core-id is %" PRIu32, cpu->env.core_id, + scc->next_core_id); goto out; }
@@ -219,7 +219,7 @@ static void s390_cpu_realizefn(DeviceState *dev, Error **errp)if (err !=NULL ) { goto out; } - scc->next_cpu_id++; + scc->next_core_id++;#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 =CPU_CLASS (scc);DeviceClass *dc =DEVICE_CLASS (oc); - scc->next_cpu_id =0 ; scc->parent_realize = dc->realize; dc->realize = s390_cpu_realizefn; dc->props = s390x_cpu_properties;
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 25/38] s390x: print CPU definitions in sorted order
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
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.
Message-Id: <[email protected]>
--- target/s390x/cpu_models.c | 56 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 15 deletions(-)
target/s390x/cpu_models.c +41 -15
@@ -270,16 +270,11 @@ const S390CPUDef *s390_find_cpu_def(uint16_t type, uint8_t gen, uint8_t ec_ga,return last_compatible; } -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_data) { -struct S390PrintCpuListInfo *info = opaque; -S390CPUClass *scc =S390_CPU_CLASS (klass); -char *name =g_strdup (object_class_get_name (klass)); +CPUListState *s = user_data; +const S390CPUClass *scc =S390_CPU_CLASS ((ObjectClass *)data); +char *name =g_strdup (object_class_get_name ((ObjectClass *)data));const char *details ="" ;if (scc->is_static) {
@@ -290,21 +285,52 @@ static void print_cpu_model_list(ObjectClass *klass, void *opaque)/* strip off the -s390-cpu */ g_strrstr (name,"-" TYPE_S390_CPU )[0 ] =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); } +static gint s390_cpu_list_compare (gconstpointer a,gconstpointer b) +{ +const S390CPUClass *cc_a =S390_CPU_CLASS ((ObjectClass *)a); +const S390CPUClass *cc_b =S390_CPU_CLASS ((ObjectClass *)b); +const char *name_a =object_class_get_name ((ObjectClass *)a); +const char *name_b =object_class_get_name ((ObjectClass *)b); + +/* move qemu and host to the top of the list, qemu first, host second */ +if (name_a[0 ] =='q' ) { +return -1 ; + }else if (name_b[0 ] =='q' ) { +return 1 ; + }else if (name_a[0 ] =='h' ) { +return -1 ; + }else if (name_b[0 ] =='h' ) { +return 1 ; + } + +/* keep the same order we have in our table (sorted by release date) */ +if (cc_a->cpu_def != 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 = { - .f = f, - .print = print, +CPUListState s = { + .file = f, + .cpu_fprintf = print, };S390FeatGroup group;S390Feat feat; +GSList *list; -object_class_foreach (print_cpu_model_list,TYPE_S390_CPU , false, &info); + list =object_class_get_list (TYPE_S390_CPU , false); + list =g_slist_sort (list, s390_cpu_list_compare); +g_slist_foreach (list, s390_print_cpu_model_list_entry, &s); +g_slist_free (list); (*print)(f,"\nRecognized feature flags:\n" );for (feat =0 ; feat <S390_FEAT_MAX ; feat++) {
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 26/38] s390x: allow cpu hotplug via device_add
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
E.g. the following now works:
device_add host-s390-cpu,id=cpu1,core-id=1
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 >= 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."
Message-Id: <[email protected]>
--- target/s390x/cpu.c | 1 + 1 file changed, 1 insertion(+)
target/s390x/cpu.c +1 -0
@@ -467,6 +467,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) scc->parent_realize = dc->realize; dc->realize = s390_cpu_realizefn; dc->props = s390x_cpu_properties; + dc->user_creatable = true; scc->parent_reset = cc->reset;#if !defined(CONFIG_USER_ONLY )
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 27/38] s390x: CPU hot unplug via device_del cannot work for now
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
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 cpu1device_del cpu1
CPU hot unplug not supported on this machine
Message-Id: <[email protected]>
--- hw/s390x/s390-virtio-ccw.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
hw/s390x/s390-virtio-ccw.c +10 -0
@@ -339,6 +339,15 @@ static void s390_machine_device_plug(HotplugHandler *hotplug_dev, } } +static void s390_machine_device_unplug_request (HotplugHandler *hotplug_dev, +DeviceState *dev,Error **errp) +{ +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, void *data) mc->max_cpus =248 ; mc->get_hotplug_handler = s390_get_hotplug_handler; hc->plug = s390_machine_device_plug; + hc->unplug_request = s390_machine_device_unplug_request; nc->nmi_monitor_handler = s390_nmi; }
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 28/38] s390x: implement query-hotpluggable-cpus
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
CPU hotplug is only possible on a per core basis on s390x. So let's add possible_cpus and wire everything up properly.
Message-Id: <[email protected]>
--- hw/s390x/s390-virtio-ccw.c | 41 +++++++++++++++++++++++++++++++++++++++++ qapi-schema.json | 16 ++++++++++++++++ 2 files changed, 57 insertions(+)
hw/s390x/s390-virtio-ccw.c +41 -0
@@ -50,6 +50,7 @@ S390CPU *s390_cpu_addr2state(uint16_t cpu_addr)static void s390_init_cpus (MachineState *machine) { +MachineClass *mc =MACHINE_GET_CLASS (machine);int i;gchar *name;
@@ -74,6 +75,9 @@ static void s390_init_cpus(MachineState *machine)g_free (name); } +/* initialize possible_cpus */ + mc->possible_cpu_arch_ids (machine); +for (i =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 =MACHINE (hotplug_dev);S390CPU *cpu =S390_CPU (dev);CPUState *cs =CPU (dev);
@@ -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 =OBJECT (dev); }static void s390_machine_reset (void )
@@ -348,6 +356,36 @@ static void s390_machine_device_unplug_request(HotplugHandler *hotplug_dev, } } +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 == max_cpus); +return ms->possible_cpus; + } + + ms->possible_cpus =g_malloc0 (sizeof (CPUArchIdList) + +sizeof (CPUArchId) * max_cpus); + ms->possible_cpus->len = max_cpus; +for (i =0 ; i < ms->possible_cpus->len; i++) { + ms->possible_cpus->cpus[i].vcpus_count =1 ; + ms->possible_cpus->cpus[i].arch_id = i; + ms->possible_cpus->cpus[i].props.has_core_id = true; + ms->possible_cpus->cpus[i].props.core_id = 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, void *data) mc->no_sdcard =1 ; mc->use_sclp =1 ; mc->max_cpus =248 ; + mc->has_hotpluggable_cpus = true; mc->get_hotplug_handler = s390_get_hotplug_handler; + mc->cpu_index_to_instance_props = s390_cpu_index_to_props; + mc->possible_cpu_arch_ids = s390_possible_cpu_arch_ids; hc->plug = s390_machine_device_plug; hc->unplug_request = s390_machine_device_unplug_request; nc->nmi_monitor_handler = s390_nmi;
qapi-schema.json +16 -0
@@ -3153,6 +3153,22 @@ # } # ]} # +# For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu +# (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'] }
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 29/38] s390x: get rid of cpu_states and use possible_cpus instead
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
Now that we have possible_cpus, we can get rid of the global variable and rewrite s390_cpu_addr2state() to use it.
Message-Id: <[email protected]>
--- hw/s390x/s390-virtio-ccw.c | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-)
hw/s390x/s390-virtio-ccw.c +10 -26
@@ -36,23 +36,26 @@#include "qapi/qmp/qerror.h" #include "hw/nmi.h" -static S390CPU **cpu_states; -S390CPU *s390_cpu_addr2state (uint16_t cpu_addr) { -if (cpu_addr >= max_cpus) { -return NULL ; +static MachineState *ms; + +if (!ms) { + ms =MACHINE (qdev_get_machine ()); +g_assert (ms->possible_cpus); } -/* Fast lookup via CPU ID */ -return cpu_states[cpu_addr]; +/* CPU address corresponds to the core_id and the index */ +if (cpu_addr >= ms->possible_cpus->len) { +return NULL ; + } +return S390_CPU (ms->possible_cpus->cpus[cpu_addr].cpu); }static void s390_init_cpus (MachineState *machine) {MachineClass *mc =MACHINE_GET_CLASS (machine);int i; -gchar *name;if (machine->cpu_model ==NULL ) { machine->cpu_model =s390_default_cpu_model_name ();
@@ -63,18 +66,6 @@ static void s390_init_cpus(MachineState *machine)exit (1 ); } - cpu_states = g_new0(S390CPU *, max_cpus); - -for (i =0 ; i < max_cpus; i++) { - name =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);
@@ -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 =MACHINE (hotplug_dev);S390CPU *cpu =S390_CPU (dev); -CPUState *cs =CPU (dev); - - name =g_strdup_printf ("cpu[%i]" , cpu->env.core_id); -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 =OBJECT (dev);
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 30/38] s390x: get rid of cpu_s390x_create()
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
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
Message-Id: <[email protected]>
--- 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(-)
hw/s390x/s390-virtio-ccw.c +27 -2
@@ -55,6 +55,10 @@ S390CPU *s390_cpu_addr2state(uint16_t cpu_addr)static void s390_init_cpus (MachineState *machine) {MachineClass *mc =MACHINE_GET_CLASS (machine); +const char *typename; +gchar **model_pieces; +ObjectClass *oc; +CPUClass *cc;int i;if (machine->cpu_model ==NULL ) {
@@ -69,8 +73,25 @@ static void s390_init_cpus(MachineState *machine)/* initialize possible_cpus */ mc->possible_cpu_arch_ids (machine); + model_pieces =g_strsplit (machine->cpu_model,"," ,2 ); +if (!model_pieces[0 ]) { +error_report ("Invalid/empty CPU model name" ); +exit (1 ); + } + + oc =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 =object_class_get_name (oc); + cc =CPU_CLASS (oc); +/* after parsing, properties will be applied to all *typename* instances */ + cc->parse_features (typename, model_pieces[1 ], &error_fatal); +g_strfreev (model_pieces); +for (i =0 ; i < smp_cpus; i++) { -s390x_new_cpu (machine->cpu_model, i, &error_fatal); +s390x_new_cpu (typename, i, &error_fatal); } }
@@ -382,8 +403,12 @@ static HotplugHandler *s390_get_hotplug_handler(MachineState *machine,static void s390_hot_add_cpu (const int64_t id,Error **errp) {MachineState *machine =MACHINE (qdev_get_machine ()); +ObjectClass *oc; + +g_assert (machine->possible_cpus->cpus[0 ].cpu); + oc =OBJECT_CLASS (CPU_GET_CLASS (machine->possible_cpus->cpus[0 ].cpu)); -s390x_new_cpu (machine->cpu_model, id, errp); +s390x_new_cpu (object_class_get_name (oc), id, errp); }static void s390_nmi (NMIState *n,int cpu_index,Error **errp)
target/s390x/cpu.h +1 -1
@@ -689,7 +689,7 @@ const char *s390_default_cpu_model_name(void);/* 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 **errp); +S390CPU *s390x_new_cpu (const char *typename,uint32_t core_id,Error **errp);/* 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. */
target/s390x/helper.c +2 -43
54 lines not on this page · raw message
target/s390x/internal.h +0 -1
@@ -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);
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 31/38] s390x: generate sclp cpu information from possible_cpus
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/s390x/sclp.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-)
hw/s390x/sclp.c +14 -20
@@ -34,16 +34,21 @@ static inline SCLPDevice *get_sclp_device(void)return sclp; } -static void prepare_cpu_entries (SCLPDevice *sclp,CPUEntry *entry,int count) +static void prepare_cpu_entries (SCLPDevice *sclp,CPUEntry *entry,int *count) { +MachineState *ms =MACHINE (qdev_get_machine ());uint8_t features[SCCB_CPU_FEATURE_LEN ] = {0 };int i;s390_get_feat_block (S390_FEAT_TYPE_SCLP_CPU , features); -for (i =0 ; i < count; i++) { - entry[i].address = i; - entry[i].type =0 ; -memcpy (entry[i].features, features,sizeof (entry[i].features)); +for (i =0 , *count =0 ; i < ms->possible_cpus->len; i++) { +if (!ms->possible_cpus->cpus[i].cpu) { +continue ; + } + entry[*count].address = ms->possible_cpus->cpus[i].arch_id; + entry[*count].type =0 ; +memcpy (entry[*count].features, features,sizeof (features)); + (*count)++; } }
@@ -53,17 +58,13 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)ReadInfo *read_info = (ReadInfo *) sccb;MachineState *machine =MACHINE (qdev_get_machine ());sclpMemoryHotplugDev *mhd =get_sclp_memory_hotplug_dev (); -CPUState *cpu; -int cpu_count =0 ; +int cpu_count;int rnsize, rnmax;int slots =MIN (machine->ram_slots,s390_get_memslot_count ());IplParameterBlock *ipib =s390_ipl_get_iplb (); -CPU_FOREACH (cpu) { - cpu_count++; - } -/* CPU information */ +prepare_cpu_entries (sclp, read_info->entries, &cpu_count); read_info->entries_cpu =cpu_to_be16 (cpu_count); read_info->offset_cpu =cpu_to_be16 (offsetof(ReadInfo , entries)); read_info->highest_cpu =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); -prepare_cpu_entries (sclp, read_info->entries, cpu_count); - read_info->facilities =cpu_to_be64 (SCLP_HAS_CPU_INFO |SCLP_HAS_IOA_RECONFIG );
@@ -333,13 +332,9 @@ static void unassign_storage(SCLPDevice *sclp, SCCB *sccb)static void sclp_read_cpu_info (SCLPDevice *sclp,SCCB *sccb) {ReadCpuInfo *cpu_info = (ReadCpuInfo *) sccb; -CPUState *cpu; -int cpu_count =0 ; - -CPU_FOREACH (cpu) { - cpu_count++; - } +int cpu_count; +prepare_cpu_entries (sclp, cpu_info->entries, &cpu_count); cpu_info->nr_configured =cpu_to_be16 (cpu_count); cpu_info->offset_configured =cpu_to_be16 (offsetof(ReadCpuInfo , entries)); cpu_info->nr_standby =cpu_to_be16 (0 );
@@ -348,7 +343,6 @@ static void sclp_read_cpu_info(SCLPDevice *sclp, SCCB *sccb) cpu_info->offset_standby =cpu_to_be16 (cpu_info->offset_configured + cpu_info->nr_configured*sizeof (CPUEntry)); -prepare_cpu_entries (sclp, cpu_info->entries, cpu_count); sccb->h.response_code =cpu_to_be16 (SCLP_RC_NORMAL_READ_COMPLETION ); }
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 32/38] s390x: allow CPU hotplug in random core-id order
In reply to Cornelia HuckFrom: David Hildenbrand <[email protected]>
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.
Message-Id: <[email protected]>
--- target/s390x/cpu.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
target/s390x/cpu.c +1 -7
@@ -199,6 +199,7 @@ static void s390_cpu_realizefn(DeviceState *dev, Error **errp)#else /* implicitly set for linux-user only */ cpu->env.core_id = scc->next_core_id; + scc->next_core_id++;#endif 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 != scc->next_core_id) { -error_setg (&err,"Unable to add CPU with core-id: %" PRIu32 -", the next available core-id is %" PRIu32, cpu->env.core_id, - scc->next_core_id); - goto out; - }/* sync cs->cpu_index and env->core_id. The latter is needed for TCG. */ cs->cpu_index = env->core_id;
@@ -219,7 +214,6 @@ static void s390_cpu_realizefn(DeviceState *dev, Error **errp)if (err !=NULL ) { goto out; } - scc->next_core_id++;#if !defined(CONFIG_USER_ONLY )qemu_register_reset (s390_cpu_machine_reset_cb, cpu);
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 33/38] virtio-ccw: remove stale comments on endianness
In reply to Cornelia HuckFrom: Halil Pasic <[email protected]>
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.
Message-Id: <[email protected]>
--- hw/s390x/virtio-ccw.c | 2 -- 1 file changed, 2 deletions(-)
hw/s390x/virtio-ccw.c +0 -2
@@ -487,7 +487,6 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) ret = -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 = ccw.count - len; ret =0 ;
@@ -510,7 +509,6 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) ret = -EFAULT ; }else { len = 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);
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 35/38] s390x/ccw: create s390 phb for compat reasons as well
In reply to Cornelia Huckd32bd032d8 ("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).
--- target/s390x/cpu_models.c | 3 +++ 1 file changed, 3 insertions(+)
target/s390x/cpu_models.c +3 -0
@@ -196,6 +196,9 @@ bool s390_has_feat(S390Feat feat) } }#endif +if (feat ==S390_FEAT_ZPCI ) { +return true; + }return 0 ; }return test_bit (feat, cpu->model->features);
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 34/38] configure: Allow --enable-seccomp on s390x, too
In reply to Cornelia HuckFrom: Thomas Huth <[email protected]>
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.
Message-Id: <[email protected]>
--- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
@@ -2025,7 +2025,7 @@ if test "$seccomp" != "no" ; then arm|aarch64) libseccomp_minver="2.2.3" ;; - ppc|ppc64) + ppc|ppc64|s390x) libseccomp_minver="2.3.0" ;; *)
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 36/38] virtio-gpu: Handle endian conversion
In reply to Cornelia HuckFrom: Farhan Ali <[email protected]>
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.
Message-Id: <dc748e15f36db808f90b4f2393bc29ba7556a9f6.1505485574.git.alifm@linux.vnet.ibm.com>
--- hw/display/virtio-gpu.c | 70 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 8 deletions(-)
hw/display/virtio-gpu.c +62 -8
@@ -30,6 +30,48 @@ virtio_gpu_find_resource(VirtIOGPU *g, uint32_t resource_id);static void virtio_gpu_cleanup_mapping (struct virtio_gpu_simple_resource *res); +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 = (struct virtio_gpu_ctrl_hdr *) ptr; + +virtio_gpu_ctrl_hdr_bswap (hdr); + + i =sizeof (struct virtio_gpu_ctrl_hdr ); +while (i < size) { +le32_to_cpus ((uint32_t *)(ptr + i)); + i = 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 <virglrenderer.h> #define VIRGL (_g, _virgl, _simple, ...) \
@@ -205,6 +247,7 @@ void virtio_gpu_ctrl_response(VirtIOGPU *g, resp->fence_id = cmd->cmd_hdr.fence_id; resp->ctx_id = cmd->cmd_hdr.ctx_id; } +virtio_gpu_ctrl_hdr_bswap (resp); s =iov_from_buf (cmd->elem.in_sg, cmd->elem.in_num,0 , resp, resp_len);if (s != resp_len) { qemu_log_mask(LOG_GUEST_ERROR,
@@ -236,8 +279,8 @@ virtio_gpu_fill_display_info(VirtIOGPU *g,for (i =0 ; i < g->conf.max_outputs; i++) {if (g->enabled_output_bitmask & (1 << i)) { dpy_info->pmodes[i].enabled =1 ; - dpy_info->pmodes[i].r.width = g->req_state[i].width; - dpy_info->pmodes[i].r.height = g->req_state[i].height; + dpy_info->pmodes[i].r.width =cpu_to_le32 (g->req_state[i].width); + dpy_info->pmodes[i].r.height =cpu_to_le32 (g->req_state[i].height); } } }
@@ -287,6 +330,7 @@ static void virtio_gpu_resource_create_2d(VirtIOGPU *g,struct virtio_gpu_resource_create_2d c2d;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);
@@ -360,6 +404,7 @@ static void virtio_gpu_resource_unref(VirtIOGPU *g,struct virtio_gpu_resource_unref unref;VIRTIO_GPU_FILL_CMD (unref); +virtio_gpu_bswap_32 (&unref,sizeof (unref));trace_virtio_gpu_cmd_res_unref (unref.resource_id); res =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;VIRTIO_GPU_FILL_CMD (t2d); +virtio_gpu_t2d_bswap (&t2d);trace_virtio_gpu_cmd_res_xfer_toh_2d (t2d.resource_id); res =virtio_gpu_find_resource (g, t2d.resource_id);
@@ -439,6 +485,7 @@ static void virtio_gpu_resource_flush(VirtIOGPU *g,int i;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);
@@ -511,6 +558,7 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g,struct virtio_gpu_set_scanout ss;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);
@@ -633,13 +681,15 @@ int virtio_gpu_create_mapping_iov(struct virtio_gpu_resource_attach_backing *ab, *addr =g_malloc0 (sizeof (uint64_t ) * ab->nr_entries); }for (i =0 ; i < ab->nr_entries; i++) { -hwaddr len = ents[i].length; - (*iov)[i].iov_len = ents[i].length; - (*iov)[i].iov_base =cpu_physical_memory_map (ents[i].addr, &len,1 ); +uint64_t a =le64_to_cpu (ents[i].addr); +uint32_t l =le32_to_cpu (ents[i].length); +hwaddr len = l; + (*iov)[i].iov_len = l; + (*iov)[i].iov_base =cpu_physical_memory_map (a, &len,1 );if (addr) { - (*addr)[i] = ents[i].addr; + (*addr)[i] = a; } -if (!(*iov)[i].iov_base || len != ents[i].length) { +if (!(*iov)[i].iov_base || len != 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;VIRTIO_GPU_FILL_CMD (ab); +virtio_gpu_bswap_32 (&ab,sizeof (ab));trace_virtio_gpu_cmd_res_back_attach (ab.resource_id); res =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;VIRTIO_GPU_FILL_CMD (detach); +virtio_gpu_bswap_32 (&detach,sizeof (detach));trace_virtio_gpu_cmd_res_back_detach (detach.resource_id); res =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);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 *qdev, Error **errp) } g->config_size =sizeof (struct virtio_gpu_config ); - g->virtio_config.num_scanouts = g->conf.max_outputs; + g->virtio_config.num_scanouts =cpu_to_le32 (g->conf.max_outputs);virtio_init (VIRTIO_DEVICE (g),"virtio-gpu" ,VIRTIO_ID_GPU , g->config_size);
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 37/38] virtio-ccw: Create a virtio gpu device for the ccw bus
In reply to Cornelia HuckFrom: Farhan Ali <[email protected]>
Wire up the virtio-gpu device for the CCW bus. The virtio-gpu is a virtio-1 device, so disable revision 0.
Message-Id: <6c53f939cf2d64b66d2a6878b29c9bf3820f3d5b.1505485574.git.alifm@linux.vnet.ibm.com>
--- hw/s390x/virtio-ccw.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ hw/s390x/virtio-ccw.h | 10 ++++++++++ 2 files changed, 59 insertions(+)
hw/s390x/virtio-ccw.c +49 -0
@@ -1005,6 +1005,15 @@ static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp) NULL); } +static void virtio_ccw_gpu_realize (VirtioCcwDevice *ccw_dev,Error **errp) +{ +VirtIOGPUCcw *dev =VIRTIO_GPU_CCW (ccw_dev); +DeviceState *vdev =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 = { .class_init = virtio_ccw_crypto_class_init, }; +static Property virtio_ccw_gpu_properties[] = { +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 =VIRTIO_GPU_CCW (obj); +VirtioCcwDevice *ccw_dev =VIRTIO_CCW_DEVICE (obj); + + ccw_dev->force_revision_1 = 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 =DEVICE_CLASS (klass); +VirtIOCCWDeviceClass *k =VIRTIO_CCW_DEVICE_CLASS (klass); + + k->realize = virtio_ccw_gpu_realize; + k->exit = virtio_ccw_exit; + dc->reset = virtio_ccw_reset; + dc->props = virtio_ccw_gpu_properties; + dc->hotpluggable = false; +set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); +} + +static const TypeInfo virtio_ccw_gpu = { + .name =TYPE_VIRTIO_GPU_CCW , + .parent =TYPE_VIRTIO_CCW_DEVICE , + .instance_size =sizeof (VirtIOGPUCcw), + .instance_init = virtio_ccw_gpu_instance_init, + .class_init = virtio_ccw_gpu_class_init, +}; +static void virtio_ccw_busdev_realize (DeviceState *dev,Error **errp) {VirtioCcwDevice *_dev = (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); }type_init (virtio_ccw_register)
hw/s390x/virtio-ccw.h +10 -0
@@ -27,6 +27,7 @@#ifdef CONFIG_VHOST_VSOCK #include "hw/virtio/vhost-vsock.h" #endif /* CONFIG_VHOST_VSOCK */ +#include "hw/virtio/virtio-gpu.h" #include "hw/s390x/s390_flic.h" #include "hw/s390x/css.h"
@@ -223,4 +224,13 @@ typedef struct VHostVSockCCWState {#endif /* CONFIG_VHOST_VSOCK */ +#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
Signature · 1 line
2.13.5
[Qemu-devel] [PULL v2 38/38] MAINTAINERS/s390x: add terminal3270.c
In reply to Cornelia HuckFrom: Christian Borntraeger <[email protected]>
Message-Id: <[email protected]>
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -789,6 +789,7 @@ M: Christian Borntraeger <[email protected]> M: Alexander Graf <[email protected]> S: Supported F: hw/char/sclp*.[hc] +F: hw/char/terminal3270.c F: hw/s390x/ F: include/hw/s390x/ F: pc-bios/s390-ccw/
Signature · 1 line
2.13.5
Quoted 22 lines · Cornelia Huck
The following changes since commit
7ec6a364916c0d1eba01128481e503a550a2b466:Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-09-19 15:44:07 +0100)
are available in the git repository at:
git://github.com/cohuck/qemutags/s390x-20170919-v2for you to fetch changes up to
9d1c4449218d8a2e98a6a11688b09b9137f25c1c:MAINTAINERS/s390x: add
terminal3270.c(2017-09-19 18:31:32 +0200)----------------------------------------------------------------
Assorted s390x patches:
- introduce virtio-gpu-ccw, with virtio-gpu endian fixes
- lots of cleanup in the s390x code
- makedevice_addwork for s390x cpus
- enable seccomp on s390x
- an ivshmem endian fix
- set the reserved DHCP client architecture id for netboot
- fixes in the css and pci support
Quoted 1 line
----------------------------------------------------------------
What happened to the indirect data access patches from Halil? Last time I checked you said "applied thanks"?
Peter Maydell
AppliedQuoted 12 lines · Cornelia Huck
The following changes since commit
7ec6a364916c0d1eba01128481e503a550a2b466:Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-09-19 15:44:07 +0100)
are available in the git repository at:
git://github.com/cohuck/qemutags/s390x-20170919-v2for you to fetch changes up to
9d1c4449218d8a2e98a6a11688b09b9137f25c1c:MAINTAINERS/s390x: add
terminal3270.c(2017-09-19 18:31:32 +0200)
Quoted 10 lines
----------------------------------------------------------------
Assorted s390x patches:
- introduce virtio-gpu-ccw, with virtio-gpu endian fixes
- lots of cleanup in the s390x code
- makedevice_addwork for s390x cpus
- enable seccomp on s390x
- an ivshmem endian fix
- set the reserved DHCP client architecture id for netboot
- fixes in the css and pci support
Applied, thanks.
-- PMM
Quoted 23 lines · On Tue, 19 Sep 2017 19:03:13 +0200 Christian Borntraeger…
Quoted 22 lines · Cornelia Huck
The following changes since commit
7ec6a364916c0d1eba01128481e503a550a2b466:Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-09-19 15:44:07 +0100)
are available in the git repository at:
git://github.com/cohuck/qemutags/s390x-20170919-v2for you to fetch changes up to
9d1c4449218d8a2e98a6a11688b09b9137f25c1c:MAINTAINERS/s390x: add
terminal3270.c(2017-09-19 18:31:32 +0200)----------------------------------------------------------------
Assorted s390x patches:
- introduce virtio-gpu-ccw, with virtio-gpu endian fixes
- lots of cleanup in the s390x code
- makedevice_addwork for s390x cpus
- enable seccomp on s390x
- an ivshmem endian fix
- set the reserved DHCP client architecture id for netboot
- fixes in the css and pci support
Quoted 5 lines
Quoted 1 line
----------------------------------------------------------------
What happened to the indirect data access patches from Halil? Last time I checked you said "applied thanks"?
I had dequeued them, as there was still way too much discussion on the patches. I expect Halil to send a v3 with the feedback addressed.
[Ah, I see that you were not on cc: on the discussion...]