diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/9pfs/Makefile.objs | 2 | ||||
-rw-r--r-- | hw/Makefile.objs | 2 | ||||
-rw-r--r-- | hw/intc/s390_flic_kvm.c | 1 | ||||
-rw-r--r-- | hw/pci/pci-stub.c | 14 | ||||
-rw-r--r-- | hw/pci/pci.c | 2 | ||||
-rw-r--r-- | hw/s390x/Makefile.objs | 3 | ||||
-rw-r--r-- | hw/s390x/css.c | 16 | ||||
-rw-r--r-- | hw/s390x/ipl.c | 2 | ||||
-rw-r--r-- | hw/s390x/s390-pci-bus.c | 18 | ||||
-rw-r--r-- | hw/s390x/s390-pci-bus.h | 12 | ||||
-rw-r--r-- | hw/s390x/s390-pci-inst.c | 4 | ||||
-rw-r--r-- | hw/s390x/s390-pci-stub.c | 76 | ||||
-rw-r--r-- | hw/s390x/s390-skeys-kvm.c | 4 | ||||
-rw-r--r-- | hw/s390x/s390-skeys.c | 4 | ||||
-rw-r--r-- | hw/s390x/s390-stattrib-kvm.c | 5 | ||||
-rw-r--r-- | hw/s390x/s390-stattrib.c | 6 | ||||
-rw-r--r-- | hw/s390x/s390-virtio-ccw.c | 54 | ||||
-rw-r--r-- | hw/s390x/s390-virtio.c | 7 | ||||
-rw-r--r-- | hw/s390x/s390-virtio.h | 2 | ||||
-rw-r--r-- | hw/s390x/sclp.c | 42 | ||||
-rw-r--r-- | hw/s390x/sclpcpu.c | 1 | ||||
-rw-r--r-- | hw/watchdog/wdt_diag288.c | 1 |
22 files changed, 202 insertions, 76 deletions
diff --git a/hw/9pfs/Makefile.objs b/hw/9pfs/Makefile.objs index cab5e942ed..fd90b62900 100644 --- a/hw/9pfs/Makefile.objs +++ b/hw/9pfs/Makefile.objs @@ -7,4 +7,4 @@ common-obj-$(CONFIG_OPEN_BY_HANDLE) += 9p-handle.o common-obj-y += 9p-proxy.o common-obj-$(CONFIG_XEN) += xen-9p-backend.o -obj-y += virtio-9p-device.o +obj-$(CONFIG_VIRTIO) += virtio-9p-device.o diff --git a/hw/Makefile.objs b/hw/Makefile.objs index a2c61f6b09..cf4cb2010b 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -1,4 +1,4 @@ -devices-dirs-$(call land, $(CONFIG_VIRTIO),$(call land,$(CONFIG_VIRTFS),$(CONFIG_PCI))) += 9pfs/ +devices-dirs-$(call land,$(CONFIG_VIRTFS),$(call lor,$(CONFIG_VIRTIO),$(CONFIG_XEN))) += 9pfs/ devices-dirs-$(CONFIG_SOFTMMU) += acpi/ devices-dirs-$(CONFIG_SOFTMMU) += adc/ devices-dirs-$(CONFIG_SOFTMMU) += audio/ diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index be3fd00a57..7ead17ac3e 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "cpu.h" +#include "kvm_s390x.h" #include <sys/ioctl.h> #include "qemu/error-report.h" #include "qapi/error.h" diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c index ecad664946..d5ce00748e 100644 --- a/hw/pci/pci-stub.c +++ b/hw/pci/pci-stub.c @@ -27,6 +27,7 @@ #include "hw/pci/msi.h" bool msi_nonbroken; +bool pci_available; PciInfoList *qmp_query_pci(Error **errp) { @@ -38,3 +39,16 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict) { monitor_printf(mon, "PCI devices not supported\n"); } + +/* kvm-all wants this */ +MSIMessage pci_get_msi_message(PCIDevice *dev, int vector) +{ + g_assert(false); + return (MSIMessage){}; +} + +uint16_t pci_requester_id(PCIDevice *dev) +{ + g_assert(false); + return 0; +} diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 258fbe51e2..26f346db2c 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -49,6 +49,8 @@ # define PCI_DPRINTF(format, ...) do { } while (0) #endif +bool pci_available = true; + static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent); static char *pcibus_get_dev_path(DeviceState *dev); static char *pcibus_get_fw_dev_path(DeviceState *dev); diff --git a/hw/s390x/Makefile.objs b/hw/s390x/Makefile.objs index b2aade2466..7ee19d3abc 100644 --- a/hw/s390x/Makefile.objs +++ b/hw/s390x/Makefile.objs @@ -11,7 +11,8 @@ obj-y += 3270-ccw.o obj-y += virtio-ccw.o obj-y += css-bridge.o obj-y += ccw-device.o -obj-y += s390-pci-bus.o s390-pci-inst.o +obj-$(CONFIG_PCI) += s390-pci-bus.o s390-pci-inst.o +obj-$(call lnot,$(CONFIG_PCI)) += s390-pci-stub.o obj-y += s390-skeys.o obj-y += s390-stattrib.o obj-$(CONFIG_KVM) += s390-skeys-kvm.o diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 1880b1a0ff..901dc6a0f3 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -1750,10 +1750,10 @@ int css_do_rchp(uint8_t cssid, uint8_t chpid) } /* We don't really use a channel path, so we're done here. */ - css_queue_crw(CRW_RSC_CHP, CRW_ERC_INIT, + css_queue_crw(CRW_RSC_CHP, CRW_ERC_INIT, 1, channel_subsys.max_cssid > 0 ? 1 : 0, chpid); if (channel_subsys.max_cssid > 0) { - css_queue_crw(CRW_RSC_CHP, CRW_ERC_INIT, 0, real_cssid << 8); + css_queue_crw(CRW_RSC_CHP, CRW_ERC_INIT, 1, 0, real_cssid << 8); } return 0; } @@ -2033,7 +2033,8 @@ void css_subch_assign(uint8_t cssid, uint8_t ssid, uint16_t schid, } } -void css_queue_crw(uint8_t rsc, uint8_t erc, int chain, uint16_t rsid) +void css_queue_crw(uint8_t rsc, uint8_t erc, int solicited, + int chain, uint16_t rsid) { CrwContainer *crw_cont; @@ -2045,6 +2046,9 @@ void css_queue_crw(uint8_t rsc, uint8_t erc, int chain, uint16_t rsid) return; } crw_cont->crw.flags = (rsc << 8) | erc; + if (solicited) { + crw_cont->crw.flags |= CRW_FLAGS_MASK_S; + } if (chain) { crw_cont->crw.flags |= CRW_FLAGS_MASK_C; } @@ -2091,9 +2095,9 @@ void css_generate_sch_crws(uint8_t cssid, uint8_t ssid, uint16_t schid, } chain_crw = (channel_subsys.max_ssid > 0) || (channel_subsys.max_cssid > 0); - css_queue_crw(CRW_RSC_SUBCH, CRW_ERC_IPI, chain_crw ? 1 : 0, schid); + css_queue_crw(CRW_RSC_SUBCH, CRW_ERC_IPI, 0, chain_crw ? 1 : 0, schid); if (chain_crw) { - css_queue_crw(CRW_RSC_SUBCH, CRW_ERC_IPI, 0, + css_queue_crw(CRW_RSC_SUBCH, CRW_ERC_IPI, 0, 0, (guest_cssid << 8) | (ssid << 4)); } /* RW_ERC_IPI --> clear pending interrupts */ @@ -2108,7 +2112,7 @@ void css_generate_chp_crws(uint8_t cssid, uint8_t chpid) void css_generate_css_crws(uint8_t cssid) { if (!channel_subsys.sei_pending) { - css_queue_crw(CRW_RSC_CSS, 0, 0, cssid); + css_queue_crw(CRW_RSC_CSS, CRW_ERC_EVENT, 0, 0, cssid); } channel_subsys.sei_pending = true; } diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index cc360031ef..0d06fc12b6 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -442,6 +442,8 @@ static void s390_ipl_class_init(ObjectClass *klass, void *data) dc->reset = s390_ipl_reset; dc->vmsd = &vmstate_ipl; set_bit(DEVICE_CATEGORY_MISC, dc->categories); + /* Reason: Loads the ROMs and thus can only be used one time - internally */ + dc->user_creatable = false; } static const TypeInfo s390_ipl_info = { diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 61cfd2138f..0a31a4ae88 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -47,7 +47,7 @@ S390pciState *s390_get_phb(void) return phb; } -int chsc_sei_nt2_get_event(void *res) +int pci_chsc_sei_nt2_get_event(void *res) { ChscSeiNt2Res *nt2_res = (ChscSeiNt2Res *)res; PciCcdfAvail *accdf; @@ -87,7 +87,7 @@ int chsc_sei_nt2_get_event(void *res) return rc; } -int chsc_sei_nt2_have_event(void) +int pci_chsc_sei_nt2_have_event(void) { S390pciState *s = s390_get_phb(); @@ -122,16 +122,11 @@ S390PCIBusDevice *s390_pci_find_dev_by_fid(S390pciState *s, uint32_t fid) void s390_pci_sclp_configure(SCCB *sccb) { - PciCfgSccb *psccb = (PciCfgSccb *)sccb; + IoaCfgSccb *psccb = (IoaCfgSccb *)sccb; S390PCIBusDevice *pbdev = s390_pci_find_dev_by_fid(s390_get_phb(), be32_to_cpu(psccb->aid)); uint16_t rc; - if (be16_to_cpu(sccb->h.length) < 16) { - rc = SCLP_RC_INSUFFICIENT_SCCB_LENGTH; - goto out; - } - if (!pbdev) { DPRINTF("sclp config no dev found\n"); rc = SCLP_RC_ADAPTER_ID_NOT_RECOGNIZED; @@ -155,16 +150,11 @@ out: void s390_pci_sclp_deconfigure(SCCB *sccb) { - PciCfgSccb *psccb = (PciCfgSccb *)sccb; + IoaCfgSccb *psccb = (IoaCfgSccb *)sccb; S390PCIBusDevice *pbdev = s390_pci_find_dev_by_fid(s390_get_phb(), be32_to_cpu(psccb->aid)); uint16_t rc; - if (be16_to_cpu(sccb->h.length) < 16) { - rc = SCLP_RC_INSUFFICIENT_SCCB_LENGTH; - goto out; - } - if (!pbdev) { DPRINTF("sclp deconfig no dev found\n"); rc = SCLP_RC_ADAPTER_ID_NOT_RECOGNIZED; diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h index 67af2c12ff..bd636abc28 100644 --- a/hw/s390x/s390-pci-bus.h +++ b/hw/s390x/s390-pci-bus.h @@ -244,14 +244,6 @@ typedef struct ChscSeiNt2Res { uint8_t ccdf[4016]; } QEMU_PACKED ChscSeiNt2Res; -typedef struct PciCfgSccb { - SCCBHeader header; - uint8_t atype; - uint8_t reserved1; - uint16_t reserved2; - uint32_t aid; -} QEMU_PACKED PciCfgSccb; - typedef struct S390MsixInfo { bool available; uint8_t table_bar; @@ -319,8 +311,8 @@ typedef struct S390pciState { } S390pciState; S390pciState *s390_get_phb(void); -int chsc_sei_nt2_get_event(void *res); -int chsc_sei_nt2_have_event(void); +int pci_chsc_sei_nt2_get_event(void *res); +int pci_chsc_sei_nt2_have_event(void); void s390_pci_sclp_configure(SCCB *sccb); void s390_pci_sclp_deconfigure(SCCB *sccb); void s390_pci_iommu_enable(S390PCIIOMMU *iommu); diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index b7beb8c36a..eba9ffb5f2 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -440,8 +440,8 @@ static int trap_msix(S390PCIBusDevice *pbdev, uint64_t offset, uint8_t pcias) { if (pbdev->msix.available && pbdev->msix.table_bar == pcias && offset >= pbdev->msix.table_offset && - offset <= pbdev->msix.table_offset + - (pbdev->msix.entries - 1) * PCI_MSIX_ENTRY_SIZE) { + offset < (pbdev->msix.table_offset + + pbdev->msix.entries * PCI_MSIX_ENTRY_SIZE)) { return 1; } else { return 0; diff --git a/hw/s390x/s390-pci-stub.c b/hw/s390x/s390-pci-stub.c new file mode 100644 index 0000000000..7a642d376c --- /dev/null +++ b/hw/s390x/s390-pci-stub.c @@ -0,0 +1,76 @@ +/* stubs for non-pci builds */ + +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" +#include "s390-pci-inst.h" +#include "s390-pci-bus.h" + +/* target/s390x/ioinst.c */ +int pci_chsc_sei_nt2_get_event(void *res) +{ + return 1; +} + +int pci_chsc_sei_nt2_have_event(void) +{ + return 0; +} + +/* hw/s390x/sclp.c */ +void s390_pci_sclp_configure(SCCB *sccb) +{ + sccb->h.response_code = cpu_to_be16(SCLP_RC_ADAPTER_TYPE_NOT_RECOGNIZED); +} + +void s390_pci_sclp_deconfigure(SCCB *sccb) +{ + sccb->h.response_code = cpu_to_be16(SCLP_RC_ADAPTER_TYPE_NOT_RECOGNIZED); +} + +/* target/s390x/kvm.c */ +int clp_service_call(S390CPU *cpu, uint8_t r2) +{ + return -1; +} + +int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2) +{ + return -1; +} + +int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2) +{ + return -1; +} + +int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar) +{ + return -1; +} + +int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2) +{ + return -1; +} + +int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr, + uint8_t ar) +{ + return -1; +} + +int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar) +{ + return -1; +} + +S390pciState *s390_get_phb(void) +{ + return NULL; +} + +S390PCIBusDevice *s390_pci_find_dev_by_idx(S390pciState *s, uint32_t idx) +{ + return NULL; +} diff --git a/hw/s390x/s390-skeys-kvm.c b/hw/s390x/s390-skeys-kvm.c index 131da56bbe..dc54ed8b11 100644 --- a/hw/s390x/s390-skeys-kvm.c +++ b/hw/s390x/s390-skeys-kvm.c @@ -54,10 +54,14 @@ static int kvm_s390_skeys_set(S390SKeysState *ss, uint64_t start_gfn, static void kvm_s390_skeys_class_init(ObjectClass *oc, void *data) { S390SKeysClass *skeyclass = S390_SKEYS_CLASS(oc); + DeviceClass *dc = DEVICE_CLASS(oc); skeyclass->skeys_enabled = kvm_s390_skeys_enabled; skeyclass->get_skeys = kvm_s390_skeys_get; skeyclass->set_skeys = kvm_s390_skeys_set; + + /* Reason: Internal device (only one skeys device for the whole memory) */ + dc->user_creatable = false; } static const TypeInfo kvm_s390_skeys_info = { diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index c0de3b0c35..53ad5d38d4 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -229,10 +229,14 @@ static int qemu_s390_skeys_get(S390SKeysState *ss, uint64_t start_gfn, static void qemu_s390_skeys_class_init(ObjectClass *oc, void *data) { S390SKeysClass *skeyclass = S390_SKEYS_CLASS(oc); + DeviceClass *dc = DEVICE_CLASS(oc); skeyclass->skeys_enabled = qemu_s390_skeys_enabled; skeyclass->get_skeys = qemu_s390_skeys_get; skeyclass->set_skeys = qemu_s390_skeys_set; + + /* Reason: Internal device (only one skeys device for the whole memory) */ + dc->user_creatable = false; } static const TypeInfo qemu_s390_skeys_info = { diff --git a/hw/s390x/s390-stattrib-kvm.c b/hw/s390x/s390-stattrib-kvm.c index ff3f89fd2d..41770a7dec 100644 --- a/hw/s390x/s390-stattrib-kvm.c +++ b/hw/s390x/s390-stattrib-kvm.c @@ -17,6 +17,7 @@ #include "sysemu/kvm.h" #include "exec/ram_addr.h" #include "cpu.h" +#include "kvm_s390x.h" Object *kvm_s390_stattrib_create(void) { @@ -163,6 +164,7 @@ static int kvm_s390_stattrib_get_active(S390StAttribState *sa) static void kvm_s390_stattrib_class_init(ObjectClass *oc, void *data) { S390StAttribClass *sac = S390_STATTRIB_CLASS(oc); + DeviceClass *dc = DEVICE_CLASS(oc); sac->get_stattr = kvm_s390_stattrib_get_stattr; sac->peek_stattr = kvm_s390_stattrib_peek_stattr; @@ -171,6 +173,9 @@ static void kvm_s390_stattrib_class_init(ObjectClass *oc, void *data) sac->get_dirtycount = kvm_s390_stattrib_get_dirtycount; sac->synchronize = kvm_s390_stattrib_synchronize; sac->get_active = kvm_s390_stattrib_get_active; + + /* Reason: Can only be instantiated one time (internally) */ + dc->user_creatable = false; } static const TypeInfo kvm_s390_stattrib_info = { diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c index d14923f099..2902f54f11 100644 --- a/hw/s390x/s390-stattrib.c +++ b/hw/s390x/s390-stattrib.c @@ -11,12 +11,12 @@ #include "qemu/osdep.h" #include "hw/boards.h" +#include "cpu.h" #include "qmp-commands.h" #include "migration/qemu-file.h" #include "migration/register.h" #include "hw/s390x/storage-attributes.h" #include "qemu/error-report.h" -#include "sysemu/kvm.h" #include "exec/ram_addr.h" #include "qapi/error.h" @@ -306,6 +306,7 @@ static int qemu_s390_get_active(S390StAttribState *sa) static void qemu_s390_stattrib_class_init(ObjectClass *oc, void *data) { S390StAttribClass *sa_cl = S390_STATTRIB_CLASS(oc); + DeviceClass *dc = DEVICE_CLASS(oc); sa_cl->synchronize = qemu_s390_synchronize_stub; sa_cl->get_stattr = qemu_s390_get_stattr_stub; @@ -314,6 +315,9 @@ static void qemu_s390_stattrib_class_init(ObjectClass *oc, void *data) sa_cl->set_migrationmode = qemu_s390_set_migrationmode_stub; sa_cl->get_dirtycount = qemu_s390_get_dirtycount_stub; sa_cl->get_active = qemu_s390_get_active; + + /* Reason: Can only be instantiated one time (internally) */ + dc->user_creatable = false; } static const TypeInfo qemu_s390_stattrib_info = { diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 1c7af39ce6..dd504dd5ae 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -118,12 +118,11 @@ static void ccw_init(MachineState *machine) { int ret; VirtualCssBus *css_bus; - DeviceState *dev; s390_sclp_init(); s390_memory_init(machine->ram_size); - /* init CPUs */ + /* init CPUs (incl. CPU model) early so s390_has_feature() works */ s390_init_cpus(machine); s390_flic_init(); @@ -134,17 +133,18 @@ static void ccw_init(MachineState *machine) machine->initrd_filename, "s390-ccw.img", "s390-netboot.img", true); - dev = qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE); - object_property_add_child(qdev_get_machine(), TYPE_S390_PCI_HOST_BRIDGE, - OBJECT(dev), NULL); - qdev_init_nofail(dev); + if (s390_has_feat(S390_FEAT_ZPCI)) { + DeviceState *dev = qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE); + object_property_add_child(qdev_get_machine(), + TYPE_S390_PCI_HOST_BRIDGE, + OBJECT(dev), NULL); + qdev_init_nofail(dev); + } /* register hypercalls */ virtio_ccw_register_hcalls(); - if (kvm_enabled()) { - kvm_s390_enable_css_support(s390_cpu_addr2state(0)); - } + s390_enable_css_support(s390_cpu_addr2state(0)); /* * Non mcss-e enabled guests only see the devices from the default * css, which is determined by the value of the squash_mcss property. @@ -161,7 +161,7 @@ static void ccw_init(MachineState *machine) s390_create_virtio_net(BUS(css_bus), "virtio-net-ccw"); /* Register savevm handler for guest TOD clock */ - register_savevm_live(NULL, "todclock", 0, 1, &savevm_gtod, kvm_state); + register_savevm_live(NULL, "todclock", 0, 1, &savevm_gtod, NULL); } static void s390_cpu_plug(HotplugHandler *hotplug_dev, @@ -276,9 +276,6 @@ static S390CcwMachineClass *get_machine_class(void) bool ri_allowed(void) { - if (!kvm_enabled()) { - return false; - } /* for "none" machine this results in true */ return get_machine_class()->ri_allowed; } @@ -291,18 +288,8 @@ bool cpu_model_allowed(void) bool gs_allowed(void) { - if (kvm_enabled()) { - MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); - if (object_class_dynamic_cast(OBJECT_CLASS(mc), - TYPE_S390_CCW_MACHINE)) { - S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc); - - return s390mc->gs_allowed; - } - /* Make sure the "none" machine can have gs */ - return true; - } - return false; + /* for "none" machine this results in true */ + return get_machine_class()->gs_allowed; } static char *machine_get_loadparm(Object *obj, Error **errp) @@ -432,6 +419,9 @@ bool css_migration_enabled(void) } \ type_init(ccw_machine_register_##suffix) +#define CCW_COMPAT_2_10 \ + HW_COMPAT_2_10 + #define CCW_COMPAT_2_9 \ HW_COMPAT_2_9 \ {\ @@ -506,8 +496,18 @@ bool css_migration_enabled(void) .value = "0",\ }, +static void ccw_machine_2_11_instance_options(MachineState *machine) +{ +} + +static void ccw_machine_2_11_class_options(MachineClass *mc) +{ +} +DEFINE_CCW_MACHINE(2_11, "2.11", true); + static void ccw_machine_2_10_instance_options(MachineState *machine) { + ccw_machine_2_11_instance_options(machine); if (css_migration_enabled()) { css_register_vmstate(); } @@ -515,8 +515,10 @@ static void ccw_machine_2_10_instance_options(MachineState *machine) static void ccw_machine_2_10_class_options(MachineClass *mc) { + ccw_machine_2_11_class_options(mc); + SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_10); } -DEFINE_CCW_MACHINE(2_10, "2.10", true); +DEFINE_CCW_MACHINE(2_10, "2.10", false); static void ccw_machine_2_9_instance_options(MachineState *machine) { diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c index afa4148e6b..da3f49e80e 100644 --- a/hw/s390x/s390-virtio.c +++ b/hw/s390x/s390-virtio.c @@ -33,7 +33,6 @@ #include "hw/boards.h" #include "hw/loader.h" #include "hw/virtio/virtio.h" -#include "sysemu/kvm.h" #include "exec/address-spaces.h" #include "sysemu/qtest.h" @@ -93,11 +92,7 @@ void s390_init_cpus(MachineState *machine) gchar *name; if (machine->cpu_model == NULL) { - if (kvm_enabled()) { - machine->cpu_model = "host"; - } else { - machine->cpu_model = "qemu"; - } + machine->cpu_model = s390_default_cpu_model_name(); } cpu_states = g_new0(S390CPU *, max_cpus); diff --git a/hw/s390x/s390-virtio.h b/hw/s390x/s390-virtio.h index f2377a3e0e..ca97fd6814 100644 --- a/hw/s390x/s390-virtio.h +++ b/hw/s390x/s390-virtio.h @@ -30,4 +30,6 @@ 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 diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 9253dbbc64..fd097262c7 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -15,7 +15,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "cpu.h" -#include "sysemu/kvm.h" #include "exec/memory.h" #include "sysemu/sysemu.h" #include "exec/address-spaces.h" @@ -57,7 +56,7 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) CPUState *cpu; int cpu_count = 0; int rnsize, rnmax; - int slots = MIN(machine->ram_slots, s390_get_memslot_count(kvm_state)); + int slots = MIN(machine->ram_slots, s390_get_memslot_count()); IplParameterBlock *ipib = s390_ipl_get_iplb(); CPU_FOREACH(cpu) { @@ -80,7 +79,7 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) prepare_cpu_entries(sclp, read_info->entries, cpu_count); read_info->facilities = cpu_to_be64(SCLP_HAS_CPU_INFO | - SCLP_HAS_PCI_RECONFIG); + SCLP_HAS_IOA_RECONFIG); /* Memory Hotplug is only supported for the ccw machine type */ if (mhd) { @@ -354,6 +353,35 @@ static void sclp_read_cpu_info(SCLPDevice *sclp, SCCB *sccb) sccb->h.response_code = cpu_to_be16(SCLP_RC_NORMAL_READ_COMPLETION); } +static void sclp_configure_io_adapter(SCLPDevice *sclp, SCCB *sccb, + bool configure) +{ + int rc; + + if (be16_to_cpu(sccb->h.length) < 16) { + rc = SCLP_RC_INSUFFICIENT_SCCB_LENGTH; + goto out_err; + } + + switch (((IoaCfgSccb *)sccb)->atype) { + case SCLP_RECONFIG_PCI_ATYPE: + if (s390_has_feat(S390_FEAT_ZPCI)) { + if (configure) { + s390_pci_sclp_configure(sccb); + } else { + s390_pci_sclp_deconfigure(sccb); + } + return; + } + /* fallthrough */ + default: + rc = SCLP_RC_ADAPTER_TYPE_NOT_RECOGNIZED; + } + + out_err: + sccb->h.response_code = cpu_to_be16(rc); +} + static void sclp_execute(SCLPDevice *sclp, SCCB *sccb, uint32_t code) { SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp); @@ -384,11 +412,11 @@ static void sclp_execute(SCLPDevice *sclp, SCCB *sccb, uint32_t code) case SCLP_UNASSIGN_STORAGE: sclp_c->unassign_storage(sclp, sccb); break; - case SCLP_CMDW_CONFIGURE_PCI: - s390_pci_sclp_configure(sccb); + case SCLP_CMDW_CONFIGURE_IOA: + sclp_configure_io_adapter(sclp, sccb, true); break; - case SCLP_CMDW_DECONFIGURE_PCI: - s390_pci_sclp_deconfigure(sccb); + case SCLP_CMDW_DECONFIGURE_IOA: + sclp_configure_io_adapter(sclp, sccb, false); break; default: efc->command_handler(ef, sccb, code); diff --git a/hw/s390x/sclpcpu.c b/hw/s390x/sclpcpu.c index b1f3ef8c7d..023d059a46 100644 --- a/hw/s390x/sclpcpu.c +++ b/hw/s390x/sclpcpu.c @@ -18,7 +18,6 @@ #include "hw/s390x/event-facility.h" #include "cpu.h" #include "sysemu/cpus.h" -#include "sysemu/kvm.h" typedef struct ConfigMgtData { EventBufferHeader ebh; diff --git a/hw/watchdog/wdt_diag288.c b/hw/watchdog/wdt_diag288.c index a7b64e2c40..47f289216a 100644 --- a/hw/watchdog/wdt_diag288.c +++ b/hw/watchdog/wdt_diag288.c @@ -121,6 +121,7 @@ static void wdt_diag288_class_init(ObjectClass *klass, void *data) dc->realize = wdt_diag288_realize; dc->unrealize = wdt_diag288_unrealize; dc->reset = wdt_diag288_reset; + dc->hotpluggable = false; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->vmsd = &vmstate_diag288; diag288->handle_timer = wdt_diag288_handle_timer; |