Couple of s390x patches:
- fixup for the cpu model patches - support for virtio 1.1 READ_STATUS command - update MAINTAINERS file pattern -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJX36uqAAoJEN7Pa5PG8C+vC5QQAJn3iULDQByDBD0stkAS0k5L 9qx2hBg9XMnEufWd6ph5VxcdvAw8tDxXs69SWKp37Erpf1QZZbSWbD70Bl4Z7vDC EUfj4ewIVaKO8fFThrg/wXa4U+rq1zwjDSH17PPzMpeU/lf4+7hEBwG85C+WMw4B VfTZoQX/BAM97At7PHSlhkTlpyLFgKtxeUJbzFnjyHlLMfqr24hX9IfQ1GvEmnyP Pv3OgkGpFjxtYBCVT+0mMIHM9YBJ/ChCWmaj5tloEDDq11jdWlzlMpKBxkqnKOCv o3FuyHOBWyMJDr5Av0yT1VyEqMMjneRYOnZEOi5zvJpltY45xfAzjviH6dCd8n9Z 4N0v3Nk6DHC9+otwhombAi8nE56ovkA8z6LwzhMfe/hPyrN38r2WvdtoYodsv4HY 2NV9yO0RaQJaN2PQXfbgU1atTgwoXcN0P/cqf6KEEizKaceT6IcX6F5ksQKqaYpz shjsIxxbO3y8A9HhVApk6bYt4hJebFdFXKhueRoLtRqYDz3OQbss8YtoO6Ii38gE HF88FYeCrOQDu0pRWHhZSOEJCWqu8YyQiM1tDHJc+IpkjKJJAbKX+P4ZkxidQgfM 3EZQP3SXHTxafIZt3l9xvo/pW0ykr7KF5VSnOIZHUotGnWiXqdB7x4MPTp60M84I 17izPTuvkPHRdOqux4Pr =d1QU -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20160919' into staging Couple of s390x patches: - fixup for the cpu model patches - support for virtio 1.1 READ_STATUS command - update MAINTAINERS file pattern # gpg: Signature made Mon 19 Sep 2016 10:11:06 BST # gpg: using RSA key 0xDECF6B93C6F02FAF # gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0 18CE DECF 6B93 C6F0 2FAF * remotes/cohuck/tags/s390x-20160919: QMP: fixup typos and whitespace damage virtio-ccw: set revision 2 as maximal revision number virtio-ccw: respond to READ_STATUS command MAINTAINERS: update s390 machine file patterns s390x/kvm: disable cpu model for the 2.7 machine Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
						commit
						6e98670feb
					
				@ -669,6 +669,9 @@ F: hw/s390x/
 | 
				
			|||||||
F: include/hw/s390x/
 | 
					F: include/hw/s390x/
 | 
				
			||||||
F: pc-bios/s390-ccw/
 | 
					F: pc-bios/s390-ccw/
 | 
				
			||||||
F: hw/watchdog/wdt_diag288.c
 | 
					F: hw/watchdog/wdt_diag288.c
 | 
				
			||||||
 | 
					F: include/hw/watchdog/wdt_diag288.h
 | 
				
			||||||
 | 
					F: pc-bios/s390-ccw.img
 | 
				
			||||||
 | 
					F: default-configs/s390x-softmmu.mak
 | 
				
			||||||
T: git git://github.com/cohuck/qemu.git s390-next
 | 
					T: git git://github.com/cohuck/qemu.git s390-next
 | 
				
			||||||
T: git git://github.com/borntraeger/qemu.git s390-next
 | 
					T: git git://github.com/borntraeger/qemu.git s390-next
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -193,6 +193,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
 | 
				
			|||||||
    S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
 | 
					    S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    s390mc->ri_allowed = true;
 | 
					    s390mc->ri_allowed = true;
 | 
				
			||||||
 | 
					    s390mc->cpu_model_allowed = true;
 | 
				
			||||||
    mc->init = ccw_init;
 | 
					    mc->init = ccw_init;
 | 
				
			||||||
    mc->reset = s390_machine_reset;
 | 
					    mc->reset = s390_machine_reset;
 | 
				
			||||||
    mc->hot_add_cpu = s390_hot_add_cpu;
 | 
					    mc->hot_add_cpu = s390_hot_add_cpu;
 | 
				
			||||||
