s390x/kvm: pending patches
cover s390x/kvm: pending patches
This is what I have queued for s390x.
Cornelia Huck (1):
s390x/MAINTAINERS: Update my email address
Dong Jia Shi (1):
s390x/3270: fix instruction interception handler
Halil Pasic (3):
s390x: vmstatify config migration for virtio-ccw
s390x: fix error propagation in kvm-flic's realize
s390x: fix realize inheritance for kvm-flic
QingFeng Hao (1):
virtio-scsi-ccw: use ioeventfd even when KVM is disabled
Viktor Mihajlovski (1):
s390x: return unavailable features via query-cpu-definitions
MAINTAINERS | 8 +- hw/intc/s390_flic.c | 32 +++- hw/intc/s390_flic_kvm.c | 31 +++- hw/s390x/3270-ccw.c | 1 + hw/s390x/ccw-device.c | 10 ++ hw/s390x/ccw-device.h | 4 + hw/s390x/css.c | 378 +++++++++++++++++++++++++------------------ hw/s390x/virtio-ccw.c | 160 +++++++++--------- include/hw/s390x/css.h | 12 +- include/hw/s390x/s390_flic.h | 5 + target/s390x/cpu.h | 6 +- target/s390x/cpu_models.c | 62 ++++++- 12 files changed, 456 insertions(+), 253 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/7 s390x: vmstatify config migration for virtio-ccw
From: Halil Pasic <[email protected]>
Let's vmstatify virtio_ccw_save_config and virtio_ccw_load_config for flexibility (extending using subsections) and for fun.
To achieve this we need to hack the config_vector, which is VirtIODevice (that is common virtio) state, in the middle of the VirtioCcwDevice state representation. This is somewhat ugly, but we have no choice because the stream format needs to be preserved.
Almost no changes in behavior. Exception is everything that comes with vmstate like extra bookkeeping about what's in the stream, and maybe some extra checks and better error reporting.
Message-Id: <[email protected]>
--- hw/intc/s390_flic.c | 28 ++++ hw/s390x/ccw-device.c | 10 ++ hw/s390x/ccw-device.h | 4 + hw/s390x/css.c | 378 +++++++++++++++++++++++++------------------ hw/s390x/virtio-ccw.c | 158 +++++++++--------- include/hw/s390x/css.h | 12 +- include/hw/s390x/s390_flic.h | 5 + 7 files changed, 358 insertions(+), 237 deletions(-)
hw/intc/s390_flic.c +28 -0
@@ -17,6 +17,7 @@#include "trace.h" #include "hw/qdev.h" #include "qapi/error.h" +#include "hw/s390x/s390-virtio-ccw.h" S390FLICState *s390_get_flic (void ) {
@@ -136,3 +137,30 @@ static void qemu_s390_flic_register_types(void) }type_init (qemu_s390_flic_register_types) + +const VMStateDescription vmstate_adapter_info = { + .name ="s390_adapter_info" , + .version_id =1 , + .minimum_version_id =1 , + .fields = (VMStateField []) { +VMSTATE_UINT64 (ind_offset, AdapterInfo), +/* +* We do not have to migrate neither the id nor the addresses. +* The id is set by css_register_io_adapter and the addresses +* are set based on the IndAddr objects after those get mapped. +*/ +VMSTATE_END_OF_LIST () + }, +}; + +const VMStateDescription vmstate_adapter_routes = { + + .name ="s390_adapter_routes" , + .version_id =1 , + .minimum_version_id =1 , + .fields = (VMStateField []) { +VMSTATE_STRUCT (adapter, AdapterRoutes,1 , vmstate_adapter_info, + AdapterInfo), +VMSTATE_END_OF_LIST () + } +};
hw/s390x/ccw-device.c +10 -0
@@ -50,6 +50,16 @@ static void ccw_device_class_init(ObjectClass *klass, void *data) dc->props = ccw_device_properties; } +const VMStateDescription vmstate_ccw_dev = { + .name ="s390_ccw_dev" , + .version_id =1 , + .minimum_version_id =1 , + .fields = (VMStateField []) { +VMSTATE_STRUCT_POINTER (sch, CcwDevice, vmstate_subch_dev, SubchDev), +VMSTATE_END_OF_LIST () + } +}; +static const TypeInfo ccw_device_info = { .name =TYPE_CCW_DEVICE , .parent =TYPE_DEVICE ,
hw/s390x/ccw-device.h +4 -0
@@ -27,6 +27,10 @@ typedef struct CcwDevice {CssDevId subch_id; } CcwDevice; +extern const VMStateDescription vmstate_ccw_dev; +#define VMSTATE_CCW_DEVICE (_field, _state) \ + VMSTATE_STRUCT(_field, _state, 1, vmstate_ccw_dev, CcwDevice) + typedef struct CCWDeviceClass { DeviceClass parent_class; void (*unplug)(HotplugHandler *, DeviceState *, Error **);
hw/s390x/css.c +222 -156
402 lines not on this page · raw message
hw/s390x/virtio-ccw.c +80 -78
178 lines not on this page · raw message
include/hw/s390x/css.h +9 -3
@@ -88,6 +88,7 @@ struct SubchDev {bool ccw_fmt_1;bool thinint_active;uint8_t ccw_no_data_cnt; +uint16_t migrated_schid;/* used for missmatch detection */ /* transport-provided data: */ int (*ccw_cb) (SubchDev *,CCW1 );void (*disable_cb)(SubchDev *);
@@ -96,6 +97,8 @@ struct SubchDev {void *driver_data; }; +extern const VMStateDescription vmstate_subch_dev; +/* * Identify a device within the channel subsystem. * Note that this can be used to identify either the subchannel or
@@ -118,18 +121,21 @@ typedef struct IndAddr {hwaddr addr;uint64_t map;unsigned long refcnt; -int len; +int32_t len;QTAILQ_ENTRY (IndAddr) sibling; } IndAddr; +extern const VMStateDescription vmstate_ind_addr; + +#define VMSTATE_PTR_TO_IND_ADDR (_f, _s) \ + VMSTATE_STRUCT(_f, _s, 1, vmstate_ind_addr, IndAddr*) +IndAddr *get_indicator (hwaddr ind_addr,int len);void release_indicator (AdapterInfo *adapter,IndAddr *indicator);int map_indicator (AdapterInfo *adapter,IndAddr *indicator);typedef SubchDev *(*css_subch_cb_func )(uint8_t m,uint8_t cssid,uint8_t ssid,uint16_t schid); -void subch_device_save (SubchDev *s,QEMUFile *f); -int subch_device_load (SubchDev *s,QEMUFile *f);int css_create_css_image (uint8_t cssid,bool default_image);bool css_devno_used (uint8_t cssid,uint8_t ssid,uint16_t devno); void css_subch_assign(uint8_t cssid, uint8_t ssid, uint16_t schid,
include/hw/s390x/s390_flic.h +5 -0
@@ -31,6 +31,11 @@ typedef struct AdapterRoutes {int gsi[ADAPTER_ROUTES_MAX_GSI ]; } AdapterRoutes; +extern const VMStateDescription vmstate_adapter_routes; + +#define VMSTATE_ADAPTER_ROUTES (_f, _s) \ + VMSTATE_STRUCT(_f, _s, 1, vmstate_adapter_routes, AdapterRoutes) +#define TYPE_S390_FLIC_COMMON "s390-flic"#define S390_FLIC_COMMON (obj) \ OBJECT_CHECK(S390FLICState, (obj), TYPE_S390_FLIC_COMMON)
Signature · 1 line
2.7.4
PATCH 2/7 s390x/3270: fix instruction interception handler
In reply to Christian BorntraegerFrom: Dong Jia Shi <[email protected]>
Commit bab482d7405f ("s390x/css: ccw translation infrastructure") introduced instruction interception handler for different types of subchannels. For emulated 3270 devices, we should assign the virtual subchannel handler to them during device realization process, or 3270 will not work.
--- hw/s390x/3270-ccw.c | 1 + 1 file changed, 1 insertion(+)
hw/s390x/3270-ccw.c +1 -0
@@ -126,6 +126,7 @@ static void emulated_ccw_3270_realize(DeviceState *ds, Error **errp) sch->id.cu_type =EMULATED_CCW_3270_CU_TYPE ;css_sch_build_virtual_schib (sch, (uint8_t )chpid,EMULATED_CCW_3270_CHPID_TYPE ); + sch->do_subchannel_work = do_subchannel_work_virtual; sch->ccw_cb = emulated_ccw_3270_cb; ck->init (dev, &err);
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH 2/7] s390x/3270: fix instruction interception handler
Quoted 23 lines · On Tue, 4 Jul 2017 16:07:54 +0200 Christian Borntraeger…
From: Dong Jia Shi <[email protected]>
Commit
bab482d7405f("s390x/css: ccw translation infrastructure") introduced instruction interception handler for different types of subchannels. For emulated 3270 devices, we should assign the virtual subchannel handler to them during device realization process, or 3270 will not work.Fixes bab482d7405f ("s390x/css: ccw translation infrastructure")Reviewed-by Jing Liu <[email protected]>Reviewed-by Halil Pasic <[email protected]>Signed-off-by Dong Jia Shi <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- hw/s390x/3270-ccw.c | 1 + 1 file changed, 1 insertion(+)hw/s390x/3270-ccw.c +0
-0
hw/s390x/3270-ccw.c static void emulated_ccw_3270_realize(DeviceState *ds, Error **errp) · line 132
Quoted 7 lines
hw/s390x/3270-ccw.c +1
-0@@ -126,6 +126,7 @@ static void emulated_ccw_3270_realize(DeviceState *ds, Error **errp) sch->id.cu_type =EMULATED_CCW_3270_CU_TYPE ;css_sch_build_virtual_schib (sch, (uint8_t )chpid,EMULATED_CCW_3270_CHPID_TYPE ); + sch->do_subchannel_work = do_subchannel_work_virtual; sch->ccw_cb = emulated_ccw_3270_cb; ck->init (dev, &err);
PATCH 3/7 s390x: fix error propagation in kvm-flic's realize
In reply to Christian BorntraegerFrom: Halil Pasic <[email protected]>
Quoted 1 line
From the moment it was introduced by commit
a2875e6f98("s390x/kvm:
implement floating-interrupt controller device", 2013-07-16) the kvm-flic is not making realize fail properly in case it's impossible to create the KVM device which basically serves as a backend and is absolutely essential for having an operational kvm-flic.
Let's fix this by making sure we do proper error propagation in realize.
--- hw/intc/s390_flic_kvm.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
hw/intc/s390_flic_kvm.c +11 -3
@@ -15,6 +15,7 @@#include "cpu.h" #include <sys/ioctl.h> #include "qemu/error-report.h" +#include "qapi/error.h" #include "hw/sysbus.h" #include "sysemu/kvm.h" #include "hw/s390x/s390_flic.h"
@@ -397,18 +398,22 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)struct kvm_create_device cd = {0 };struct kvm_device_attr test_attr = {0 };int ret; +Error *errp_local =NULL ; flic_state->fd =-1 ;if (!kvm_check_extension (kvm_state,KVM_CAP_DEVICE_CTRL )) { +error_setg_errno (&errp_local, errno,"KVM is missing capability" +" KVM_CAP_DEVICE_CTRL" );trace_flic_no_device_api (errno); -return ; + goto fail; } cd.type =KVM_DEV_TYPE_FLIC ; ret =kvm_vm_ioctl (kvm_state,KVM_CREATE_DEVICE , &cd);if (ret <0 ) { -trace_flic_create_device (errno); -return ; +error_setg_errno (&errp_local, errno,"Creating the KVM device failed" ); +trace_flic_no_device_api (errno); + goto fail; } flic_state->fd = cd.fd;
@@ -417,6 +422,9 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) flic_state->clear_io_supported = !ioctl (flic_state->fd,KVM_HAS_DEVICE_ATTR , test_attr); +return ; +fail: +error_propagate (errp, errp_local); }static void kvm_s390_flic_reset (DeviceState *dev)
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH 3/7] s390x: fix error propagation in kvm-flic's realize
Quoted 19 lines · On Tue, 4 Jul 2017 16:07:55 +0200 Christian Borntraeger…
From: Halil Pasic <[email protected]>
From the moment it was introduced by commit
a2875e6f98("s390x/kvm:
implement floating-interrupt controller device", 2013-07-16) the kvm-flic is not making realize fail properly in case it's impossible to create the KVM device which basically serves as a backend and is absolutely essential for having an operational kvm-flic.Let's fix this by making sure we do proper error propagation in realize.
Signed-off-by Halil Pasic <[email protected]>Fixes a2875e6f98 "s390x/kvm: implement floating-interrupt controller device"Reviewed-by Dong Jia Shi <[email protected]>Reviewed-by Yi Min Zhao <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- hw/intc/s390_flic_kvm.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
(...)
hw/intc/s390_flic_kvm.c static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) · line 415
Quoted 7 lines
cd.type = KVM_DEV_TYPE_FLIC; ret = kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd); if (ret < 0) {hw/intc/s390_flic_kvm.c +2
-2-trace_flic_create_device (errno); -return ; +error_setg_errno (&errp_local, errno,"Creating the KVM device failed" ); +trace_flic_no_device_api (errno);
Err... this should still be trace_flic_create_device(), no?
Quoted 3 lines
+ goto fail;
}
flic_state->fd = cd.fd;Re: [Qemu-devel] [PATCH 3/7] s390x: fix error propagation in kvm-flic's realize
Quoted 33 lines · Cornelia Huck
Quoted 19 lines · On Tue, 4 Jul 2017 16:07:55 +0200 Christian Borntraeger…
From: Halil Pasic <[email protected]>
From the moment it was introduced by commit
a2875e6f98("s390x/kvm:
implement floating-interrupt controller device", 2013-07-16) the kvm-flic is not making realize fail properly in case it's impossible to create the KVM device which basically serves as a backend and is absolutely essential for having an operational kvm-flic.Let's fix this by making sure we do proper error propagation in realize.
Signed-off-by Halil Pasic <[email protected]>Fixes a2875e6f98 "s390x/kvm: implement floating-interrupt controller device"Reviewed-by Dong Jia Shi <[email protected]>Reviewed-by Yi Min Zhao <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- hw/intc/s390_flic_kvm.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)(...)
hw/intc/s390_flic_kvm.c static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) · line 415
Quoted 7 lines
cd.type = KVM_DEV_TYPE_FLIC; ret = kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd); if (ret < 0) {hw/intc/s390_flic_kvm.c +2
-2-trace_flic_create_device (errno); -return ; +error_setg_errno (&errp_local, errno,"Creating the KVM device failed" ); +trace_flic_no_device_api (errno);
Quoted 1 line
Err... this should still be
trace_flic_create_device(), no?
I'm afraid you are right! Probably a copy paste error :/
Quoted 5 lines
Quoted 4 lines
+ goto fail; } flic_state->fd = cd.fd;
Re: [Qemu-devel] [PATCH 3/7] s390x: fix error propagation in kvm-flic's realize
Quoted 36 lines · Halil Pasic
Quoted 33 lines · Cornelia Huck
Quoted 19 lines · On Tue, 4 Jul 2017 16:07:55 +0200 Christian Borntraeger…
From: Halil Pasic <[email protected]>
From the moment it was introduced by commit
a2875e6f98("s390x/kvm:
implement floating-interrupt controller device", 2013-07-16) the kvm-flic is not making realize fail properly in case it's impossible to create the KVM device which basically serves as a backend and is absolutely essential for having an operational kvm-flic.Let's fix this by making sure we do proper error propagation in realize.
Signed-off-by Halil Pasic <[email protected]>Fixes a2875e6f98 "s390x/kvm: implement floating-interrupt controller device"Reviewed-by Dong Jia Shi <[email protected]>Reviewed-by Yi Min Zhao <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- hw/intc/s390_flic_kvm.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)(...)
Quoted 7 lines
cd.type = KVM_DEV_TYPE_FLIC; ret = kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd); if (ret < 0) {hw/intc/s390_flic_kvm.c +2
-2-trace_flic_create_device (errno); -return ; +error_setg_errno (&errp_local, errno,"Creating the KVM device failed" ); +trace_flic_no_device_api (errno);
Quoted 4 lines
Quoted 1 line
Err... this should still be
trace_flic_create_device(), no?I'm afraid you are right! Probably a copy paste error :/
Do you think the traces are still appropriate once we have proper error propagation?
I did not feel comfortable removing them but thinking again, than might be the thing to do.
@Christian:
I think we should really fix this the one way or the other. Can you tell me what is the proper procedure?
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
+ goto fail; } flic_state->fd = cd.fd;
Re: [Qemu-devel] [PATCH 3/7] s390x: fix error propagation in kvm-flic's realize
Quoted 8 lines · On Tue, 4 Jul 2017 17:08:52 +0200 Halil Pasic <[email protected]> wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
cd.type = KVM_DEV_TYPE_FLIC; ret = kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd); if (ret < 0) {hw/intc/s390_flic_kvm.c +2
-2-trace_flic_create_device (errno); -return ; +error_setg_errno (&errp_local, errno,"Creating the KVM device failed" ); +trace_flic_no_device_api (errno);
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Err... this should still be
trace_flic_create_device(), no?I'm afraid you are right! Probably a copy paste error :/
Do you think the traces are still appropriate once we have proper error propagation?
They add less value, but I'd just keep them.
Quoted 7 lines
I did not feel comfortable removing them but thinking again, than might be the thing to do.
@Christian:
I think we should really fix this the one way or the other. Can you tell me what is the proper procedure?
I'd vote for just fixing the trace event. Smaller change, and we can revisit this later.
Re: [Qemu-devel] [PATCH 3/7] s390x: fix error propagation in kvm-flic's realize
Quoted 25 lines · Cornelia Huck
Quoted 8 lines · On Tue, 4 Jul 2017 17:08:52 +0200 Halil Pasic <[email protected]> wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
cd.type = KVM_DEV_TYPE_FLIC; ret = kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd); if (ret < 0) {hw/intc/s390_flic_kvm.c +2
-2-trace_flic_create_device (errno); -return ; +error_setg_errno (&errp_local, errno,"Creating the KVM device failed" ); +trace_flic_no_device_api (errno);Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Err... this should still be
trace_flic_create_device(), no?I'm afraid you are right! Probably a copy paste error :/
Do you think the traces are still appropriate once we have proper error propagation?
They add less value, but I'd just keep them.
Quoted 4 lines
I did not feel comfortable removing them but thinking again, than might be the thing to do.
Quoted 7 lines
Quoted 3 lines
@Christian:
I think we should really fix this the one way or the other. Can you tell me what is the proper procedure?I'd vote for just fixing the trace event. Smaller change, and we can revisit this later.
+1
PATCH 1/1 s390x: fixup for "fix error propagation in kvm-flic..."
My patch "s390x: fix error propagation in kvm-flic's realize" accidentally replaced with. That's wrong! So please apply this fixup before including that patch into mainline (or any other repo).
---
Hope this is appropriate.
--- hw/intc/s390_flic_kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/intc/s390_flic_kvm.c +1 -1
@@ -467,7 +467,7 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) ret =kvm_vm_ioctl (kvm_state,KVM_CREATE_DEVICE , &cd);if (ret <0 ) {error_setg_errno (&errp_local, errno,"Creating the KVM device failed" ); -trace_flic_no_device_api (errno); +trace_flic_create_device (errno); goto fail; } flic_state->fd = cd.fd;
Signature · 1 line
2.11.2
Re: [Qemu-devel] [PATCH 1/1] s390x: fixup for "fix error propagation in kvm-flic..."
Quoted 2 lines · On Wed, 5 Jul 2017 15:54:07 +0200 Halil Pasic <[email protected]> wrote:
My patch "s390x: fix error propagation in kvm-flic's realize" accidentally replaced with. That's wrong! So please apply this fixup before including
This sentence is missing something ;)
Quoted 6 lines
that patch into mainline (or any other repo).
Signed-off-by Halil Pasic <[email protected]>---
Hope this is appropriate.
git actually has a 'fixup!' handling mechanism.
Quoted 9 lines
--- hw/intc/s390_flic_kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/intc/s390_flic_kvm.c +0
-0
hw/intc/s390_flic_kvm.c static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) · line 473
Quoted 8 lines
hw/intc/s390_flic_kvm.c +1
-1@@ -467,7 +467,7 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) ret =kvm_vm_ioctl (kvm_state,KVM_CREATE_DEVICE , &cd);if (ret <0 ) {error_setg_errno (&errp_local, errno,"Creating the KVM device failed" ); -trace_flic_no_device_api (errno); +trace_flic_create_device (errno); goto fail; } flic_state->fd = cd.fd;
Christian, will you handle this?
Re: [Qemu-devel] [PATCH 1/1] s390x: fixup for "fix error propagation in kvm-flic..."
Quoted 37 lines · Cornelia Huck
Quoted 2 lines · On Wed, 5 Jul 2017 15:54:07 +0200 Halil Pasic <[email protected]> wrote:
My patch "s390x: fix error propagation in kvm-flic's realize" accidentally replaced with. That's wrong! So please apply this fixup before including
This sentence is missing something ;)
Quoted 6 lines
that patch into mainline (or any other repo).
Signed-off-by Halil Pasic <[email protected]>---
Hope this is appropriate.
git actually has a 'fixup!' handling mechanism.
Quoted 9 lines
--- hw/intc/s390_flic_kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/intc/s390_flic_kvm.c +0
-0hw/intc/s390_flic_kvm.c static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) · line 473
Quoted 8 lines
hw/intc/s390_flic_kvm.c +1
-1@@ -467,7 +467,7 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) ret =kvm_vm_ioctl (kvm_state,KVM_CREATE_DEVICE , &cd);if (ret <0 ) {error_setg_errno (&errp_local, errno,"Creating the KVM device failed" ); -trace_flic_no_device_api (errno); +trace_flic_create_device (errno); goto fail; } flic_state->fd = cd.fd;Acked-by Cornelia Huck <[email protected]>
Quoted 1 line
Christian, will you handle this?
Yes, I will fold this into the original fix and send a pull request for the whole patch list. Thanks for your review :-)
Re: [Qemu-devel] [PATCH 1/1] s390x: fixup for "fix error propagation in kvm-flic..."
Quoted 38 lines · Christian Borntraeger
Quoted 37 lines · Cornelia Huck
Quoted 2 lines · On Wed, 5 Jul 2017 15:54:07 +0200 Halil Pasic <[email protected]> wrote:
My patch "s390x: fix error propagation in kvm-flic's realize" accidentally replaced with. That's wrong! So please apply this fixup before including
This sentence is missing something ;)
Quoted 6 lines
that patch into mainline (or any other repo).
Signed-off-by Halil Pasic <[email protected]>---
Hope this is appropriate.
git actually has a 'fixup!' handling mechanism.
Quoted 9 lines
--- hw/intc/s390_flic_kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/intc/s390_flic_kvm.c +0
-0hw/intc/s390_flic_kvm.c static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) · line 473
Quoted 8 lines
hw/intc/s390_flic_kvm.c +1
-1@@ -467,7 +467,7 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) ret =kvm_vm_ioctl (kvm_state,KVM_CREATE_DEVICE , &cd);if (ret <0 ) {error_setg_errno (&errp_local, errno,"Creating the KVM device failed" ); -trace_flic_no_device_api (errno); +trace_flic_create_device (errno); goto fail; } flic_state->fd = cd.fd;Acked-by Cornelia Huck <[email protected]>
Quoted 5 lines
Quoted 1 line
Christian, will you handle this?
Yes, I will fold this into the original fix and send a pull request for the whole patch list. Thanks for your review :-)
Thanks Christian, Connie! I will try to remember git checkin --fixup (I was not aware of this feature) next time, and of course try to avoid next time from happening in the first.
Regards,
Halil
PATCH 4/7 s390x: fix realize inheritance for kvm-flic
In reply to Christian BorntraegerFrom: Halil Pasic <[email protected]>
Commit f6f4ce4211 ("s390x: add property adapter_routes_max_batch", 2016-12-09) introduces a common realize (intended to be common for all the subclasses) for flic, but fails to make sure the kvm-flic which had it's own is actually calling this common realize.
This omission fortunately does not result in a grave problem. The common realize was only supposed to catch a possible programming mistake by validating a value of a property set via the compat machine macros. Since there was no programming mistake we don't need this fixed for stable.
Let's fix this problem by making sure kvm flic honors the realize of its parent class.
Let us also improve on the error message we would hypothetically emit when the validation fails.
--- hw/intc/s390_flic.c | 4 ++-- hw/intc/s390_flic_kvm.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)
hw/intc/s390_flic.c +2 -2
@@ -101,8 +101,8 @@ static void s390_flic_common_realize(DeviceState *dev, Error **errp)uint32_t max_batch =S390_FLIC_COMMON (dev)->adapter_routes_max_batch;if (max_batch >ADAPTER_ROUTES_MAX_GSI ) { -error_setg (errp,"flic adapter_routes_max_batch too big" -"%d (%d allowed)" , max_batch,ADAPTER_ROUTES_MAX_GSI ); +error_setg (errp,"flic property adapter_routes_max_batch too big" +" (%d > %d)" , max_batch,ADAPTER_ROUTES_MAX_GSI ); } }
hw/intc/s390_flic_kvm.c +17 -0
@@ -392,6 +392,17 @@ static const VMStateDescription kvm_s390_flic_vmstate = { } }; +typedef struct KVMS390FLICStateClass { +S390FLICStateClass parent_class; +DeviceRealize parent_realize; +}KVMS390FLICStateClass ; + +#define KVM_S390_FLIC_GET_CLASS (obj) \ + OBJECT_GET_CLASS(KVMS390FLICStateClass, (obj), TYPE_KVM_S390_FLIC) + +#define KVM_S390_FLIC_CLASS (klass) \ + OBJECT_CLASS_CHECK(KVMS390FLICStateClass, (klass), TYPE_KVM_S390_FLIC) +static void kvm_s390_flic_realize (DeviceState *dev,Error **errp) {KVMS390FLICState *flic_state =KVM_S390_FLIC (dev);
@@ -400,6 +411,10 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)int ret;Error *errp_local =NULL ; +KVM_S390_FLIC_GET_CLASS (dev)->parent_realize (dev, &errp_local); +if (errp_local) { + goto fail; + } flic_state->fd =-1 ;if (!kvm_check_extension (kvm_state,KVM_CAP_DEVICE_CTRL )) { error_setg_errno(&errp_local, errno, "KVM is missing capability"
@@ -454,6 +469,7 @@ static void kvm_s390_flic_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc);S390FLICStateClass *fsc =S390_FLIC_COMMON_CLASS (oc); +KVM_S390_FLIC_CLASS (oc)->parent_realize = dc->realize; dc->realize = kvm_s390_flic_realize; dc->vmsd = &kvm_s390_flic_vmstate; dc->reset = kvm_s390_flic_reset;
@@ -468,6 +484,7 @@ static const TypeInfo kvm_s390_flic_info = { .name = TYPE_KVM_S390_FLIC, .parent = TYPE_S390_FLIC_COMMON, .instance_size = sizeof(KVMS390FLICState), + .class_size = sizeof(KVMS390FLICStateClass), .class_init = kvm_s390_flic_class_init, };
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH 4/7] s390x: fix realize inheritance for kvm-flic
Quoted 6 lines · On Tue, 4 Jul 2017 16:07:56 +0200 Christian Borntraeger…
From: Halil Pasic <[email protected]>
Commit
f6f4ce4211("s390x: add propertyadapter_routes_max_batch", 2016-12-09) introduces a common realize (intended to be common for all the subclasses) for flic, but fails to make sure the kvm-flic which had it's own is actually calling this common realize.
s/it's/its/
Quoted 27 lines
This omission fortunately does not result in a grave problem. The common realize was only supposed to catch a possible programming mistake by validating a value of a property set via the compat machine macros. Since there was no programming mistake we don't need this fixed for stable.
Let's fix this problem by making sure kvm flic honors the realize of its parent class.
Let us also improve on the error message we would hypothetically emit when the validation fails.
Signed-off-by Halil Pasic <[email protected]>Fixes f6f4ce4211 ("s390x: add property adapter_routes_max_batch")Reviewed-by Dong Jia Shi <[email protected]>Reviewed-by Yi Min Zhao <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- hw/intc/s390_flic.c | 4 ++-- hw/intc/s390_flic_kvm.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)hw/intc/s390_flic.c +0
-0
hw/intc/s390_flic.c static void s390_flic_common_realize(DeviceState *dev, Error **errp) · line 105
Quoted 7 lines
hw/intc/s390_flic.c +2
-2@@ -101,8 +101,8 @@ static void s390_flic_common_realize(DeviceState *dev, Error **errp)uint32_t max_batch =S390_FLIC_COMMON (dev)->adapter_routes_max_batch;if (max_batch >ADAPTER_ROUTES_MAX_GSI ) { -error_setg (errp,"flic adapter_routes_max_batch too big" -"%d (%d allowed)" , max_batch,ADAPTER_ROUTES_MAX_GSI ); +error_setg (errp,"flic property adapter_routes_max_batch too big" +" (%d > %d)" , max_batch,ADAPTER_ROUTES_MAX_GSI );
Unrelated message change?
Quoted 26 lines
hw/intc/s390_flic.c +0
-0} }hw/intc/s390_flic_kvm.c +11
-0@@ -392,6 +392,17 @@ static const VMStateDescription kvm_s390_flic_vmstate = { } }; +typedef struct KVMS390FLICStateClass { +S390FLICStateClass parent_class; +DeviceRealize parent_realize; +}KVMS390FLICStateClass ; + +#define KVM_S390_FLIC_GET_CLASS (obj) \ + OBJECT_GET_CLASS(KVMS390FLICStateClass, (obj), TYPE_KVM_S390_FLIC) + +#define KVM_S390_FLIC_CLASS (klass) \ + OBJECT_CLASS_CHECK(KVMS390FLICStateClass, (klass), TYPE_KVM_S390_FLIC) +static void kvm_s390_flic_realize (DeviceState *dev,Error **errp) {KVMS390FLICState *flic_state =KVM_S390_FLIC (dev);
hw/intc/s390_flic_kvm.c static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) · line 414
Quoted 4 lines
hw/intc/s390_flic_kvm.c +1
-0@@ -400,6 +411,10 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)int ret;Error *errp_local =NULL ; +KVM_S390_FLIC_GET_CLASS (dev)->parent_realize (dev, &errp_local);
I usually prefer to introduce a local variable for that, but don't care too much.
hw/intc/s390_flic_kvm.c static void kvm_s390_flic_class_init(ObjectClass *oc, void *data) · line 472
Quoted 11 lines
hw/intc/s390_flic_kvm.c +4
-0+if (errp_local) { + goto fail; + } flic_state->fd =-1 ;if (!kvm_check_extension (kvm_state,KVM_CAP_DEVICE_CTRL )) { error_setg_errno(&errp_local, errno, "KVM is missing capability"@@ -454,6 +469,7 @@ static void kvm_s390_flic_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc);S390FLICStateClass *fsc =S390_FLIC_COMMON_CLASS (oc); +KVM_S390_FLIC_CLASS (oc)->parent_realize = dc->realize;
dito
Quoted 11 lines
hw/intc/s390_flic_kvm.c +1
-0dc->realize = kvm_s390_flic_realize; dc->vmsd = &kvm_s390_flic_vmstate; dc->reset = kvm_s390_flic_reset;@@ -468,6 +484,7 @@ static const TypeInfo kvm_s390_flic_info = { .name = TYPE_KVM_S390_FLIC, .parent = TYPE_S390_FLIC_COMMON, .instance_size = sizeof(KVMS390FLICState), + .class_size = sizeof(KVMS390FLICStateClass), .class_init = kvm_s390_flic_class_init, };
Re: [Qemu-devel] [PATCH 4/7] s390x: fix realize inheritance for kvm-flic
Quoted 12 lines · Cornelia Huck
Quoted 6 lines · On Tue, 4 Jul 2017 16:07:56 +0200 Christian Borntraeger…
From: Halil Pasic <[email protected]>
Commit
f6f4ce4211("s390x: add propertyadapter_routes_max_batch", 2016-12-09) introduces a common realize (intended to be common for all the subclasses) for flic, but fails to make sure the kvm-flic which had it's own is actually calling this common realize.s/it's/its/
Valid. Sorry.
Quoted 29 lines
Quoted 29 lines
This omission fortunately does not result in a grave problem. The common realize was only supposed to catch a possible programming mistake by validating a value of a property set via the compat machine macros. Since there was no programming mistake we don't need this fixed for stable.
Let's fix this problem by making sure kvm flic honors the realize of its parent class.
Let us also improve on the error message we would hypothetically emit when the validation fails.
Signed-off-by Halil Pasic <[email protected]>Fixes f6f4ce4211 ("s390x: add property adapter_routes_max_batch")Reviewed-by Dong Jia Shi <[email protected]>Reviewed-by Yi Min Zhao <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- hw/intc/s390_flic.c | 4 ++-- hw/intc/s390_flic_kvm.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)hw/intc/s390_flic.c +0
-0@@ -101,8 +101,8 @@ static void s390_flic_common_realize(DeviceState *dev, Error **errp)uint32_t max_batch =S390_FLIC_COMMON (dev)->adapter_routes_max_batch;
Quoted 8 lines
hw/intc/s390_flic.c static void s390_flic_common_realize(DeviceState *dev, Error **errp) · line 105
Quoted 5 lines
hw/intc/s390_flic.c +2
-2if (max_batch >ADAPTER_ROUTES_MAX_GSI ) { -error_setg (errp,"flic adapter_routes_max_batch too big" -"%d (%d allowed)" , max_batch,ADAPTER_ROUTES_MAX_GSI ); +error_setg (errp,"flic property adapter_routes_max_batch too big" +" (%d > %d)" , max_batch,ADAPTER_ROUTES_MAX_GSI );Unrelated message change?
I've mentioned it in the commit message. It was also introduced by the patch I'm fixing. But yes strictly it's two different problems.
Quoted 61 lines
Quoted 26 lines
hw/intc/s390_flic.c +0
-0} }hw/intc/s390_flic_kvm.c +11
-0@@ -392,6 +392,17 @@ static const VMStateDescription kvm_s390_flic_vmstate = { } }; +typedef struct KVMS390FLICStateClass { +S390FLICStateClass parent_class; +DeviceRealize parent_realize; +}KVMS390FLICStateClass ; + +#define KVM_S390_FLIC_GET_CLASS (obj) \ + OBJECT_GET_CLASS(KVMS390FLICStateClass, (obj), TYPE_KVM_S390_FLIC) + +#define KVM_S390_FLIC_CLASS (klass) \ + OBJECT_CLASS_CHECK(KVMS390FLICStateClass, (klass), TYPE_KVM_S390_FLIC) +static void kvm_s390_flic_realize (DeviceState *dev,Error **errp) {KVMS390FLICState *flic_state =KVM_S390_FLIC (dev);hw/intc/s390_flic_kvm.c static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) · line 414
Quoted 4 lines
hw/intc/s390_flic_kvm.c +1
-0@@ -400,6 +411,10 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)int ret;Error *errp_local =NULL ; +KVM_S390_FLIC_GET_CLASS (dev)->parent_realize (dev, &errp_local);I usually prefer to introduce a local variable for that, but don't care too much.
hw/intc/s390_flic_kvm.c static void kvm_s390_flic_class_init(ObjectClass *oc, void *data) · line 472
Quoted 11 lines
hw/intc/s390_flic_kvm.c +4
-0+if (errp_local) { + goto fail; + } flic_state->fd =-1 ;if (!kvm_check_extension (kvm_state,KVM_CAP_DEVICE_CTRL )) { error_setg_errno(&errp_local, errno, "KVM is missing capability"@@ -454,6 +469,7 @@ static void kvm_s390_flic_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc);S390FLICStateClass *fsc =S390_FLIC_COMMON_CLASS (oc); +KVM_S390_FLIC_CLASS (oc)->parent_realize = dc->realize;dito
Quoted 11 lines
hw/intc/s390_flic_kvm.c +1
-0dc->realize = kvm_s390_flic_realize; dc->vmsd = &kvm_s390_flic_vmstate; dc->reset = kvm_s390_flic_reset;@@ -468,6 +484,7 @@ static const TypeInfo kvm_s390_flic_info = { .name = TYPE_KVM_S390_FLIC, .parent = TYPE_S390_FLIC_COMMON, .instance_size = sizeof(KVMS390FLICState), + .class_size = sizeof(KVMS390FLICStateClass), .class_init = kvm_s390_flic_class_init, };
Re: [Qemu-devel] [PATCH 4/7] s390x: fix realize inheritance for kvm-flic
Quoted 56 lines · Halil Pasic
Quoted 12 lines · Cornelia Huck
Quoted 6 lines · On Tue, 4 Jul 2017 16:07:56 +0200 Christian Borntraeger…
From: Halil Pasic <[email protected]>
Commit
f6f4ce4211("s390x: add propertyadapter_routes_max_batch", 2016-12-09) introduces a common realize (intended to be common for all the subclasses) for flic, but fails to make sure the kvm-flic which had it's own is actually calling this common realize.s/it's/its/
Valid. Sorry.
Quoted 29 lines
Quoted 29 lines
This omission fortunately does not result in a grave problem. The common realize was only supposed to catch a possible programming mistake by validating a value of a property set via the compat machine macros. Since there was no programming mistake we don't need this fixed for stable.
Let's fix this problem by making sure kvm flic honors the realize of its parent class.
Let us also improve on the error message we would hypothetically emit when the validation fails.
Signed-off-by Halil Pasic <[email protected]>Fixes f6f4ce4211 ("s390x: add property adapter_routes_max_batch")Reviewed-by Dong Jia Shi <[email protected]>Reviewed-by Yi Min Zhao <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- hw/intc/s390_flic.c | 4 ++-- hw/intc/s390_flic_kvm.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)hw/intc/s390_flic.c +0
-0@@ -101,8 +101,8 @@ static void s390_flic_common_realize(DeviceState *dev, Error **errp)uint32_t max_batch =S390_FLIC_COMMON (dev)->adapter_routes_max_batch;Quoted 8 lines
hw/intc/s390_flic.c static void s390_flic_common_realize(DeviceState *dev, Error **errp) · line 105
Quoted 5 lines
hw/intc/s390_flic.c +2
-2if (max_batch >ADAPTER_ROUTES_MAX_GSI ) { -error_setg (errp,"flic adapter_routes_max_batch too big" -"%d (%d allowed)" , max_batch,ADAPTER_ROUTES_MAX_GSI ); +error_setg (errp,"flic property adapter_routes_max_batch too big" +" (%d > %d)" , max_batch,ADAPTER_ROUTES_MAX_GSI );Unrelated message change?
Quoted 2 lines
I've mentioned it in the commit message. It was also introduced by the patch I'm fixing. But yes strictly it's two different problems.
I will only fix the patch description ( s/it's/its/) and keep the other things unchanged. Is that fine with you?
Quoted 63 lines
Quoted 63 lines
Quoted 28 lines
hw/intc/s390_flic.c +0
-0} }hw/intc/s390_flic_kvm.c +11
-0@@ -392,6 +392,17 @@ static const VMStateDescription kvm_s390_flic_vmstate = { } }; +typedef struct KVMS390FLICStateClass { +S390FLICStateClass parent_class; +DeviceRealize parent_realize; +}KVMS390FLICStateClass ; + +#define KVM_S390_FLIC_GET_CLASS (obj) \ + OBJECT_GET_CLASS(KVMS390FLICStateClass, (obj), TYPE_KVM_S390_FLIC) + +#define KVM_S390_FLIC_CLASS (klass) \ + OBJECT_CLASS_CHECK(KVMS390FLICStateClass, (klass), TYPE_KVM_S390_FLIC) +static void kvm_s390_flic_realize (DeviceState *dev,Error **errp) {KVMS390FLICState *flic_state =KVM_S390_FLIC (dev);hw/intc/s390_flic_kvm.c static void kvm_s390_flic_realize(DeviceState *dev, Error **errp) · line 414
Quoted 4 lines
hw/intc/s390_flic_kvm.c +1
-0@@ -400,6 +411,10 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)int ret;Error *errp_local =NULL ; +KVM_S390_FLIC_GET_CLASS (dev)->parent_realize (dev, &errp_local);I usually prefer to introduce a local variable for that, but don't care too much.
hw/intc/s390_flic_kvm.c static void kvm_s390_flic_class_init(ObjectClass *oc, void *data) · line 472
Quoted 11 lines
hw/intc/s390_flic_kvm.c +4
-0+if (errp_local) { + goto fail; + } flic_state->fd =-1 ;if (!kvm_check_extension (kvm_state,KVM_CAP_DEVICE_CTRL )) { error_setg_errno(&errp_local, errno, "KVM is missing capability"@@ -454,6 +469,7 @@ static void kvm_s390_flic_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc);S390FLICStateClass *fsc =S390_FLIC_COMMON_CLASS (oc); +KVM_S390_FLIC_CLASS (oc)->parent_realize = dc->realize;dito
Quoted 11 lines
hw/intc/s390_flic_kvm.c +1
-0dc->realize = kvm_s390_flic_realize; dc->vmsd = &kvm_s390_flic_vmstate; dc->reset = kvm_s390_flic_reset;@@ -468,6 +484,7 @@ static const TypeInfo kvm_s390_flic_info = { .name = TYPE_KVM_S390_FLIC, .parent = TYPE_S390_FLIC_COMMON, .instance_size = sizeof(KVMS390FLICState), + .class_size = sizeof(KVMS390FLICStateClass), .class_init = kvm_s390_flic_class_init, };
Re: [Qemu-devel] [PATCH 4/7] s390x: fix realize inheritance for kvm-flic
Quoted 57 lines · Christian Borntraeger
Quoted 56 lines · Halil Pasic
Quoted 12 lines · Cornelia Huck
Quoted 6 lines · On Tue, 4 Jul 2017 16:07:56 +0200 Christian Borntraeger…
From: Halil Pasic <[email protected]>
Commit
f6f4ce4211("s390x: add propertyadapter_routes_max_batch", 2016-12-09) introduces a common realize (intended to be common for all the subclasses) for flic, but fails to make sure the kvm-flic which had it's own is actually calling this common realize.s/it's/its/
Valid. Sorry.
Quoted 37 lines
Quoted 27 lines
This omission fortunately does not result in a grave problem. The common realize was only supposed to catch a possible programming mistake by validating a value of a property set via the compat machine macros. Since there was no programming mistake we don't need this fixed for stable.
Let's fix this problem by making sure kvm flic honors the realize of its parent class.
Let us also improve on the error message we would hypothetically emit when the validation fails.
Signed-off-by Halil Pasic <[email protected]>Fixes f6f4ce4211 ("s390x: add property adapter_routes_max_batch")Reviewed-by Dong Jia Shi <[email protected]>Reviewed-by Yi Min Zhao <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- hw/intc/s390_flic.c | 4 ++-- hw/intc/s390_flic_kvm.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)hw/intc/s390_flic.c +0
-0hw/intc/s390_flic.c static void s390_flic_common_realize(DeviceState *dev, Error **errp) · line 105
Quoted 7 lines
hw/intc/s390_flic.c +2
-2@@ -101,8 +101,8 @@ static void s390_flic_common_realize(DeviceState *dev, Error **errp)uint32_t max_batch =S390_FLIC_COMMON (dev)->adapter_routes_max_batch;if (max_batch >ADAPTER_ROUTES_MAX_GSI ) { -error_setg (errp,"flic adapter_routes_max_batch too big" -"%d (%d allowed)" , max_batch,ADAPTER_ROUTES_MAX_GSI ); +error_setg (errp,"flic property adapter_routes_max_batch too big" +" (%d > %d)" , max_batch,ADAPTER_ROUTES_MAX_GSI );Unrelated message change?
Quoted 5 lines
Quoted 2 lines
I've mentioned it in the commit message. It was also introduced by the patch I'm fixing. But yes strictly it's two different problems.
I will only fix the patch description ( s/it's/its/) and keep the other things unchanged. Is that fine with you?
It's fine with me, but I guess you probably asked Connie. Thanks!
Cornelia Huck
Reviewed-byRe: [Qemu-devel] [PATCH 4/7] s390x: fix realize inheritance for kvm-flic
In reply to Christian BorntraegerQuoted 57 lines · On Wed, 5 Jul 2017 12:20:42 +0200 Christian Borntraeger…
Quoted 56 lines · Halil Pasic
Quoted 12 lines · Cornelia Huck
Quoted 6 lines · On Tue, 4 Jul 2017 16:07:56 +0200 Christian Borntraeger…
From: Halil Pasic <[email protected]>
Commit
f6f4ce4211("s390x: add propertyadapter_routes_max_batch", 2016-12-09) introduces a common realize (intended to be common for all the subclasses) for flic, but fails to make sure the kvm-flic which had it's own is actually calling this common realize.s/it's/its/
Valid. Sorry.
Quoted 37 lines
Quoted 27 lines
This omission fortunately does not result in a grave problem. The common realize was only supposed to catch a possible programming mistake by validating a value of a property set via the compat machine macros. Since there was no programming mistake we don't need this fixed for stable.
Let's fix this problem by making sure kvm flic honors the realize of its parent class.
Let us also improve on the error message we would hypothetically emit when the validation fails.
Signed-off-by Halil Pasic <[email protected]>Fixes f6f4ce4211 ("s390x: add property adapter_routes_max_batch")Reviewed-by Dong Jia Shi <[email protected]>Reviewed-by Yi Min Zhao <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- hw/intc/s390_flic.c | 4 ++-- hw/intc/s390_flic_kvm.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)hw/intc/s390_flic.c +0
-0hw/intc/s390_flic.c static void s390_flic_common_realize(DeviceState *dev, Error **errp) · line 105
Quoted 7 lines
hw/intc/s390_flic.c +2
-2@@ -101,8 +101,8 @@ static void s390_flic_common_realize(DeviceState *dev, Error **errp)uint32_t max_batch =S390_FLIC_COMMON (dev)->adapter_routes_max_batch;if (max_batch >ADAPTER_ROUTES_MAX_GSI ) { -error_setg (errp,"flic adapter_routes_max_batch too big" -"%d (%d allowed)" , max_batch,ADAPTER_ROUTES_MAX_GSI ); +error_setg (errp,"flic property adapter_routes_max_batch too big" +" (%d > %d)" , max_batch,ADAPTER_ROUTES_MAX_GSI );Unrelated message change?
Quoted 5 lines
Quoted 2 lines
I've mentioned it in the commit message. It was also introduced by the patch I'm fixing. But yes strictly it's two different problems.
I will only fix the patch description ( s/it's/its/) and keep the other things unchanged. Is that fine with you?
Yup. Let's get this done.
With the changes,
Re: [Qemu-devel] [PATCH 4/7] s390x: fix realize inheritance for kvm-flic
Quoted 63 lines · On Wed, 5 Jul 2017 13:11:59 +0200 Cornelia Huck <[email protected]> wrote:
Quoted 60 lines · On Wed, 5 Jul 2017 12:20:42 +0200 Christian Borntraeger…
Quoted 58 lines · Halil Pasic
Quoted 12 lines · Cornelia Huck
Quoted 6 lines · On Tue, 4 Jul 2017 16:07:56 +0200 Christian Borntraeger…
From: Halil Pasic <[email protected]>
Commit
f6f4ce4211("s390x: add propertyadapter_routes_max_batch", 2016-12-09) introduces a common realize (intended to be common for all the subclasses) for flic, but fails to make sure the kvm-flic which had it's own is actually calling this common realize.s/it's/its/
Valid. Sorry.
Quoted 29 lines
Quoted 29 lines
This omission fortunately does not result in a grave problem. The common realize was only supposed to catch a possible programming mistake by validating a value of a property set via the compat machine macros. Since there was no programming mistake we don't need this fixed for stable.
Let's fix this problem by making sure kvm flic honors the realize of its parent class.
Let us also improve on the error message we would hypothetically emit when the validation fails.
Signed-off-by Halil Pasic <[email protected]>Fixes f6f4ce4211 ("s390x: add property adapter_routes_max_batch")Reviewed-by Dong Jia Shi <[email protected]>Reviewed-by Yi Min Zhao <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- hw/intc/s390_flic.c | 4 ++-- hw/intc/s390_flic_kvm.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)hw/intc/s390_flic.c +0
-0@@ -101,8 +101,8 @@ static void s390_flic_common_realize(DeviceState *dev, Error **errp)uint32_t max_batch =S390_FLIC_COMMON (dev)->adapter_routes_max_batch;Quoted 8 lines
hw/intc/s390_flic.c static void s390_flic_common_realize(DeviceState *dev, Error **errp) · line 105
Quoted 5 lines
hw/intc/s390_flic.c +2
-2if (max_batch >ADAPTER_ROUTES_MAX_GSI ) { -error_setg (errp,"flic adapter_routes_max_batch too big" -"%d (%d allowed)" , max_batch,ADAPTER_ROUTES_MAX_GSI ); +error_setg (errp,"flic property adapter_routes_max_batch too big" +" (%d > %d)" , max_batch,ADAPTER_ROUTES_MAX_GSI );Unrelated message change?
I've mentioned it in the commit message. It was also introduced by the patch I'm fixing. But yes strictly it's two different problems.
Quoted 6 lines
Quoted 2 lines
I will only fix the patch description ( s/it's/its/) and keep the other things unchanged. Is that fine with you?
Yup. Let's get this done.
With the changes,
s/changes/change/
One coffee is obviously not enough...
Quoted 2 lines
Reviewed-by Cornelia Huck <[email protected]>
PATCH 5/7 s390x/MAINTAINERS: Update my email address
In reply to Christian BorntraegerFrom: Cornelia Huck <[email protected]>
Message-Id: <[email protected]>
--- MAINTAINERS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
MAINTAINERS +4 -4
@@ -299,7 +299,7 @@ F: target/ppc/kvm.c S390 M: Christian Borntraeger <[email protected]> -M: Cornelia Huck <[email protected]> +M: Cornelia Huck <[email protected]> M: Alexander Graf <[email protected]> S: Maintained F: target/s390x/kvm.c
@@ -778,7 +778,7 @@ F: include/hw/sparc/grlib.h S390 Machines ------------- S390 Virtio-ccw -M: Cornelia Huck <[email protected]> +M: Cornelia Huck <[email protected]> M: Christian Borntraeger <[email protected]> M: Alexander Graf <[email protected]> S: Supported
@@ -1006,7 +1006,7 @@ F: hw/vfio/* F: include/hw/vfio/ vfio-ccw -M: Cornelia Huck <[email protected]> +M: Cornelia Huck <[email protected]> S: Supported F: hw/vfio/ccw.c F: hw/s390x/s390-ccw.c
@@ -1048,7 +1048,7 @@ F: tests/virtio-blk-test.c T: git git://github.com/stefanha/qemu.git block virtio-ccw -M: Cornelia Huck <[email protected]> +M: Cornelia Huck <[email protected]> M: Christian Borntraeger <[email protected]> S: Supported F: hw/s390x/virtio-ccw.[hc]
Signature · 1 line
2.7.4
PATCH 6/7 s390x: return unavailable features via query-cpu-definitions
In reply to Christian BorntraegerFrom: Viktor Mihajlovski <[email protected]>
The response for query-cpu-definitions didn't include the unavailable-features field, which is used by libvirt to figure out whether a certain cpu model is usable on the host.
The unavailable features are now computed by obtaining the host CPU model and comparing it against the known CPU models. The comparison takes into account the generation, the GA level and the feature bitmaps. In the case of a CPU generation/GA level mismatch a feature called "type" is reported to be missing.
As a result, the output of virsh domcapabilities would change from something like
...
<mode name='custom' supported='yes'>
<model usable='unknown'>z10EC-base</model>
<model usable='unknown'>z9EC-base</model>
<model usable='unknown'>z196.2-base</model>
<model usable='unknown'>z900-base</model>
<model usable='unknown'>z990</model>
...
to
...
<mode name='custom' supported='yes'>
<model usable='yes'>z10EC-base</model>
<model usable='yes'>z9EC-base</model>
<model usable='no'>z196.2-base</model>
<model usable='yes'>z900-base</model>
<model usable='yes'>z990</model>...
Message-Id: <[email protected]>
--- target/s390x/cpu_models.c | 62 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 5 deletions(-)
target/s390x/cpu_models.c +57 -5
@@ -283,10 +283,41 @@ void s390_cpu_list(FILE *f, fprintf_function print) } } +static S390CPUModel *get_max_cpu_model (Error **errp); +#ifndef CONFIG_USER_ONLY +static void list_add_feat (const char *name,void *opaque); + +static void check_unavailable_features (const S390CPUModel *max_model, +const S390CPUModel *model, +strList **unavailable) +{ +S390FeatBitmap missing; + +/* check general model compatibility */ +if (max_model->def->gen < model->def->gen || + (max_model->def->gen == model->def->gen && + max_model->def->ec_ga < model->def->ec_ga)) { +list_add_feat ("type" , unavailable); + } + +/* detect missing features if any to properly report them */ +bitmap_andnot (missing, model->features, max_model->features, +S390_FEAT_MAX ); +if (!bitmap_empty (missing,S390_FEAT_MAX )) { +s390_feat_bitmap_to_ascii (missing, unavailable, list_add_feat); + } +} + +struct CpuDefinitionInfoListData { +CpuDefinitionInfoList *list; +S390CPUModel *model; +}; +static void create_cpu_model_list (ObjectClass *klass,void *opaque) { -CpuDefinitionInfoList **cpu_list = opaque; +struct CpuDefinitionInfoListData *cpu_list_data = opaque; +CpuDefinitionInfoList **cpu_list = &cpu_list_data->list;CpuDefinitionInfoList *entry;CpuDefinitionInfo *info;char *name =g_strdup (object_class_get_name (klass));
@@ -300,7 +331,19 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque) info->migration_safe = scc->is_migration_safe; info->q_static = scc->is_static; info->q_typename =g_strdup (object_class_get_name (klass)); - +/* check for unavailable features */ +if (cpu_list_data->model) { +Object *obj; +S390CPU *sc; + obj =object_new (object_class_get_name (klass)); + sc =S390_CPU (obj); +if (sc->model) { + info->has_unavailable_features = true; +check_unavailable_features (cpu_list_data->model, sc->model, + &info->unavailable_features); + } +object_unref (obj); + } entry =g_malloc0 (sizeof (*entry)); entry->value = info;
@@ -310,11 +353,20 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque)CpuDefinitionInfoList *arch_query_cpu_definitions (Error **errp) { -CpuDefinitionInfoList *list =NULL ; +struct CpuDefinitionInfoListData list_data = { + .list =NULL , + }; -object_class_foreach (create_cpu_model_list,TYPE_S390_CPU , false, &list); + list_data.model =get_max_cpu_model (errp); +if (*errp) { +error_free (*errp); + *errp =NULL ; + } -return list; +object_class_foreach (create_cpu_model_list,TYPE_S390_CPU , false, + &list_data); + +return list_data.list; } static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH 6/7] s390x: return unavailable features via query-cpu-definitions
Quoted 32 lines · On Tue, 4 Jul 2017 16:07:58 +0200 Christian Borntraeger…
From: Viktor Mihajlovski <[email protected]>
The response for query-cpu-definitions didn't include the unavailable-features field, which is used by libvirt to figure out whether a certain cpu model is usable on the host.
The unavailable features are now computed by obtaining the host CPU model and comparing it against the known CPU models. The comparison takes into account the generation, the GA level and the feature bitmaps. In the case of a CPU generation/GA level mismatch a feature called "type" is reported to be missing.
As a result, the output of virsh domcapabilities would change from something like
...<mode name='custom' supported='yes'> <model usable='unknown'>z10EC-base</model> <model usable='unknown'>z9EC-base</model> <model usable='unknown'>z196.2-base</model> <model usable='unknown'>z900-base</model> <model usable='unknown'>z990</model> ... to ... <mode name='custom' supported='yes'> <model usable='yes'>z10EC-base</model> <model usable='yes'>z9EC-base</model> <model usable='no'>z196.2-base</model> <model usable='yes'>z900-base</model> <model usable='yes'>z990</model>...
Quoted 7 lines
Signed-off-by Viktor Mihajlovski <[email protected]>Message-Id: <[email protected]>
Reviewed-by David Hildenbrand <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- target/s390x/cpu_models.c | 62 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 5 deletions(-)
PATCH 7/7 virtio-scsi-ccw: use ioeventfd even when KVM is disabled
In reply to Christian BorntraegerFrom: QingFeng Hao <[email protected]>
This patch is based on a similar patch from Stefan Hajnoczi - commit c324fd0a39c ("virtio-pci: use ioeventfd even when KVM is disabled")
Do not check kvm_eventfds_enabled() when KVM is disabled since it always returns 0. Since commit 8c56c1a592b5092d91da8d8943c17777d6462a6f ("memory: emulate ioeventfd") it has been possible to use ioeventfds in qtest or TCG mode.
This patch makes -device virtio-scsi-ccw,iothread=iothread0 work even when KVM is disabled.
Currently we don't have an equivalent to "memory: emulate ioeventfd" for ccw yet, but that this doesn't hurt and qemu-iotests 068 can pass with skipping iothread arguments.
I have tested that virtio-scsi-ccw works under tcg both with and without iothread.
This patch fixes qemu-iotests 068, which was accidentally merged early despite the dependency on ioeventfd.
Message-Id: <[email protected]>
--- hw/s390x/virtio-ccw.c | 2 +- target/s390x/cpu.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-)
hw/s390x/virtio-ccw.c +1 -1
@@ -789,7 +789,7 @@ static void virtio_ccw_device_realize(VirtioCcwDevice *dev, Error **errp) sch->cssid, sch->ssid, sch->schid, sch->devno, ccw_dev->devno.valid ? "user-configured" : "auto-configured"); -if (!kvm_eventfds_enabled ()) { +if (kvm_enabled () && !kvm_eventfds_enabled ()) { dev->flags &= ~VIRTIO_CCW_FLAG_USE_IOEVENTFD ; }
target/s390x/cpu.h +5 -1
@@ -1264,7 +1264,11 @@ static inline int s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch_id, int vq, bool assign) { - return kvm_s390_assign_subch_ioeventfd(notifier, sch_id, vq, assign); + if (kvm_enabled()) { + return kvm_s390_assign_subch_ioeventfd(notifier, sch_id, vq, assign); + } else { +return 0 ; + } }static inline void s390_crypto_reset (void )
Signature · 1 line
2.7.4