@ -258,6 +259,19 @@ bool ri_allowed(void)
 | 
				
			|||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool cpu_model_allowed(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    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->cpu_model_allowed;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    /* allow CPU model qmp queries with the "none" machine */
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void s390_machine_initfn(Object *obj)
 | 
					static inline void s390_machine_initfn(Object *obj)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    object_property_add_bool(obj, "aes-key-wrap",
 | 
					    object_property_add_bool(obj, "aes-key-wrap",
 | 
				
			||||||
@ -397,6 +411,9 @@ static void ccw_machine_2_7_instance_options(MachineState *machine)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static void ccw_machine_2_7_class_options(MachineClass *mc)
 | 
					static void ccw_machine_2_7_class_options(MachineClass *mc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    s390mc->cpu_model_allowed = false;
 | 
				
			||||||
    ccw_machine_2_8_class_options(mc);
 | 
					    ccw_machine_2_8_class_options(mc);
 | 
				
			||||||
    SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_7);
 | 
					    SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_7);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -455,6 +455,26 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					    case CCW_CMD_READ_STATUS:
 | 
				
			||||||
 | 
					        if (check_len) {
 | 
				
			||||||
 | 
					            if (ccw.count != sizeof(status)) {
 | 
				
			||||||
 | 
					                ret = -EINVAL;
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        } else if (ccw.count < sizeof(status)) {
 | 
				
			||||||
 | 
					            /* Can't execute command. */
 | 
				
			||||||
 | 
					            ret = -EINVAL;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if (!ccw.cda) {
 | 
				
			||||||
 | 
					            ret = -EFAULT;
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            address_space_stb(&address_space_memory, ccw.cda, vdev->status,
 | 
				
			||||||
 | 
					                                        MEMTXATTRS_UNSPECIFIED, NULL);
 | 
				
			||||||
 | 
					            sch->curr_status.scsw.count = ccw.count - sizeof(vdev->status);;
 | 
				
			||||||
 | 
					            ret = 0;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
    case CCW_CMD_WRITE_STATUS:
 | 
					    case CCW_CMD_WRITE_STATUS:
 | 
				
			||||||
        if (check_len) {
 | 
					        if (check_len) {
 | 
				
			||||||
            if (ccw.count != sizeof(status)) {
 | 
					            if (ccw.count != sizeof(status)) {
 | 
				
			||||||
 | 
				
			|||||||
@ -45,6 +45,7 @@
 | 
				
			|||||||
#define CCW_CMD_SET_IND      0x43
 | 
					#define CCW_CMD_SET_IND      0x43
 | 
				
			||||||
#define CCW_CMD_SET_CONF_IND 0x53
 | 
					#define CCW_CMD_SET_CONF_IND 0x53
 | 
				
			||||||
#define CCW_CMD_READ_VQ_CONF 0x32
 | 
					#define CCW_CMD_READ_VQ_CONF 0x32
 | 
				
			||||||
 | 
					#define CCW_CMD_READ_STATUS  0x72
 | 
				
			||||||
#define CCW_CMD_SET_IND_ADAPTER 0x73
 | 
					#define CCW_CMD_SET_IND_ADAPTER 0x73
 | 
				
			||||||
#define CCW_CMD_SET_VIRTIO_REV 0x83
 | 
					#define CCW_CMD_SET_VIRTIO_REV 0x83
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -98,7 +99,7 @@ struct VirtioCcwDevice {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* The maximum virtio revision we support. */
 | 
					/* The maximum virtio revision we support. */
 | 
				
			||||||
#define VIRTIO_CCW_MAX_REV 1
 | 
					#define VIRTIO_CCW_MAX_REV 2
 | 
				
			||||||
static inline int virtio_ccw_rev_max(VirtioCcwDevice *dev)
 | 
					static inline int virtio_ccw_rev_max(VirtioCcwDevice *dev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return dev->max_rev;
 | 
					    return dev->max_rev;
 | 
				
			||||||
 | 
				
			|||||||
@ -36,9 +36,12 @@ typedef struct S390CcwMachineClass {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /*< public >*/
 | 
					    /*< public >*/
 | 
				
			||||||
    bool ri_allowed;
 | 
					    bool ri_allowed;
 | 
				
			||||||
 | 
					    bool cpu_model_allowed;
 | 
				
			||||||
} S390CcwMachineClass;
 | 
					} S390CcwMachineClass;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* runtime-instrumentation allowed by the machine */
 | 
					/* runtime-instrumentation allowed by the machine */
 | 
				
			||||||
bool ri_allowed(void);
 | 
					bool ri_allowed(void);
 | 
				
			||||||
 | 
					/* cpu model allowed by the machine */
 | 
				
			||||||
 | 
					bool cpu_model_allowed(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
				
			|||||||
@ -3163,7 +3163,7 @@
 | 
				
			|||||||
# @CpuModelCompareResult:
 | 
					# @CpuModelCompareResult:
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# An enumeration of CPU model comparation results. The result is usually
 | 
					# An enumeration of CPU model comparation results. The result is usually
 | 
				
			||||||
# calcualted using e.g. CPU features or CPU generations.
 | 
					# calculated using e.g. CPU features or CPU generations.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# @incompatible: If model A is incompatible to model B, model A is not
 | 
					# @incompatible: If model A is incompatible to model B, model A is not
 | 
				
			||||||
#                guaranteed to run where model B runs and the other way around.
 | 
					#                guaranteed to run where model B runs and the other way around.
 | 
				
			||||||
@ -3216,7 +3216,7 @@
 | 
				
			|||||||
# CPU model has to be created by baselining.
 | 
					# CPU model has to be created by baselining.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Usually, a CPU model is compared against the maximum possible CPU model
 | 
					# Usually, a CPU model is compared against the maximum possible CPU model
 | 
				
			||||||
# of a ceratin configuration (e.g. the "host" model for KVM). If that CPU
 | 
					# of a certain configuration (e.g. the "host" model for KVM). If that CPU
 | 
				
			||||||
# model is identical or a subset, it will run in that configuration.
 | 
					# model is identical or a subset, it will run in that configuration.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# The result returned by this command may be affected by:
 | 
					# The result returned by this command may be affected by:
 | 
				
			||||||
 | 
				
			|||||||
@ -2490,7 +2490,7 @@ static int configure_cpu_feat(const S390FeatBitmap features)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool kvm_s390_cpu_models_supported(void)
 | 
					bool kvm_s390_cpu_models_supported(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (!ri_allowed()) {
 | 
					    if (!cpu_model_allowed()) {
 | 
				
			||||||
        /* compatibility machines interfere with the cpu model */
 | 
					        /* compatibility machines interfere with the cpu model */
 | 
				
			||||||
        return false;
 | 
					        return false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user