vfio-ccw parent rework
Subsystems (13)
Eric Farman
maintainerv2 cover vfio-ccw parent rework
Hi all,
Here is an update to the vfio-ccw lifecycle changes that have been discussed in various forms over the past year [1][2] or so, and which I dusted off recently.
Patches 1-5 rework the behavior of the vfio-ccw driver's private struct. In summary, the mdev pieces are split out of vfio_ccw_private and into a new vfio_ccw_parent struct that will continue to follow today's lifecycle. The remainder (bulk) of the private struct moves to follow the mdev probe/remove pair. There's opportunity for further separation of the things in the private struct, which would simplify some of the vfio-ccw code, but it got too hairy as I started that. Once vfio-ccw is no longer considered unique, those cleanups can happen at our leisure.
Patch 6 removes the trickery where vfio-ccw uses vfio_init_device instead of vfio_alloc_device, and thus removes vfio_init_device from the outside world.
Patch 7 removes vfio_free_device from vfio-ccw and the other drivers (hello, CC list!), letting it be handled by vfio_device_release directly.
Looking forward to the feedback.
Thanks,
Eric
[1] https://lore.kernel.org/kvm/[email protected]/
[2] https://lore.kernel.org/kvm/[email protected]/
v1->v2:
- Rebase to 6.1-rc3
- Patch 1:
[EF] s/device_initialize/device_register/ and associated adjustments [MR] Add WARN_ON(!private) in vfio_ccw_sch_quiesce()
[MR] Move struct vfio_ccw_parent to _private.h, instead of standalone file
- Patch 2:
[MR] Added r-b (Thank you!)
- Patch 3:
[MR] Update commit message to point to introduction of private->release_comp [MR] Replace the remnants of vfio_ccw_alloc_private with a straight kzalloc [MR] Added r-b (Thank you!)
- Patch 5:
[KT] Added r-b (Thank you!)
- Patch 6:
[JG] Make vfio_init_device static
[KT] Added r-b (Thank you!)
- Patch 7:
[JG, KT] Added r-b (Thank you!)
v1: https://lore.kernel.org/kvm/[email protected]/
Eric Farman (7):
vfio/ccw: create a parent struct vfio/ccw: remove private->sch
vfio/ccw: move private initialization to callback vfio/ccw: move private to mdev lifecycle vfio/ccw: remove release completion vfio/ccw: replace vfio_init_device with _alloc_
vfio: Remove vfio_free_device
drivers/gpu/drm/i915/gvt/kvmgt.c | 1 - drivers/s390/cio/vfio_ccw_chp.c | 5 +- drivers/s390/cio/vfio_ccw_drv.c | 174 +++++++++++--------------- drivers/s390/cio/vfio_ccw_fsm.c | 27 ++-- drivers/s390/cio/vfio_ccw_ops.c | 107 +++++++++++----- drivers/s390/cio/vfio_ccw_private.h | 37 ++++-- drivers/s390/crypto/vfio_ap_ops.c | 6 - drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 - drivers/vfio/pci/vfio_pci_core.c | 1 - drivers/vfio/platform/vfio_amba.c | 1 - drivers/vfio/platform/vfio_platform.c | 1 - drivers/vfio/vfio_main.c | 32 ++--- include/linux/vfio.h | 3 - samples/vfio-mdev/mbochs.c | 1 - samples/vfio-mdev/mdpy.c | 1 - samples/vfio-mdev/mtty.c | 1 - 16 files changed, 197 insertions(+), 202 deletions(-)
Signature · 1 line
2.34.1
Eric Farman
maintainerPATCH v2 1/7 vfio/ccw: create a parent struct
Move the stuff associated with the mdev parent (and thus the subchannel struct) into its own struct, and leave the rest in the existing private structure.
The subchannel will point to the parent, and the parent will point to the private, for the areas where one or both are needed. Further separation of these structs will follow.
--- drivers/s390/cio/vfio_ccw_drv.c | 96 ++++++++++++++++++++++++----- drivers/s390/cio/vfio_ccw_ops.c | 8 ++- drivers/s390/cio/vfio_ccw_private.h | 20 ++++-- 3 files changed, 100 insertions(+), 24 deletions(-)
drivers/s390/cio/vfio_ccw_drv.c +79 -17
@@ -36,10 +36,19 @@ debug_info_t *vfio_ccw_debug_trace_id;*/ int vfio_ccw_sch_quiesce (struct subchannel *sch) { -struct vfio_ccw_private *private =dev_get_drvdata (&sch->dev); +struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); +struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev);DECLARE_COMPLETION_ONSTACK (completion);int iretry, ret =0 ; +/* +* Probably an impossible situation, after being called through +* FSM callbacks. But in the event it did, register a warning +* and return as if things were fine. +*/ +if (WARN_ON (!private)) +return 0 ; + iretry =255 ; do {
@@ -121,7 +130,22 @@ static void vfio_ccw_crw_todo(struct work_struct *work)*/ static void vfio_ccw_sch_irq (struct subchannel *sch) { -struct vfio_ccw_private *private =dev_get_drvdata (&sch->dev); +struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); +struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev); + +/* +* The subchannel should still be disabled at this point, +* so an interrupt would be quite surprising. As with an +* interrupt while the FSM is closed, let's attempt to +* disable the subchannel again. +*/ +if (!private) { +VFIO_CCW_MSG_EVENT (2 ,"sch %x.%x.%04x: unexpected interrupt\n" , + sch->schid.cssid, sch->schid.ssid, sch->schid.sch_no); + +cio_disable_subchannel (sch); +return ; + }inc_irq_stat (IRQIO_CIO );vfio_ccw_fsm_event (private,VFIO_CCW_EVENT_INTERRUPT );
@@ -201,10 +225,19 @@ static void vfio_ccw_free_private(struct vfio_ccw_private *private)mutex_destroy (&private->io_mutex);kfree (private); } + +static void vfio_ccw_free_parent (struct device *dev) +{ + struct vfio_ccw_parent *parent = container_of(dev, struct vfio_ccw_parent, dev); + +kfree (parent); +} +static int vfio_ccw_sch_probe (struct subchannel *sch) {struct pmcw *pmcw = &sch->schib.pmcw;struct vfio_ccw_private *private; +struct vfio_ccw_parent *parent;int ret = -ENOMEM ;if (pmcw->qf) {
@@ -213,41 +246,62 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)return -ENODEV ; } + parent =kzalloc (sizeof (*parent),GFP_KERNEL ); +if (IS_ERR (parent)) +return PTR_ERR (parent); + +dev_set_name (&parent->dev,"parent" ); + parent->dev.parent = &sch->dev; + parent->dev.release = &vfio_ccw_free_parent; + ret =device_register (&parent->dev); +if (ret) + goto out_free; + private =vfio_ccw_alloc_private (sch); -if (IS_ERR (private)) +if (IS_ERR (private)) { +put_device (&parent->dev);return PTR_ERR (private); + } -dev_set_drvdata (&sch->dev, private); +dev_set_drvdata (&sch->dev, parent); +dev_set_drvdata (&parent->dev, private); - private->mdev_type.sysfs_name ="io" ; - private->mdev_type.pretty_name ="I/O subchannel (Non-QDIO)" ; - private->mdev_types[0 ] = &private->mdev_type; - ret =mdev_register_parent (&private->parent, &sch->dev, + parent->mdev_type.sysfs_name ="io" ; + parent->mdev_type.pretty_name ="I/O subchannel (Non-QDIO)" ; + parent->mdev_types[0 ] = &parent->mdev_type; + ret =mdev_register_parent (&parent->parent, &sch->dev, &vfio_ccw_mdev_driver, - private->mdev_types,1 ); + parent->mdev_types,1 );if (ret) - goto out_free; + goto out_unreg;VFIO_CCW_MSG_EVENT (4 ,"bound to subchannel %x.%x.%04x\n" , sch->schid.cssid, sch->schid.ssid, sch->schid.sch_no);return 0 ; +out_unreg: +device_unregister (&parent->dev); out_free: +dev_set_drvdata (&parent->dev,NULL );dev_set_drvdata (&sch->dev,NULL );vfio_ccw_free_private (private); +put_device (&parent->dev);return ret; }static void vfio_ccw_sch_remove (struct subchannel *sch) { -struct vfio_ccw_private *private =dev_get_drvdata (&sch->dev); +struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); +struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev); -mdev_unregister_parent (&private->parent); +mdev_unregister_parent (&parent->parent); +device_unregister (&parent->dev);dev_set_drvdata (&sch->dev,NULL );vfio_ccw_free_private (private); +put_device (&parent->dev); VFIO_CCW_MSG_EVENT(4, "unbound from subchannel %x.%x.%04x\n", sch->schid.cssid, sch->schid.ssid,
@@ -256,7 +310,11 @@ static void vfio_ccw_sch_remove(struct subchannel *sch)static void vfio_ccw_sch_shutdown (struct subchannel *sch) { -struct vfio_ccw_private *private =dev_get_drvdata (&sch->dev); +struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); +struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev); + +if (WARN_ON (!private)) +return ;vfio_ccw_fsm_event (private,VFIO_CCW_EVENT_CLOSE );vfio_ccw_fsm_event (private,VFIO_CCW_EVENT_NOT_OPER );
@@ -274,7 +332,8 @@ static void vfio_ccw_sch_shutdown(struct subchannel *sch)*/ static int vfio_ccw_sch_event (struct subchannel *sch,int process) { -struct vfio_ccw_private *private =dev_get_drvdata (&sch->dev); +struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); +struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev);unsigned long flags;int rc = -EAGAIN ;
@@ -287,8 +346,10 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) rc =0 ; -if (cio_update_schib (sch)) -vfio_ccw_fsm_event (private,VFIO_CCW_EVENT_NOT_OPER ); +if (cio_update_schib (sch)) { +if (private) +vfio_ccw_fsm_event (private,VFIO_CCW_EVENT_NOT_OPER ); + } out_unlock:spin_unlock_irqrestore (sch->lock, flags);
@@ -326,7 +387,8 @@ static void vfio_ccw_queue_crw(struct vfio_ccw_private *private,static int vfio_ccw_chp_event (struct subchannel *sch,struct chp_link *link,int event) { -struct vfio_ccw_private *private =dev_get_drvdata (&sch->dev); +struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); +struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev);int mask =chp_ssd_get_mask (&sch->ssd_info, link);int retry =255 ;
drivers/s390/cio/vfio_ccw_ops.c +6 -2
@@ -55,7 +55,9 @@ static int vfio_ccw_mdev_init_dev(struct vfio_device *vdev)static int vfio_ccw_mdev_probe (struct mdev_device *mdev) { -struct vfio_ccw_private *private =dev_get_drvdata (mdev->dev.parent); +struct subchannel *sch =to_subchannel (mdev->dev.parent); +struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); +struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev);int ret;if (private->state ==VFIO_CCW_STATE_NOT_OPER )
@@ -100,7 +102,9 @@ static void vfio_ccw_mdev_release_dev(struct vfio_device *vdev)static void vfio_ccw_mdev_remove (struct mdev_device *mdev) { -struct vfio_ccw_private *private =dev_get_drvdata (mdev->dev.parent); +struct subchannel *sch =to_subchannel (mdev->dev.parent); +struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); +struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev); VFIO_CCW_MSG_EVENT(2, "sch %x.%x.%04x: remove\n", private->sch->schid.cssid,
drivers/s390/cio/vfio_ccw_private.h +15 -5
@@ -67,6 +67,21 @@ struct vfio_ccw_crw {struct crw crw; }; +/** +* struct vfio_ccw_parent +* +* @dev: embedded device struct +* @parent: parent data structures for mdevs created +* @mdev_type(s): identifying information for mdevs created +*/ +struct vfio_ccw_parent { +struct device dev; + +struct mdev_parent parent; +struct mdev_type mdev_type; +struct mdev_type *mdev_types[1 ]; +}; +/** * struct vfio_ccw_private * @vdev: Embedded VFIO device
@@ -89,7 +104,6 @@ struct vfio_ccw_crw {* @io_work: work for deferral process of I/O handling * @crw_work: work for deferral process of CRW handling * @release_comp: synchronization helper for vfio device release -* @parent: parent data structures for mdevs created */ struct vfio_ccw_private {struct vfio_device vdev;
@@ -116,10 +130,6 @@ struct vfio_ccw_private {struct work_struct crw_work;struct completion release_comp; - -struct mdev_parent parent; -struct mdev_type mdev_type; -struct mdev_type *mdev_types[1 ]; }__aligned(8) ;int vfio_ccw_sch_quiesce (struct subchannel *sch);
Signature · 1 line
2.34.1
Eric Farman
maintainerRe: [PATCH v2 1/7] vfio/ccw: create a parent struct
Quoted 112 lines · Eric Farman
Move the stuff associated with the mdev parent (and thus the subchannel struct) into its own struct, and leave the rest in the existing private structure.
The subchannel will point to the parent, and the parent will point to the private, for the areas where one or both are needed. Further separation of these structs will follow.
Signed-off-by Eric Farman <[email protected]>---
drivers/s390/cio/vfio_ccw_drv.c | 96 ++++++++++++++++++++++++--- --
drivers/s390/cio/vfio_ccw_ops.c | 8 ++-drivers/s390/cio/vfio_ccw_private.h| 20 ++++--3 files changed, 100 insertions(+), 24 deletions(-)drivers/s390/cio/vfio_ccw_drv.c +2
-1@@ -36,10 +36,19 @@ debug_info_t *vfio_ccw_debug_trace_id;*/ int vfio_ccw_sch_quiesce(struct subchannel *sch) { - struct vfio_ccw_private *private = dev_get_drvdata(&sch- >dev); + struct vfio_ccw_parent *parent = dev_get_drvdata(&sch->dev); + struct vfio_ccw_private *private = dev_get_drvdata(&parent- >dev); DECLARE_COMPLETION_ONSTACK(completion); int iretry, ret = 0;
+ /*
+ * Probably an impossible situation, after being called through
+ * FSM callbacks. But in the event it did, register a warning + * and return as if things were fine.
+ */
+ if (WARN_ON(!private))
+ return 0;
+
iretry = 255;
do {drivers/s390/cio/vfio_ccw_drv.c +11
-1@@ -121,7 +130,22 @@ static void vfio_ccw_crw_todo(struct work_struct*work) */ static void vfio_ccw_sch_irq(struct subchannel *sch) { - struct vfio_ccw_private *private = dev_get_drvdata(&sch- >dev); + struct vfio_ccw_parent *parent = dev_get_drvdata(&sch->dev); + struct vfio_ccw_private *private = dev_get_drvdata(&parent- >dev); + + /* + * The subchannel should still be disabled at this point, + * so an interrupt would be quite surprising. As with an + * interrupt while the FSM is closed, let's attempt to + * disable the subchannel again. + */ + if (!private) { + VFIO_CCW_MSG_EVENT(2, "sch %x.%x.%04x: unexpectedinterrupt\n",
+ sch->schid.cssid,sch->schid.ssid, sch-Quoted 1 line
schid.sch_no);
+
+ cio_disable_subchannel(sch);
+ return;
+ }
inc_irq_stat(IRQIO_CIO);vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_INTERRUPT);drivers/s390/cio/vfio_ccw_drv.c +9
-0@@ -201,10 +225,19 @@ static void vfio_ccw_free_private(struct vfio_ccw_private *private) mutex_destroy(&private->io_mutex); kfree(private); } + +static void vfio_ccw_free_parent (struct device *dev) +{ + struct vfio_ccw_parent *parent = container_of(dev, struct vfio_ccw_parent, dev); + + kfree(parent); +} + static int vfio_ccw_sch_probe(struct subchannel *sch) { struct pmcw *pmcw = &sch->schib.pmcw; struct vfio_ccw_private *private; + struct vfio_ccw_parent *parent; int ret = -ENOMEM;
if (pmcw->qf) {drivers/s390/cio/vfio_ccw_drv.c +0
-0@@ -213,41 +246,62 @@ static int vfio_ccw_sch_probe(struct subchannel *sch) return -ENODEV; }
+ parent =kzalloc(sizeof(*parent), GFP_KERNEL); + if (IS_ERR(parent))
+ returnPTR_ERR(parent);drivers/s390/cio/vfio_ccw_drv.c +8
-0+ + dev_set_name(&parent->dev, "parent"); + parent->dev.parent = &sch->dev; + parent->dev.release = &vfio_ccw_free_parent; + ret = device_register(&parent->dev); + if (ret) + goto out_free; +
Quoted 4 lines
private =
vfio_ccw_alloc_private(sch);
- if (IS_ERR(private))
+ if (IS_ERR(private)) {
+ put_device(&parent->dev);
This should've been device_unregister. (I could rearrange the code a bit to avoid the mix of returns/gotos around here, but since the whole series is trying to separate these two structs that seems unnecessary.)
Quoted 26 lines
return
PTR_ERR(private);
+ }
- dev_set_drvdata(&sch->dev, private);
+ dev_set_drvdata(&sch->dev, parent);
+ dev_set_drvdata(&parent->dev, private);
- private->mdev_type.sysfs_name = "io";
- private->mdev_type.pretty_name = "I/O subchannel (Non-QDIO)"; - private->mdev_types[0] =&private->mdev_type;
- ret = mdev_register_parent(&private->parent,&sch->dev, + parent->mdev_type.sysfs_name = "io";
+ parent->mdev_type.pretty_name = "I/O subchannel (Non-QDIO)"; + parent->mdev_types[0] =&parent->mdev_type;
+ ret = mdev_register_parent(&parent->parent,&sch->dev,&vfio_ccw_mdev_driver, -private->mdev_types, 1); +parent->mdev_types, 1); if (ret)
- gotoout_free;
+ gotoout_unreg;
VFIO_CCW_MSG_EVENT(4, "bound to subchannel %x.%x.%04x\n",sch->schid.cssid,sch->schid.ssid,sch->schid.sch_no);
return 0;
Quoted 8 lines
+out_unreg:
+ device_unregister(&parent->dev);
out_free:
+ dev_set_drvdata(&parent->dev, NULL);
dev_set_drvdata(&sch->dev, NULL);
vfio_ccw_free_private(private);
+ put_device(&parent->dev);
While this...
Quoted 10 lines
return ret;
}
static voidvfio_ccw_sch_remove(struct subchannel *sch){
- structvfio_ccw_private*private = dev_get_drvdata(&sch-Quoted 1 line
dev);
+ struct
vfio_ccw_parent*parent =dev_get_drvdata(&sch->dev); + structvfio_ccw_private*private = dev_get_drvdata(&parent-Quoted 1 line
dev);
Quoted 9 lines
- mdev_unregister_parent(&private->parent);
+ mdev_unregister_parent(&parent->parent);
+ device_unregister(&parent->dev);
dev_set_drvdata(&sch->dev, NULL);
vfio_ccw_free_private(private);
+ put_device(&parent->dev);
...and this shouldn't even be there. Sorry for the brain fog.
Quoted 139 lines
VFIO_CCW_MSG_EVENT(4, "unbound from subchannel %x.%x.%04x\n",sch->schid.cssid,sch->schid.ssid,drivers/s390/cio/vfio_ccw_drv.c +0
-0@@ -256,7 +310,11 @@ static void vfio_ccw_sch_remove(struct subchannel *sch)
static voidvfio_ccw_sch_shutdown(struct subchannel *sch){
- structvfio_ccw_private*private = dev_get_drvdata(&sch-Quoted 1 line
dev);
+ struct
vfio_ccw_parent*parent =dev_get_drvdata(&sch->dev); + structvfio_ccw_private*private = dev_get_drvdata(&parent-Quoted 1 line
dev);
+
+ if (WARN_ON(!private))
+ return;
vfio_ccw_fsm_event(private,VFIO_CCW_EVENT_CLOSE);vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER);drivers/s390/cio/vfio_ccw_drv.c +2
-1@@ -274,7 +332,8 @@ static void vfio_ccw_sch_shutdown(structsubchannel *sch) */ static int vfio_ccw_sch_event(struct subchannel *sch, int process) { - struct vfio_ccw_private *private = dev_get_drvdata(&sch- >dev); + struct vfio_ccw_parent *parent = dev_get_drvdata(&sch->dev); + struct vfio_ccw_private *private = dev_get_drvdata(&parent- >dev);unsigned long flags;
int rc =-EAGAIN;drivers/s390/cio/vfio_ccw_drv.c +0
-0@@ -287,8 +346,10 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process)
rc = 0;
- if (cio_update_schib(sch))
- vfio_ccw_fsm_event(private,VFIO_CCW_EVENT_NOT_OPER); + if (cio_update_schib(sch)) {
+ if (private)
+ vfio_ccw_fsm_event(private,VFIO_CCW_EVENT_NOT_OPER);
+ }
out_unlock:
spin_unlock_irqrestore(sch->lock, flags);drivers/s390/cio/vfio_ccw_drv.c +2
-1@@ -326,7 +387,8 @@ static void vfio_ccw_queue_crw(structvfio_ccw_private *private, static int vfio_ccw_chp_event(struct subchannel *sch, struct chp_link *link, int event) { - struct vfio_ccw_private *private = dev_get_drvdata(&sch- >dev); + struct vfio_ccw_parent *parent = dev_get_drvdata(&sch->dev); + struct vfio_ccw_private *private = dev_get_drvdata(&parent- >dev);int mask =
chp_ssd_get_mask(&sch->ssd_info, link); int retry = 255;drivers/s390/cio/vfio_ccw_ops.c +0
-0@@ -55,7 +55,9 @@ static int vfio_ccw_mdev_init_dev(struct vfio_device *vdev)
static intvfio_ccw_mdev_probe(struct mdev_device *mdev){
- structvfio_ccw_private*private = dev_get_drvdata(mdev-Quoted 1 line
dev.parent);
+ struct subchannel *sch =
to_subchannel(mdev->dev.parent); + structvfio_ccw_parent*parent =dev_get_drvdata(&sch->dev); + structvfio_ccw_private*private = dev_get_drvdata(&parent-Quoted 1 line
dev);
int ret;
if (private->state==VFIO_CCW_STATE_NOT_OPER)drivers/s390/cio/vfio_ccw_ops.c +0
-0@@ -100,7 +102,9 @@ static void vfio_ccw_mdev_release_dev(struct vfio_device *vdev)
static voidvfio_ccw_mdev_remove(struct mdev_device *mdev){
- structvfio_ccw_private*private = dev_get_drvdata(mdev-Quoted 1 line
dev.parent);
+ struct subchannel *sch =
to_subchannel(mdev->dev.parent); + structvfio_ccw_parent*parent =dev_get_drvdata(&sch->dev); + structvfio_ccw_private*private = dev_get_drvdata(&parent-Quoted 1 line
dev);
VFIO_CCW_MSG_EVENT(2, "sch %x.%x.%04x: remove\n",private->sch->schid.cssid,drivers/s390/cio/vfio_ccw_private.h +0
-0@@ -67,6 +67,21 @@ struct vfio_ccw_crw { struct crw crw; };drivers/s390/cio/vfio_ccw_private.h +15
-0+/** +* struct vfio_ccw_parent +* +* @dev: embedded device struct +* @parent: parent data structures for mdevs created +* @mdev_type(s): identifying information for mdevs created +*/ +struct vfio_ccw_parent { + struct device dev; + + struct mdev_parent parent; + struct mdev_type mdev_type; + struct mdev_type *mdev_types[1]; +}; +/**
* structvfio_ccw_private
* @vdev: Embedded VFIO devicedrivers/s390/cio/vfio_ccw_private.h +0
-1@@ -89,7 +104,6 @@ struct vfio_ccw_crw {* @io_work: work for deferral process of I/O handling * @crw_work: work for deferral process of CRW handling * @release_comp: synchronization helper for vfio device release -* @parent: parent data structures for mdevs created */ struct vfio_ccw_private { struct vfio_device vdev;@@ -116,10 +130,6 @@ struct vfio_ccw_private { struct work_struct crw_work;
struct completion release_comp; -
- struct mdev_parent parent;
- struct mdev_type mdev_type; - struct mdev_type *mdev_types[1]; }__aligned(8);
intvfio_ccw_sch_quiesce(struct subchannel *sch);
Matthew Rosato
maintainerRe: [PATCH v2 1/7] vfio/ccw: create a parent struct
Quoted 22 lines · Eric Farman
Quoted 21 lines · Eric Farman
Move the stuff associated with the mdev parent (and thus the subchannel struct) into its own struct, and leave the rest in the existing private structure.
The subchannel will point to the parent, and the parent will point to the private, for the areas where one or both are needed. Further separation of these structs will follow.
Signed-off-by Eric Farman <[email protected]>---
drivers/s390/cio/vfio_ccw_drv.c | 96 ++++++++++++++++++++++++--- --
drivers/s390/cio/vfio_ccw_ops.c | 8 ++-drivers/s390/cio/vfio_ccw_private.h| 20 ++++--3 files changed, 100 insertions(+), 24 deletions(-)drivers/s390/cio/vfio_ccw_drv.c +0
-0
...
Quoted 90 lines
Quoted 24 lines
static int
vfio_ccw_sch_probe(struct subchannel *sch){
struct pmcw *pmcw =&sch->schib.pmcw; structvfio_ccw_private*private;
+ structvfio_ccw_parent*parent;
int ret =-ENOMEM;
if (pmcw->qf) {drivers/s390/cio/vfio_ccw_drv.c +0
-0@@ -213,41 +246,62 @@ static int vfio_ccw_sch_probe(struct subchannel *sch) return -ENODEV; }
+ parent =kzalloc(sizeof(*parent), GFP_KERNEL); + if (IS_ERR(parent))
+ returnPTR_ERR(parent);drivers/s390/cio/vfio_ccw_drv.c +8
-0+ + dev_set_name(&parent->dev, "parent"); + parent->dev.parent = &sch->dev; + parent->dev.release = &vfio_ccw_free_parent; + ret = device_register(&parent->dev); + if (ret) + goto out_free; +Quoted 4 lines
private =
vfio_ccw_alloc_private(sch);
- if (IS_ERR(private))
+ if (IS_ERR(private)) {
+ put_device(&parent->dev);This should've been
device_unregister. (I could rearrange the code a bit to avoid the mix of returns/gotos around here, but since the whole series is trying to separate these two structs that seems unnecessary.)Quoted 26 lines
return
PTR_ERR(private);
+ }
- dev_set_drvdata(&sch->dev, private);
+ dev_set_drvdata(&sch->dev, parent);
+ dev_set_drvdata(&parent->dev, private);
- private->mdev_type.sysfs_name = "io";
- private->mdev_type.pretty_name = "I/O subchannel (Non-QDIO)"; - private->mdev_types[0] =&private->mdev_type;
- ret = mdev_register_parent(&private->parent,&sch->dev, + parent->mdev_type.sysfs_name = "io";
+ parent->mdev_type.pretty_name = "I/O subchannel (Non-QDIO)"; + parent->mdev_types[0] =&parent->mdev_type;
+ ret = mdev_register_parent(&parent->parent,&sch->dev,&vfio_ccw_mdev_driver, -private->mdev_types, 1); +parent->mdev_types, 1); if (ret)
- gotoout_free;
+ gotoout_unreg;
VFIO_CCW_MSG_EVENT(4, "bound to subchannel %x.%x.%04x\n",sch->schid.cssid,sch->schid.ssid,sch->schid.sch_no);
return 0;Quoted 8 lines
+out_unreg:
+ device_unregister(&parent->dev);
out_free:
+ dev_set_drvdata(&parent->dev, NULL);
dev_set_drvdata(&sch->dev, NULL);
vfio_ccw_free_private(private);
+ put_device(&parent->dev);While this...
Quoted 10 lines
return ret;
}
static voidvfio_ccw_sch_remove(struct subchannel *sch){
- structvfio_ccw_private*private = dev_get_drvdata(&sch-Quoted 1 line
dev);
+ struct
vfio_ccw_parent*parent =dev_get_drvdata(&sch->dev); + structvfio_ccw_private*private = dev_get_drvdata(&parent-Quoted 1 line
dev);
Quoted 9 lines
- mdev_unregister_parent(&private->parent);
+ mdev_unregister_parent(&parent->parent);
+ device_unregister(&parent->dev);
dev_set_drvdata(&sch->dev, NULL);
vfio_ccw_free_private(private);
+ put_device(&parent->dev);
Quoted 2 lines
...and this shouldn't even be there. Sorry for the brain fog.
Thanks, with these changes I no longer see refcount underflows. I'll continue reviewing with those changes presumed for v3.
Re: [PATCH v2 1/7] vfio/ccw: create a parent struct
In reply to Eric FarmanQuoted 85 lines · Eric Farman
Move the stuff associated with the mdev parent (and thus the subchannel struct) into its own struct, and leave the rest in the existing private structure.
The subchannel will point to the parent, and the parent will point to the private, for the areas where one or both are needed. Further separation of these structs will follow.
Signed-off-by Eric Farman <[email protected]>--- drivers/s390/cio/vfio_ccw_drv.c | 96 ++++++++++++++++++++++++----- drivers/s390/cio/vfio_ccw_ops.c | 8 ++- drivers/s390/cio/vfio_ccw_private.h | 20 ++++-- 3 files changed, 100 insertions(+), 24 deletions(-)drivers/s390/cio/vfio_ccw_drv.c +35
-2@@ -36,10 +36,19 @@ debug_info_t *vfio_ccw_debug_trace_id;*/ int vfio_ccw_sch_quiesce (struct subchannel *sch) { -struct vfio_ccw_private *private =dev_get_drvdata (&sch->dev); +struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); +struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev);DECLARE_COMPLETION_ONSTACK (completion);int iretry, ret =0 ; +/* +* Probably an impossible situation, after being called through +* FSM callbacks. But in the event it did, register a warning +* and return as if things were fine. +*/ +if (WARN_ON (!private)) +return 0 ; + iretry =255 ; do {@@ -121,7 +130,22 @@ static void vfio_ccw_crw_todo(struct work_struct *work)*/ static void vfio_ccw_sch_irq (struct subchannel *sch) { -struct vfio_ccw_private *private =dev_get_drvdata (&sch->dev); +struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); +struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev); + +/* +* The subchannel should still be disabled at this point, +* so an interrupt would be quite surprising. As with an +* interrupt while the FSM is closed, let's attempt to +* disable the subchannel again. +*/ +if (!private) { +VFIO_CCW_MSG_EVENT (2 ,"sch %x.%x.%04x: unexpected interrupt\n" , + sch->schid.cssid, sch->schid.ssid, sch->schid.sch_no); + +cio_disable_subchannel (sch); +return ; + }inc_irq_stat (IRQIO_CIO );vfio_ccw_fsm_event (private,VFIO_CCW_EVENT_INTERRUPT );@@ -201,10 +225,19 @@ static void vfio_ccw_free_private(struct vfio_ccw_private *private)mutex_destroy (&private->io_mutex);kfree (private); } + +static void vfio_ccw_free_parent (struct device *dev) +{ + struct vfio_ccw_parent *parent = container_of(dev, struct vfio_ccw_parent, dev); + +kfree (parent); +} +static int vfio_ccw_sch_probe (struct subchannel *sch) {struct pmcw *pmcw = &sch->schib.pmcw;struct vfio_ccw_private *private; +struct vfio_ccw_parent *parent;int ret = -ENOMEM ;if (pmcw->qf) {
drivers/s390/cio/vfio_ccw_drv.c static int vfio_ccw_sch_probe(struct subchannel *sch) · line 251
Quoted 6 lines
drivers/s390/cio/vfio_ccw_drv.c +3
-0@@ -213,41 +246,62 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)return -ENODEV ; } + parent =kzalloc (sizeof (*parent),GFP_KERNEL ); +if (IS_ERR (parent)) +return PTR_ERR (parent);
The error here would be a null ptr due to failed alloc, how about:
if (!parent)
return -ENOMEM;
drivers/s390/cio/vfio_ccw_drv.c static int vfio_ccw_sch_probe(struct subchannel *sch) · line 262
Quoted 12 lines
drivers/s390/cio/vfio_ccw_drv.c +10
-1+ +dev_set_name (&parent->dev,"parent" ); + parent->dev.parent = &sch->dev; + parent->dev.release = &vfio_ccw_free_parent; + ret =device_register (&parent->dev); +if (ret) + goto out_free; + private =vfio_ccw_alloc_private (sch); -if (IS_ERR (private)) +if (IS_ERR (private)) { +put_device (&parent->dev);
As you said earlier, unregister_device()
Quoted 23 lines
drivers/s390/cio/vfio_ccw_drv.c +9
-7return PTR_ERR (private); + } -dev_set_drvdata (&sch->dev, private); +dev_set_drvdata (&sch->dev, parent); +dev_set_drvdata (&parent->dev, private); - private->mdev_type.sysfs_name ="io" ; - private->mdev_type.pretty_name ="I/O subchannel (Non-QDIO)" ; - private->mdev_types[0 ] = &private->mdev_type; - ret =mdev_register_parent (&private->parent, &sch->dev, + parent->mdev_type.sysfs_name ="io" ; + parent->mdev_type.pretty_name ="I/O subchannel (Non-QDIO)" ; + parent->mdev_types[0 ] = &parent->mdev_type; + ret =mdev_register_parent (&parent->parent, &sch->dev, &vfio_ccw_mdev_driver, - private->mdev_types,1 ); + parent->mdev_types,1 );if (ret) - goto out_free; + goto out_unreg; VFIO_CCW_MSG_EVENT(4, "bound to subchannel %x.%x.%04x\n",
drivers/s390/cio/vfio_ccw_drv.c static int vfio_ccw_sch_probe(struct subchannel *sch) · line 288
Quoted 10 lines
drivers/s390/cio/vfio_ccw_drv.c +3
-0sch->schid.cssid, sch->schid.ssid, sch->schid.sch_no);return 0 ; +out_unreg: +device_unregister (&parent->dev); out_free: +dev_set_drvdata (&parent->dev,NULL );dev_set_drvdata (&sch->dev,NULL );vfio_ccw_free_private (private);
if device_register(&parent->dev) failed above, you will goto out_free and call vfio_ccw_free_private before having done vfio_ccw_alloc_private (e.g. private==NULL). Doesn't look like vfio_ccw_free_private handles that -- Either check !parent here or add a check to vfio_ccw_free_private.
drivers/s390/cio/vfio_ccw_drv.c static int vfio_ccw_sch_probe(struct subchannel *sch) · line 289
Quoted 1 line
drivers/s390/cio/vfio_ccw_drv.c +1
-0+put_device (&parent->dev);
As you said in your other reply, this goes away
Quoted 7 lines
drivers/s390/cio/vfio_ccw_drv.c +1
-1return ret; }static void vfio_ccw_sch_remove (struct subchannel *sch) { -struct vfio_ccw_private *private =dev_get_drvdata (&sch->dev); +struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev);
drivers/s390/cio/vfio_ccw_drv.c static int vfio_ccw_sch_probe(struct subchannel *sch) · line 304
Quoted 10 lines
drivers/s390/cio/vfio_ccw_drv.c +4
-1+struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev); -mdev_unregister_parent (&private->parent); +mdev_unregister_parent (&parent->parent); +device_unregister (&parent->dev);dev_set_drvdata (&sch->dev,NULL );vfio_ccw_free_private (private); +put_device (&parent->dev);
As you said in your other reply, this goes away
The rest looks fine, with these changes you can have:
Eric Farman
maintainerPATCH v2 2/7 vfio/ccw: remove private->sch
In reply to Eric FarmanThese places all rely on the ability to jump from a private struct back to the subchannel struct. Rather than keeping a copy in our back pocket, let's use the relationship provided by the vfio_device embedded within the private.
--- drivers/s390/cio/vfio_ccw_chp.c | 5 +++-- drivers/s390/cio/vfio_ccw_drv.c | 3 +-- drivers/s390/cio/vfio_ccw_fsm.c | 27 ++++++++++++--------------- drivers/s390/cio/vfio_ccw_ops.c | 12 ++++++------ drivers/s390/cio/vfio_ccw_private.h | 7 ++++--- 5 files changed, 26 insertions(+), 28 deletions(-)
drivers/s390/cio/vfio_ccw_chp.c +3 -2
@@ -16,6 +16,7 @@ static ssize_t vfio_ccw_schib_region_read(struct vfio_ccw_private *private, char __user *buf, size_t count, loff_t *ppos) { + struct subchannel *sch = to_subchannel(private->vdev.dev->parent);unsigned int i =VFIO_CCW_OFFSET_TO_INDEX (*ppos) -VFIO_CCW_NUM_REGIONS ;loff_t pos = *ppos &VFIO_CCW_OFFSET_MASK ;struct ccw_schib_region *region;
@@ -27,12 +28,12 @@ static ssize_t vfio_ccw_schib_region_read(struct vfio_ccw_private *private,mutex_lock (&private->io_mutex); region = private->region[i].data; -if (cio_update_schib (private->sch)) { +if (cio_update_schib (sch)) { ret = -ENODEV ; goto out; } -memcpy (region, &private->sch->schib,sizeof (*region)); +memcpy (region, &sch->schib,sizeof (*region));if (copy_to_user (buf, (void *)region + pos, count)) { ret = -EFAULT ;
drivers/s390/cio/vfio_ccw_drv.c +1 -2
@@ -159,7 +159,6 @@ static struct vfio_ccw_private *vfio_ccw_alloc_private(struct subchannel *sch)if (!private)return ERR_PTR (-ENOMEM ); - private->sch = sch;mutex_init (&private->io_mutex); private->state =VFIO_CCW_STATE_STANDBY ;INIT_LIST_HEAD (&private->crw);
@@ -395,7 +394,7 @@ static int vfio_ccw_chp_event(struct subchannel *sch,if (!private || !mask)return 0 ; -trace_vfio_ccw_chp_event (private->sch->schid, mask, event); +trace_vfio_ccw_chp_event (sch->schid, mask, event); VFIO_CCW_MSG_EVENT(2, "sch %x.%x.%04x: mask=0x%x event=%d\n", sch->schid.cssid, sch->schid.ssid, sch->schid.sch_no,
drivers/s390/cio/vfio_ccw_fsm.c +12 -15
@@ -18,15 +18,13 @@static int fsm_io_helper (struct vfio_ccw_private *private) { -struct subchannel *sch; +struct subchannel *sch =to_subchannel (private->vdev.dev->parent);union orb *orb;int ccode;__u8 lpm;unsigned long flags;int ret; - sch = private->sch; -spin_lock_irqsave (sch->lock, flags); orb =cp_get_orb (&private->cp, (u32 )(addr_t )sch, sch->lpm);
@@ -80,13 +78,11 @@ static int fsm_io_helper(struct vfio_ccw_private *private)static int fsm_do_halt (struct vfio_ccw_private *private) { -struct subchannel *sch; +struct subchannel *sch =to_subchannel (private->vdev.dev->parent);unsigned long flags;int ccode;int ret; - sch = private->sch; -spin_lock_irqsave (sch->lock, flags);VFIO_CCW_TRACE_EVENT (2 ,"haltIO" );
@@ -121,13 +117,11 @@ static int fsm_do_halt(struct vfio_ccw_private *private)static int fsm_do_clear (struct vfio_ccw_private *private) { -struct subchannel *sch; +struct subchannel *sch =to_subchannel (private->vdev.dev->parent);unsigned long flags;int ccode;int ret; - sch = private->sch; -spin_lock_irqsave (sch->lock, flags);VFIO_CCW_TRACE_EVENT (2 ,"clearIO" );
@@ -160,7 +154,7 @@ static int fsm_do_clear(struct vfio_ccw_private *private)static void fsm_notoper (struct vfio_ccw_private *private,enum vfio_ccw_event event) { -struct subchannel *sch = private->sch; +struct subchannel *sch =to_subchannel (private->vdev.dev->parent); VFIO_CCW_MSG_EVENT(2, "sch %x.%x.%04x: notoper event %x state %x\n", sch->schid.cssid,
@@ -228,7 +222,7 @@ static void fsm_async_retry(struct vfio_ccw_private *private,static void fsm_disabled_irq (struct vfio_ccw_private *private,enum vfio_ccw_event event) { -struct subchannel *sch = private->sch; +struct subchannel *sch =to_subchannel (private->vdev.dev->parent);/* * An interrupt in a disabled state means a previous disable was not
@@ -238,7 +232,9 @@ static void fsm_disabled_irq(struct vfio_ccw_private *private, }inline struct subchannel_id get_schid (struct vfio_ccw_private *p) { -return p->sch->schid; +struct subchannel *sch =to_subchannel (p->vdev.dev->parent); + +return sch->schid; }/*
@@ -360,10 +356,11 @@ static void fsm_async_request(struct vfio_ccw_private *private,static void fsm_irq (struct vfio_ccw_private *private,enum vfio_ccw_event event) { +struct subchannel *sch =to_subchannel (private->vdev.dev->parent);struct irb *irb =this_cpu_ptr (&cio_irb);VFIO_CCW_TRACE_EVENT (6 ,"IRQ" ); -VFIO_CCW_TRACE_EVENT (6 ,dev_name (&private->sch->dev)); +VFIO_CCW_TRACE_EVENT (6 ,dev_name (&sch->dev));memcpy (&private->irb, irb,sizeof (*irb));
@@ -376,7 +373,7 @@ static void fsm_irq(struct vfio_ccw_private *private,static void fsm_open (struct vfio_ccw_private *private,enum vfio_ccw_event event) { -struct subchannel *sch = private->sch; +struct subchannel *sch =to_subchannel (private->vdev.dev->parent);int ret;spin_lock_irq (sch->lock);
@@ -397,7 +394,7 @@ static void fsm_open(struct vfio_ccw_private *private,static void fsm_close (struct vfio_ccw_private *private,enum vfio_ccw_event event) { -struct subchannel *sch = private->sch; +struct subchannel *sch =to_subchannel (private->vdev.dev->parent);int ret;spin_lock_irq (sch->lock);
drivers/s390/cio/vfio_ccw_ops.c +6 -6
@@ -68,9 +68,9 @@ static int vfio_ccw_mdev_probe(struct mdev_device *mdev)return ret;VFIO_CCW_MSG_EVENT (2 ,"sch %x.%x.%04x: create\n" , - private->sch->schid.cssid, - private->sch->schid.ssid, - private->sch->schid.sch_no); + sch->schid.cssid, + sch->schid.ssid, + sch->schid.sch_no); ret =vfio_register_emulated_iommu_dev (&private->vdev);if (ret)
@@ -107,9 +107,9 @@ static void vfio_ccw_mdev_remove(struct mdev_device *mdev)struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev);VFIO_CCW_MSG_EVENT (2 ,"sch %x.%x.%04x: remove\n" , - private->sch->schid.cssid, - private->sch->schid.ssid, - private->sch->schid.sch_no); + sch->schid.cssid, + sch->schid.ssid, + sch->schid.sch_no);vfio_unregister_group_dev (&private->vdev);
drivers/s390/cio/vfio_ccw_private.h +4 -3
@@ -85,7 +85,6 @@ struct vfio_ccw_parent {/** * struct vfio_ccw_private * @vdev: Embedded VFIO device -* @sch: pointer to the subchannel * @state: internal state of the device * @completion: synchronization helper of the I/O completion * @io_region: MMIO region to input/output I/O arguments/results
@@ -107,7 +106,6 @@ struct vfio_ccw_parent {*/ struct vfio_ccw_private {struct vfio_device vdev; -struct subchannel *sch;int state;struct completion *completion;struct ccw_io_region *io_region;
@@ -172,7 +170,10 @@ extern fsm_func_t *vfio_ccw_jumptable[NR_VFIO_CCW_STATES][NR_VFIO_CCW_EVENTS];static inline void vfio_ccw_fsm_event (struct vfio_ccw_private *private,enum vfio_ccw_event event) { -trace_vfio_ccw_fsm_event (private->sch->schid, private->state, event); +struct subchannel *sch =to_subchannel (private->vdev.dev->parent); + +if (sch) +trace_vfio_ccw_fsm_event (sch->schid, private->state, event); vfio_ccw_jumptable[private->state][event](private, event); }
Signature · 1 line
2.34.1
Eric Farman
maintainerPATCH v2 3/7 vfio/ccw: move private initialization to callback
In reply to Eric FarmanThere's already a device initialization callback that is used to initialize the release completion workaround that was introduced by commit ebb72b765fb49 ("vfio/ccw: Use the new device life cycle helpers").
Move the other elements of the vfio_ccw_private struct that require distinct initialization over to that routine.
With that done, the vfio_ccw_alloc_private routine only does a kzalloc, so fold it inline.
--- drivers/s390/cio/vfio_ccw_drv.c | 70 +++-------------------------- drivers/s390/cio/vfio_ccw_ops.c | 43 ++++++++++++++++++ drivers/s390/cio/vfio_ccw_private.h | 7 ++- 3 files changed, 56 insertions(+), 64 deletions(-)
drivers/s390/cio/vfio_ccw_drv.c +7 -63
@@ -23,10 +23,10 @@#include "vfio_ccw_private.h" struct workqueue_struct *vfio_ccw_work_q; -static struct kmem_cache *vfio_ccw_io_region; -static struct kmem_cache *vfio_ccw_cmd_region; -static struct kmem_cache *vfio_ccw_schib_region; -static struct kmem_cache *vfio_ccw_crw_region; +struct kmem_cache *vfio_ccw_io_region; +struct kmem_cache *vfio_ccw_cmd_region; +struct kmem_cache *vfio_ccw_schib_region; +struct kmem_cache *vfio_ccw_crw_region;debug_info_t *vfio_ccw_debug_msg_id;debug_info_t *vfio_ccw_debug_trace_id;
@@ -79,7 +79,7 @@ int vfio_ccw_sch_quiesce(struct subchannel *sch)return ret; } -static void vfio_ccw_sch_io_todo (struct work_struct *work) +void vfio_ccw_sch_io_todo (struct work_struct *work) {struct vfio_ccw_private *private;struct irb *irb;
@@ -115,7 +115,7 @@ static void vfio_ccw_sch_io_todo(struct work_struct *work)eventfd_signal (private->io_trigger,1 ); } -static void vfio_ccw_crw_todo (struct work_struct *work) +void vfio_ccw_crw_todo (struct work_struct *work) {struct vfio_ccw_private *private;
@@ -151,62 +151,6 @@ static void vfio_ccw_sch_irq(struct subchannel *sch)vfio_ccw_fsm_event (private,VFIO_CCW_EVENT_INTERRUPT ); } -static struct vfio_ccw_private *vfio_ccw_alloc_private (struct subchannel *sch) -{ -struct vfio_ccw_private *private; - - private =kzalloc (sizeof (*private),GFP_KERNEL ); -if (!private) -return ERR_PTR (-ENOMEM ); - -mutex_init (&private->io_mutex); - private->state =VFIO_CCW_STATE_STANDBY ; -INIT_LIST_HEAD (&private->crw); -INIT_WORK (&private->io_work, vfio_ccw_sch_io_todo); -INIT_WORK (&private->crw_work, vfio_ccw_crw_todo); - - private->cp.guest_cp =kcalloc (CCWCHAIN_LEN_MAX ,sizeof (struct ccw1 ), -GFP_KERNEL ); -if (!private->cp.guest_cp) - goto out_free_private; - - private->io_region =kmem_cache_zalloc (vfio_ccw_io_region, -GFP_KERNEL |GFP_DMA ); -if (!private->io_region) - goto out_free_cp; - - private->cmd_region =kmem_cache_zalloc (vfio_ccw_cmd_region, -GFP_KERNEL |GFP_DMA ); -if (!private->cmd_region) - goto out_free_io; - - private->schib_region =kmem_cache_zalloc (vfio_ccw_schib_region, -GFP_KERNEL |GFP_DMA ); - -if (!private->schib_region) - goto out_free_cmd; - - private->crw_region =kmem_cache_zalloc (vfio_ccw_crw_region, -GFP_KERNEL |GFP_DMA ); - -if (!private->crw_region) - goto out_free_schib; -return private; - -out_free_schib: -kmem_cache_free (vfio_ccw_schib_region, private->schib_region); -out_free_cmd: -kmem_cache_free (vfio_ccw_cmd_region, private->cmd_region); -out_free_io: -kmem_cache_free (vfio_ccw_io_region, private->io_region); -out_free_cp: -kfree (private->cp.guest_cp); -out_free_private: -mutex_destroy (&private->io_mutex); -kfree (private); -return ERR_PTR (-ENOMEM ); -} -static void vfio_ccw_free_private (struct vfio_ccw_private *private) {struct vfio_ccw_crw *crw, *temp;
@@ -256,7 +200,7 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)if (ret) goto out_free; - private =vfio_ccw_alloc_private (sch); + private =kzalloc (sizeof (*private),GFP_KERNEL );if (IS_ERR (private)) {put_device (&parent->dev);return PTR_ERR (private);
drivers/s390/cio/vfio_ccw_ops.c +43 -0
51 lines not on this page · raw message
drivers/s390/cio/vfio_ccw_private.h +6 -1
@@ -131,6 +131,8 @@ struct vfio_ccw_private { }__aligned(8) ;int vfio_ccw_sch_quiesce (struct subchannel *sch); +void vfio_ccw_sch_io_todo (struct work_struct *work); +void vfio_ccw_crw_todo (struct work_struct *work);extern struct mdev_driver vfio_ccw_mdev_driver;
@@ -178,7 +180,10 @@ static inline void vfio_ccw_fsm_event(struct vfio_ccw_private *private, }extern struct workqueue_struct *vfio_ccw_work_q; - +extern struct kmem_cache *vfio_ccw_io_region; +extern struct kmem_cache *vfio_ccw_cmd_region; +extern struct kmem_cache *vfio_ccw_schib_region; +extern struct kmem_cache *vfio_ccw_crw_region;/* s390 debug feature, similar to base cio */ extern debug_info_t *vfio_ccw_debug_msg_id;
Signature · 1 line
2.34.1
Eric Farman
maintainerPATCH v2 4/7 vfio/ccw: move private to mdev lifecycle
In reply to Eric FarmanNow that the mdev parent data is split out into its own struct, it is safe to move the remaining private data to follow the mdev probe/remove lifecycle. The mdev parent data will remain where it is, and follow the subchannel and the css driver interfaces.
--- drivers/s390/cio/vfio_ccw_drv.c | 15 +-------------- drivers/s390/cio/vfio_ccw_ops.c | 26 +++++++++++++------------- drivers/s390/cio/vfio_ccw_private.h | 2 ++ 3 files changed, 16 insertions(+), 27 deletions(-)
drivers/s390/cio/vfio_ccw_drv.c +1 -14
@@ -151,7 +151,7 @@ static void vfio_ccw_sch_irq(struct subchannel *sch)vfio_ccw_fsm_event (private,VFIO_CCW_EVENT_INTERRUPT ); } -static void vfio_ccw_free_private (struct vfio_ccw_private *private) +void vfio_ccw_free_private (struct vfio_ccw_private *private) {struct vfio_ccw_crw *crw, *temp;
@@ -179,7 +179,6 @@ static void vfio_ccw_free_parent(struct device *dev)static int vfio_ccw_sch_probe (struct subchannel *sch) {struct pmcw *pmcw = &sch->schib.pmcw; -struct vfio_ccw_private *private;struct vfio_ccw_parent *parent;int ret = -ENOMEM ;
@@ -200,14 +199,7 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)if (ret) goto out_free; - private =kzalloc (sizeof (*private),GFP_KERNEL ); -if (IS_ERR (private)) { -put_device (&parent->dev); -return PTR_ERR (private); - } -dev_set_drvdata (&sch->dev, parent); -dev_set_drvdata (&parent->dev, private); parent->mdev_type.sysfs_name ="io" ; parent->mdev_type.pretty_name ="I/O subchannel (Non-QDIO)" ;
@@ -226,9 +218,7 @@ static int vfio_ccw_sch_probe(struct subchannel *sch) out_unreg:device_unregister (&parent->dev); out_free: -dev_set_drvdata (&parent->dev,NULL );dev_set_drvdata (&sch->dev,NULL ); -vfio_ccw_free_private (private);put_device (&parent->dev);return ret; }
@@ -236,14 +226,11 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)static void vfio_ccw_sch_remove (struct subchannel *sch) {struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); -struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev);mdev_unregister_parent (&parent->parent);device_unregister (&parent->dev);dev_set_drvdata (&sch->dev,NULL ); - -vfio_ccw_free_private (private);put_device (&parent->dev); VFIO_CCW_MSG_EVENT(4, "unbound from subchannel %x.%x.%04x\n",
drivers/s390/cio/vfio_ccw_ops.c +13 -13
@@ -100,15 +100,20 @@ static int vfio_ccw_mdev_probe(struct mdev_device *mdev) {struct subchannel *sch =to_subchannel (mdev->dev.parent);struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); -struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev); +struct vfio_ccw_private *private;int ret; -if (private->state ==VFIO_CCW_STATE_NOT_OPER ) -return -ENODEV ; + private =kzalloc (sizeof (*private),GFP_KERNEL ); +if (!private) +return -ENOMEM ; ret =vfio_init_device (&private->vdev, &mdev->dev, &vfio_ccw_dev_ops); -if (ret) +if (ret) { +kfree (private);return ret; + } + +dev_set_drvdata (&parent->dev, private); VFIO_CCW_MSG_EVENT(2, "sch %x.%x.%04x: create\n", sch->schid.cssid,
@@ -122,6 +127,7 @@ static int vfio_ccw_mdev_probe(struct mdev_device *mdev)return 0 ; err_put_vdev: +dev_set_drvdata (&parent->dev,NULL );vfio_put_device (&private->vdev);return ret; }
@@ -131,15 +137,6 @@ static void vfio_ccw_mdev_release_dev(struct vfio_device *vdev)struct vfio_ccw_private *private = container_of(vdev, struct vfio_ccw_private, vdev); -/* -* We cannot free vfio_ccw_private here because it includes -* parent info which must be free'ed by css driver. -* -* Use a workaround by memset'ing the core device part and -* then notifying the remove path that all active references -* to this device have been released. -*/ -memset (vdev,0 ,sizeof (*vdev));complete (&private->release_comp); }
@@ -156,6 +153,7 @@ static void vfio_ccw_mdev_remove(struct mdev_device *mdev)vfio_unregister_group_dev (&private->vdev); +dev_set_drvdata (&parent->dev,NULL );vfio_put_device (&private->vdev);/* * Wait for all active references on mdev are released so it
@@ -166,6 +164,8 @@ static void vfio_ccw_mdev_remove(struct mdev_device *mdev)* cycle. */ wait_for_completion (&private->release_comp); + +vfio_ccw_free_private (private); }static int vfio_ccw_mdev_open_device (struct vfio_device *vdev)
drivers/s390/cio/vfio_ccw_private.h +2 -0
@@ -134,6 +134,8 @@ int vfio_ccw_sch_quiesce(struct subchannel *sch);void vfio_ccw_sch_io_todo (struct work_struct *work);void vfio_ccw_crw_todo (struct work_struct *work); +void vfio_ccw_free_private (struct vfio_ccw_private *private); +extern struct mdev_driver vfio_ccw_mdev_driver;/*
Signature · 1 line
2.34.1
Re: [PATCH v2 4/7] vfio/ccw: move private to mdev lifecycle
Quoted 13 lines · Eric Farman
Now that the mdev parent data is split out into its own struct, it is safe to move the remaining private data to follow the mdev probe/remove lifecycle. The mdev parent data will remain where it is, and follow the subchannel and the css driver interfaces.
Signed-off-by Eric Farman <[email protected]>--- drivers/s390/cio/vfio_ccw_drv.c | 15 +-------------- drivers/s390/cio/vfio_ccw_ops.c | 26 +++++++++++++------------- drivers/s390/cio/vfio_ccw_private.h | 2 ++ 3 files changed, 16 insertions(+), 27 deletions(-)
...
Quoted 7 lines
drivers/s390/cio/vfio_ccw_ops.c +0
-0@@ -100,15 +100,20 @@ static int vfio_ccw_mdev_probe(struct mdev_device *mdev) {struct subchannel *sch =to_subchannel (mdev->dev.parent);
drivers/s390/cio/vfio_ccw_ops.c static int vfio_ccw_mdev_probe(struct mdev_device *mdev) · line 108
Quoted 10 lines
drivers/s390/cio/vfio_ccw_ops.c +4
-3struct vfio_ccw_parent *parent =dev_get_drvdata (&sch->dev); -struct vfio_ccw_private *private =dev_get_drvdata (&parent->dev); +struct vfio_ccw_private *private;int ret; -if (private->state ==VFIO_CCW_STATE_NOT_OPER ) -return -ENODEV ; + private =kzalloc (sizeof (*private),GFP_KERNEL ); +if (!private) +return -ENOMEM ;
Ha, looks like you time traveled and took my advice :)
In fact it looks like some of my other comments from patch 1 get cleaned up here too -- but would still be good to make those changes in patch 1 for completeness/bisect.
Eric Farman
maintainerRe: [PATCH v2 4/7] vfio/ccw: move private to mdev lifecycle
Quoted 40 lines · Matthew Rosato
Quoted 14 lines · Eric Farman
Now that the mdev parent data is split out into its own struct, it is safe to move the remaining private data to follow the mdev probe/remove lifecycle. The mdev parent data will remain where it is, and follow the subchannel and the css driver interfaces.
Signed-off-by Eric Farman <[email protected]>---
drivers/s390/cio/vfio_ccw_drv.c | 15 +-------------- drivers/s390/cio/vfio_ccw_ops.c | 26 +++++++++++++------------ -
drivers/s390/cio/vfio_ccw_private.h | 2 ++3 files changed, 16 insertions(+), 27 deletions(-)...
Quoted 13 lines
drivers/s390/cio/vfio_ccw_ops.c +0
-0@@ -100,15 +100,20 @@ static int vfio_ccw_mdev_probe(struct mdev_device *mdev) { struct subchannel *sch = to_subchannel(mdev->dev.parent);struct
vfio_ccw_parent*parent = dev_get_drvdata(&sch-Quoted 1 line
dev);
- struct
vfio_ccw_private*private = dev_get_drvdata(&parent-Quoted 1 line
dev);
Quoted 8 lines
+ struct
vfio_ccw_private*private;
int ret;
- if (private->state==VFIO_CCW_STATE_NOT_OPER) - return-ENODEV;
+ private =kzalloc(sizeof(*private), GFP_KERNEL); + if (!private)
+ return-ENOMEM;
Quoted 1 line
Ha, looks like you time traveled and took my advice :)
Ha, I forgot I did this in the future. :)
Quoted 4 lines
In fact it looks like some of my other comments from patch 1 get cleaned up here too -- but would still be good to make those changes in patch 1 for completeness/bisect.
Agreed, I'll pull those down to patch 1; thanks.
Quoted 3 lines
Reviewed-by Matthew Rosato <[email protected]>
Eric Farman
maintainerPATCH v2 5/7 vfio/ccw: remove release completion
In reply to Eric FarmanThere's enough separation between the parent and private structs now, that it is fine to remove the release completion hack.
--- drivers/s390/cio/vfio_ccw_ops.c | 14 +------------- drivers/s390/cio/vfio_ccw_private.h | 3 --- 2 files changed, 1 insertion(+), 16 deletions(-)
drivers/s390/cio/vfio_ccw_ops.c +1 -13
@@ -54,7 +54,6 @@ static int vfio_ccw_mdev_init_dev(struct vfio_device *vdev)INIT_LIST_HEAD (&private->crw);INIT_WORK (&private->io_work, vfio_ccw_sch_io_todo);INIT_WORK (&private->crw_work, vfio_ccw_crw_todo); -init_completion (&private->release_comp); private->cp.guest_cp =kcalloc (CCWCHAIN_LEN_MAX ,sizeof (struct ccw1 ),GFP_KERNEL );
@@ -137,7 +136,7 @@ static void vfio_ccw_mdev_release_dev(struct vfio_device *vdev)struct vfio_ccw_private *private = container_of(vdev, struct vfio_ccw_private, vdev); -complete (&private->release_comp); +vfio_ccw_free_private (private); }static void vfio_ccw_mdev_remove (struct mdev_device *mdev)
@@ -155,17 +154,6 @@ static void vfio_ccw_mdev_remove(struct mdev_device *mdev)dev_set_drvdata (&parent->dev,NULL );vfio_put_device (&private->vdev); -/* -* Wait for all active references on mdev are released so it -* is safe to defer kfree() to a later point. -* -* TODO: the clean fix is to split parent/mdev info from ccw -* private structure so each can be managed in its own life -* cycle. -*/ -wait_for_completion (&private->release_comp); - -vfio_ccw_free_private (private); }static int vfio_ccw_mdev_open_device (struct vfio_device *vdev)
drivers/s390/cio/vfio_ccw_private.h +0 -3
@@ -102,7 +102,6 @@ struct vfio_ccw_parent {* @req_trigger: eventfd ctx for signaling userspace to return device * @io_work: work for deferral process of I/O handling * @crw_work: work for deferral process of CRW handling -* @release_comp: synchronization helper for vfio device release */ struct vfio_ccw_private {struct vfio_device vdev;
@@ -126,8 +125,6 @@ struct vfio_ccw_private {struct eventfd_ctx *req_trigger;struct work_struct io_work;struct work_struct crw_work; - -struct completion release_comp; }__aligned(8) ;int vfio_ccw_sch_quiesce (struct subchannel *sch);
Signature · 1 line
2.34.1
Re: [PATCH v2 5/7] vfio/ccw: remove release completion
Quoted 5 lines · Eric Farman
There's enough separation between the parent and private structs now, that it is fine to remove the release completion hack.
Signed-off-by Eric Farman <[email protected]>Reviewed-by Kevin Tian <[email protected]>
Quoted 65 lines
--- drivers/s390/cio/vfio_ccw_ops.c | 14 +------------- drivers/s390/cio/vfio_ccw_private.h | 3 --- 2 files changed, 1 insertion(+), 16 deletions(-)drivers/s390/cio/vfio_ccw_ops.c +1
-13@@ -54,7 +54,6 @@ static int vfio_ccw_mdev_init_dev(struct vfio_device *vdev)INIT_LIST_HEAD (&private->crw);INIT_WORK (&private->io_work, vfio_ccw_sch_io_todo);INIT_WORK (&private->crw_work, vfio_ccw_crw_todo); -init_completion (&private->release_comp); private->cp.guest_cp =kcalloc (CCWCHAIN_LEN_MAX ,sizeof (struct ccw1 ),GFP_KERNEL );@@ -137,7 +136,7 @@ static void vfio_ccw_mdev_release_dev(struct vfio_device *vdev)struct vfio_ccw_private *private = container_of(vdev, struct vfio_ccw_private, vdev); -complete (&private->release_comp); +vfio_ccw_free_private (private); }static void vfio_ccw_mdev_remove (struct mdev_device *mdev)@@ -155,17 +154,6 @@ static void vfio_ccw_mdev_remove(struct mdev_device *mdev)dev_set_drvdata (&parent->dev,NULL );vfio_put_device (&private->vdev); -/* -* Wait for all active references on mdev are released so it -* is safe to defer kfree() to a later point. -* -* TODO: the clean fix is to split parent/mdev info from ccw -* private structure so each can be managed in its own life -* cycle. -*/ -wait_for_completion (&private->release_comp); - -vfio_ccw_free_private (private); }static int vfio_ccw_mdev_open_device (struct vfio_device *vdev)drivers/s390/cio/vfio_ccw_private.h +0
-3@@ -102,7 +102,6 @@ struct vfio_ccw_parent {* @req_trigger: eventfd ctx for signaling userspace to return device * @io_work: work for deferral process of I/O handling * @crw_work: work for deferral process of CRW handling -* @release_comp: synchronization helper for vfio device release */ struct vfio_ccw_private {struct vfio_device vdev;@@ -126,8 +125,6 @@ struct vfio_ccw_private {struct eventfd_ctx *req_trigger;struct work_struct io_work;struct work_struct crw_work; - -struct completion release_comp; }__aligned(8) ;int vfio_ccw_sch_quiesce (struct subchannel *sch);
Eric Farman
maintainerPATCH v2 6/7 vfio/ccw: replace vfio_init_device with _alloc_
In reply to Eric FarmanNow that we have a reasonable separation of structs that follow the subchannel and mdev lifecycles, there's no reason we can't call the official vfio_alloc_device routine for our private data, and behave like everyone else.
--- drivers/s390/cio/vfio_ccw_drv.c | 18 ------------------ drivers/s390/cio/vfio_ccw_ops.c | 28 ++++++++++++++++++---------- drivers/s390/cio/vfio_ccw_private.h | 2 -- drivers/vfio/vfio_main.c | 10 +++++----- include/linux/vfio.h | 2 -- 5 files changed, 23 insertions(+), 37 deletions(-)
drivers/s390/cio/vfio_ccw_drv.c +0 -18
@@ -151,24 +151,6 @@ static void vfio_ccw_sch_irq(struct subchannel *sch)vfio_ccw_fsm_event (private,VFIO_CCW_EVENT_INTERRUPT ); } -void vfio_ccw_free_private (struct vfio_ccw_private *private) -{ -struct vfio_ccw_crw *crw, *temp; - -list_for_each_entry_safe (crw, temp, &private->crw, next) { -list_del (&crw->next); -kfree (crw); - } - -kmem_cache_free (vfio_ccw_crw_region, private->crw_region); -kmem_cache_free (vfio_ccw_schib_region, private->schib_region); -kmem_cache_free (vfio_ccw_cmd_region, private->cmd_region); -kmem_cache_free (vfio_ccw_io_region, private->io_region); -kfree (private->cp.guest_cp); -mutex_destroy (&private->io_mutex); -kfree (private); -} -static void vfio_ccw_free_parent (struct device *dev) { struct vfio_ccw_parent *parent = container_of(dev, struct vfio_ccw_parent, dev);
drivers/s390/cio/vfio_ccw_ops.c +18 -10
@@ -102,15 +102,10 @@ static int vfio_ccw_mdev_probe(struct mdev_device *mdev)struct vfio_ccw_private *private;int ret; - private =kzalloc (sizeof (*private),GFP_KERNEL ); -if (!private) -return -ENOMEM ; - - ret =vfio_init_device (&private->vdev, &mdev->dev, &vfio_ccw_dev_ops); -if (ret) { -kfree (private); -return ret; - } + private =vfio_alloc_device (vfio_ccw_private, vdev, &mdev->dev, + &vfio_ccw_dev_ops); +if (IS_ERR (private)) +return PTR_ERR (private);dev_set_drvdata (&parent->dev, private);
@@ -135,8 +130,21 @@ static void vfio_ccw_mdev_release_dev(struct vfio_device *vdev) {struct vfio_ccw_private *private = container_of(vdev, struct vfio_ccw_private, vdev); +struct vfio_ccw_crw *crw, *temp; + +list_for_each_entry_safe (crw, temp, &private->crw, next) { +list_del (&crw->next); +kfree (crw); + } + +kmem_cache_free (vfio_ccw_crw_region, private->crw_region); +kmem_cache_free (vfio_ccw_schib_region, private->schib_region); +kmem_cache_free (vfio_ccw_cmd_region, private->cmd_region); +kmem_cache_free (vfio_ccw_io_region, private->io_region); +kfree (private->cp.guest_cp); +mutex_destroy (&private->io_mutex); -vfio_ccw_free_private (private); +vfio_free_device (vdev); }static void vfio_ccw_mdev_remove (struct mdev_device *mdev)
drivers/s390/cio/vfio_ccw_private.h +0 -2
@@ -131,8 +131,6 @@ int vfio_ccw_sch_quiesce(struct subchannel *sch);void vfio_ccw_sch_io_todo (struct work_struct *work);void vfio_ccw_crw_todo (struct work_struct *work); -void vfio_ccw_free_private (struct vfio_ccw_private *private); -extern struct mdev_driver vfio_ccw_mdev_driver;/*
drivers/vfio/vfio_main.c +5 -5
@@ -348,6 +348,9 @@ static void vfio_device_release(struct device *dev) device->ops->release (device); } +static int vfio_init_device (struct vfio_device *device,struct device *dev, +const struct vfio_device_ops *ops); +/* * Allocate and initialize vfio_device so it can be registered to vfio * core.
@@ -386,11 +389,9 @@ EXPORT_SYMBOL_GPL(_vfio_alloc_device);/* * Initialize a vfio_device so it can be registered to vfio core. -* -* Only vfio-ccw driver should call this interface. */ -int vfio_init_device (struct vfio_device *device,struct device *dev, -const struct vfio_device_ops *ops) +static int vfio_init_device (struct vfio_device *device,struct device *dev, +const struct vfio_device_ops *ops) {int ret;
@@ -422,7 +423,6 @@ int vfio_init_device(struct vfio_device *device, struct device *dev,ida_free (&vfio.device_ida, device->index);return ret; } -EXPORT_SYMBOL_GPL (vfio_init_device);/* * The helper called by driver @release callback to free the device
include/linux/vfio.h +0 -2
@@ -176,8 +176,6 @@ struct vfio_device *_vfio_alloc_device(size_t size, struct device *dev, dev, ops), \ struct dev_struct, member) -int vfio_init_device (struct vfio_device *device,struct device *dev, -const struct vfio_device_ops *ops);void vfio_free_device (struct vfio_device *device);static inline void vfio_put_device (struct vfio_device *device) {
Signature · 1 line
2.34.1
Re: [PATCH v2 6/7] vfio/ccw: replace vfio_init_device with _alloc_
Quoted 55 lines · Eric Farman
Now that we have a reasonable separation of structs that follow the subchannel and mdev lifecycles, there's no reason we can't call the official
vfio_alloc_deviceroutine for our private data, and behave like everyone else.Signed-off-by Eric Farman <[email protected]>Reviewed-by Kevin Tian <[email protected]>--- drivers/s390/cio/vfio_ccw_drv.c | 18 ------------------ drivers/s390/cio/vfio_ccw_ops.c | 28 ++++++++++++++++++---------- drivers/s390/cio/vfio_ccw_private.h | 2 -- drivers/vfio/vfio_main.c | 10 +++++----- include/linux/vfio.h | 2 -- 5 files changed, 23 insertions(+), 37 deletions(-)drivers/s390/cio/vfio_ccw_drv.c +0
-18@@ -151,24 +151,6 @@ static void vfio_ccw_sch_irq(struct subchannel *sch)vfio_ccw_fsm_event (private,VFIO_CCW_EVENT_INTERRUPT ); } -void vfio_ccw_free_private (struct vfio_ccw_private *private) -{ -struct vfio_ccw_crw *crw, *temp; - -list_for_each_entry_safe (crw, temp, &private->crw, next) { -list_del (&crw->next); -kfree (crw); - } - -kmem_cache_free (vfio_ccw_crw_region, private->crw_region); -kmem_cache_free (vfio_ccw_schib_region, private->schib_region); -kmem_cache_free (vfio_ccw_cmd_region, private->cmd_region); -kmem_cache_free (vfio_ccw_io_region, private->io_region); -kfree (private->cp.guest_cp); -mutex_destroy (&private->io_mutex); -kfree (private); -} -static void vfio_ccw_free_parent (struct device *dev) { struct vfio_ccw_parent *parent = container_of(dev, struct vfio_ccw_parent, dev);drivers/s390/cio/vfio_ccw_ops.c +0
-3@@ -102,15 +102,10 @@ static int vfio_ccw_mdev_probe(struct mdev_device *mdev)struct vfio_ccw_private *private;int ret; - private =kzalloc (sizeof (*private),GFP_KERNEL ); -if (!private) -return -ENOMEM ;
drivers/s390/cio/vfio_ccw_ops.c static int vfio_ccw_mdev_probe(struct mdev_device *mdev) · line 108
Quoted 10 lines
drivers/s390/cio/vfio_ccw_ops.c +4
-6- - ret =vfio_init_device (&private->vdev, &mdev->dev, &vfio_ccw_dev_ops); -if (ret) { -kfree (private); -return ret; - } + private =vfio_alloc_device (vfio_ccw_private, vdev, &mdev->dev, + &vfio_ccw_dev_ops); +if (IS_ERR (private)) +return PTR_ERR (private);
OK, and now it makes sense to switch to IS_ERR since _vfio_alloc_device uses ERR_PTR.
Eric Farman
maintainerPATCH v2 7/7 vfio: Remove vfio_free_device
In reply to Eric FarmanWith the "mess" sorted out, we should be able to inline the vfio_free_device call introduced by commit cb9ff3f3b84c ("vfio: Add helpers for unifying vfio_device life cycle") and remove them from driver release callbacks.
--- drivers/gpu/drm/i915/gvt/kvmgt.c | 1 - drivers/s390/cio/vfio_ccw_ops.c | 2 -- drivers/s390/crypto/vfio_ap_ops.c | 6 ------ drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 - drivers/vfio/pci/vfio_pci_core.c | 1 - drivers/vfio/platform/vfio_amba.c | 1 - drivers/vfio/platform/vfio_platform.c | 1 - drivers/vfio/vfio_main.c | 22 ++++------------------ include/linux/vfio.h | 1 - samples/vfio-mdev/mbochs.c | 1 - samples/vfio-mdev/mdpy.c | 1 - samples/vfio-mdev/mtty.c | 1 - 12 files changed, 4 insertions(+), 35 deletions(-)
drivers/gpu/drm/i915/gvt/kvmgt.c +0 -1
@@ -1461,7 +1461,6 @@ static void intel_vgpu_release_dev(struct vfio_device *vfio_dev)struct intel_vgpu *vgpu =vfio_dev_to_vgpu (vfio_dev);intel_gvt_destroy_vgpu (vgpu); -vfio_free_device (vfio_dev); }static const struct vfio_device_ops intel_vgpu_dev_ops = {
drivers/s390/cio/vfio_ccw_ops.c +0 -2
@@ -143,8 +143,6 @@ static void vfio_ccw_mdev_release_dev(struct vfio_device *vdev)kmem_cache_free (vfio_ccw_io_region, private->io_region);kfree (private->cp.guest_cp);mutex_destroy (&private->io_mutex); - -vfio_free_device (vdev); }static void vfio_ccw_mdev_remove (struct mdev_device *mdev)
drivers/s390/crypto/vfio_ap_ops.c +0 -6
@@ -765,11 +765,6 @@ static void vfio_ap_mdev_unlink_fr_queues(struct ap_matrix_mdev *matrix_mdev) } } -static void vfio_ap_mdev_release_dev (struct vfio_device *vdev) -{ -vfio_free_device (vdev); -} -static void vfio_ap_mdev_remove (struct mdev_device *mdev) {struct ap_matrix_mdev *matrix_mdev =dev_get_drvdata (&mdev->dev);
@@ -1784,7 +1779,6 @@ static const struct attribute_group vfio_queue_attr_group = {static const struct vfio_device_ops vfio_ap_matrix_dev_ops = { .init = vfio_ap_mdev_init_dev, - .release = vfio_ap_mdev_release_dev, .open_device = vfio_ap_mdev_open_device, .close_device = vfio_ap_mdev_close_device, .ioctl = vfio_ap_mdev_ioctl,
drivers/vfio/fsl-mc/vfio_fsl_mc.c +0 -1
@@ -568,7 +568,6 @@ static void vfio_fsl_mc_release_dev(struct vfio_device *core_vdev)vfio_fsl_uninit_device (vdev);mutex_destroy (&vdev->igate); -vfio_free_device (core_vdev); }static int vfio_fsl_mc_remove (struct fsl_mc_device *mc_dev)
drivers/vfio/pci/vfio_pci_core.c +0 -1
@@ -2109,7 +2109,6 @@ void vfio_pci_core_release_dev(struct vfio_device *core_vdev)mutex_destroy (&vdev->vma_lock);kfree (vdev->region);kfree (vdev->pm_save); -vfio_free_device (core_vdev); }EXPORT_SYMBOL_GPL (vfio_pci_core_release_dev);
drivers/vfio/platform/vfio_amba.c +0 -1
@@ -95,7 +95,6 @@ static void vfio_amba_release_dev(struct vfio_device *core_vdev)vfio_platform_release_common (vdev);kfree (vdev->name); -vfio_free_device (core_vdev); }static void vfio_amba_remove (struct amba_device *adev)
drivers/vfio/platform/vfio_platform.c +0 -1
@@ -83,7 +83,6 @@ static void vfio_platform_release_dev(struct vfio_device *core_vdev) container_of(core_vdev, struct vfio_platform_device, vdev);vfio_platform_release_common (vdev); -vfio_free_device (core_vdev); }static int vfio_platform_remove (struct platform_device *pdev)
drivers/vfio/vfio_main.c +4 -18
@@ -339,13 +339,10 @@ static void vfio_device_release(struct device *dev)vfio_release_device_set (device);ida_free (&vfio.device_ida, device->index); -/* -* kvfree() cannot be done here due to a life cycle mess in -* vfio-ccw. Before the ccw part is fixed all drivers are -* required to support @release and call vfio_free_device() -* from there. -*/ - device->ops->release (device); +if (device->ops->release) + device->ops->release (device); + +kvfree (device); } static int vfio_init_device(struct vfio_device *device, struct device *dev,
@@ -424,17 +421,6 @@ static int vfio_init_device(struct vfio_device *device, struct device *dev,return ret; } -/* -* The helper called by driver @release callback to free the device -* structure. Drivers which don't have private data to clean can -* simply use this helper as its @release. -*/ -void vfio_free_device (struct vfio_device *device) -{ -kvfree (device); -} -EXPORT_SYMBOL_GPL (vfio_free_device); -static struct vfio_group *vfio_noiommu_group_alloc (struct device *dev,enum vfio_group_type type) {
include/linux/vfio.h +0 -1
@@ -176,7 +176,6 @@ struct vfio_device *_vfio_alloc_device(size_t size, struct device *dev, dev, ops), \ struct dev_struct, member) -void vfio_free_device (struct vfio_device *device);static inline void vfio_put_device (struct vfio_device *device) {put_device (&device->device);
samples/vfio-mdev/mbochs.c +0 -1
@@ -594,7 +594,6 @@ static void mbochs_release_dev(struct vfio_device *vdev)atomic_add (mdev_state->type->mbytes, &mbochs_avail_mbytes);kfree (mdev_state->pages);kfree (mdev_state->vconfig); -vfio_free_device (vdev); }static void mbochs_remove (struct mdev_device *mdev)
samples/vfio-mdev/mdpy.c +0 -1
@@ -283,7 +283,6 @@ static void mdpy_release_dev(struct vfio_device *vdev)vfree (mdev_state->memblk);kfree (mdev_state->vconfig); -vfio_free_device (vdev); }static void mdpy_remove (struct mdev_device *mdev)
samples/vfio-mdev/mtty.c +0 -1
@@ -784,7 +784,6 @@ static void mtty_release_dev(struct vfio_device *vdev)atomic_add (mdev_state->nr_ports, &mdev_avail_ports);kfree (mdev_state->vconfig); -vfio_free_device (vdev); }static void mtty_remove (struct mdev_device *mdev)
Signature · 1 line
2.34.1
Re: [PATCH v2 7/7] vfio: Remove vfio_free_device
Quoted 8 lines · Eric Farman
With the "mess" sorted out, we should be able to inline the
vfio_free_devicecall introduced by commitcb9ff3f3b84c("vfio: Add helpers for unifyingvfio_devicelife cycle") and remove them from driver release callbacks.Signed-off-by Eric Farman <[email protected]>Reviewed-by Jason Gunthorpe <[email protected]>Reviewed-by Kevin Tian <[email protected]>
Quoted 14 lines
--- drivers/gpu/drm/i915/gvt/kvmgt.c | 1 - drivers/s390/cio/vfio_ccw_ops.c | 2 -- drivers/s390/crypto/vfio_ap_ops.c | 6 ------ drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 - drivers/vfio/pci/vfio_pci_core.c | 1 - drivers/vfio/platform/vfio_amba.c | 1 - drivers/vfio/platform/vfio_platform.c | 1 - drivers/vfio/vfio_main.c | 22 ++++------------------ include/linux/vfio.h | 1 - samples/vfio-mdev/mbochs.c | 1 - samples/vfio-mdev/mdpy.c | 1 - samples/vfio-mdev/mtty.c | 1 - 12 files changed, 4 insertions(+), 35 deletions(-)
Re: [PATCH v2 7/7] vfio: Remove vfio_free_device
In reply to Eric FarmanQuoted 208 lines · Eric Farman
With the "mess" sorted out, we should be able to inline the
vfio_free_devicecall introduced by commitcb9ff3f3b84c("vfio: Add helpers for unifyingvfio_devicelife cycle") and remove them from driver release callbacks.Signed-off-by Eric Farman <[email protected]>Reviewed-by Jason Gunthorpe <[email protected]>Reviewed-by Kevin Tian <[email protected]>--- drivers/gpu/drm/i915/gvt/kvmgt.c | 1 - drivers/s390/cio/vfio_ccw_ops.c | 2 -- drivers/s390/crypto/vfio_ap_ops.c | 6 ------ drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 - drivers/vfio/pci/vfio_pci_core.c | 1 - drivers/vfio/platform/vfio_amba.c | 1 - drivers/vfio/platform/vfio_platform.c | 1 - drivers/vfio/vfio_main.c | 22 ++++------------------ include/linux/vfio.h | 1 - samples/vfio-mdev/mbochs.c | 1 - samples/vfio-mdev/mdpy.c | 1 - samples/vfio-mdev/mtty.c | 1 - 12 files changed, 4 insertions(+), 35 deletions(-)drivers/gpu/drm/i915/gvt/kvmgt.c +0
-1@@ -1461,7 +1461,6 @@ static void intel_vgpu_release_dev(struct vfio_device *vfio_dev)struct intel_vgpu *vgpu =vfio_dev_to_vgpu (vfio_dev);intel_gvt_destroy_vgpu (vgpu); -vfio_free_device (vfio_dev); }static const struct vfio_device_ops intel_vgpu_dev_ops = {drivers/s390/cio/vfio_ccw_ops.c +0
-2@@ -143,8 +143,6 @@ static void vfio_ccw_mdev_release_dev(struct vfio_device *vdev)kmem_cache_free (vfio_ccw_io_region, private->io_region);kfree (private->cp.guest_cp);mutex_destroy (&private->io_mutex); - -vfio_free_device (vdev); }static void vfio_ccw_mdev_remove (struct mdev_device *mdev)drivers/s390/crypto/vfio_ap_ops.c +0
-6@@ -765,11 +765,6 @@ static void vfio_ap_mdev_unlink_fr_queues(struct ap_matrix_mdev *matrix_mdev) } } -static void vfio_ap_mdev_release_dev (struct vfio_device *vdev) -{ -vfio_free_device (vdev); -} -static void vfio_ap_mdev_remove (struct mdev_device *mdev) {struct ap_matrix_mdev *matrix_mdev =dev_get_drvdata (&mdev->dev);@@ -1784,7 +1779,6 @@ static const struct attribute_group vfio_queue_attr_group = {static const struct vfio_device_ops vfio_ap_matrix_dev_ops = { .init = vfio_ap_mdev_init_dev, - .release = vfio_ap_mdev_release_dev, .open_device = vfio_ap_mdev_open_device, .close_device = vfio_ap_mdev_close_device, .ioctl = vfio_ap_mdev_ioctl,drivers/vfio/fsl-mc/vfio_fsl_mc.c +0
-1@@ -568,7 +568,6 @@ static void vfio_fsl_mc_release_dev(struct vfio_device *core_vdev)vfio_fsl_uninit_device (vdev);mutex_destroy (&vdev->igate); -vfio_free_device (core_vdev); }static int vfio_fsl_mc_remove (struct fsl_mc_device *mc_dev)drivers/vfio/pci/vfio_pci_core.c +0
-1@@ -2109,7 +2109,6 @@ void vfio_pci_core_release_dev(struct vfio_device *core_vdev)mutex_destroy (&vdev->vma_lock);kfree (vdev->region);kfree (vdev->pm_save); -vfio_free_device (core_vdev); }EXPORT_SYMBOL_GPL (vfio_pci_core_release_dev);drivers/vfio/platform/vfio_amba.c +0
-1@@ -95,7 +95,6 @@ static void vfio_amba_release_dev(struct vfio_device *core_vdev)vfio_platform_release_common (vdev);kfree (vdev->name); -vfio_free_device (core_vdev); }static void vfio_amba_remove (struct amba_device *adev)drivers/vfio/platform/vfio_platform.c +0
-1@@ -83,7 +83,6 @@ static void vfio_platform_release_dev(struct vfio_device *core_vdev) container_of(core_vdev, struct vfio_platform_device, vdev);vfio_platform_release_common (vdev); -vfio_free_device (core_vdev); }static int vfio_platform_remove (struct platform_device *pdev)drivers/vfio/vfio_main.c +4
-18@@ -339,13 +339,10 @@ static void vfio_device_release(struct device *dev)vfio_release_device_set (device);ida_free (&vfio.device_ida, device->index); -/* -* kvfree() cannot be done here due to a life cycle mess in -* vfio-ccw. Before the ccw part is fixed all drivers are -* required to support @release and call vfio_free_device() -* from there. -*/ - device->ops->release (device); +if (device->ops->release) + device->ops->release (device); + +kvfree (device); } static int vfio_init_device(struct vfio_device *device, struct device *dev,@@ -424,17 +421,6 @@ static int vfio_init_device(struct vfio_device *device, struct device *dev,return ret; } -/* -* The helper called by driver @release callback to free the device -* structure. Drivers which don't have private data to clean can -* simply use this helper as its @release. -*/ -void vfio_free_device (struct vfio_device *device) -{ -kvfree (device); -} -EXPORT_SYMBOL_GPL (vfio_free_device); -static struct vfio_group *vfio_noiommu_group_alloc (struct device *dev,enum vfio_group_type type) {include/linux/vfio.h +0
-1@@ -176,7 +176,6 @@ struct vfio_device *_vfio_alloc_device(size_t size, struct device *dev, dev, ops), \ struct dev_struct, member) -void vfio_free_device (struct vfio_device *device);static inline void vfio_put_device (struct vfio_device *device) {put_device (&device->device);samples/vfio-mdev/mbochs.c +0
-1@@ -594,7 +594,6 @@ static void mbochs_release_dev(struct vfio_device *vdev)atomic_add (mdev_state->type->mbytes, &mbochs_avail_mbytes);kfree (mdev_state->pages);kfree (mdev_state->vconfig); -vfio_free_device (vdev); }static void mbochs_remove (struct mdev_device *mdev)samples/vfio-mdev/mdpy.c +0
-1@@ -283,7 +283,6 @@ static void mdpy_release_dev(struct vfio_device *vdev)vfree (mdev_state->memblk);kfree (mdev_state->vconfig); -vfio_free_device (vdev); }static void mdpy_remove (struct mdev_device *mdev)samples/vfio-mdev/mtty.c +0
-1@@ -784,7 +784,6 @@ static void mtty_release_dev(struct vfio_device *vdev)atomic_add (mdev_state->nr_ports, &mdev_avail_ports);kfree (mdev_state->vconfig); -vfio_free_device (vdev); }static void mtty_remove (struct mdev_device *mdev)
Re: [PATCH v2 7/7] vfio: Remove vfio_free_device
In reply to Eric FarmanQuoted 8 lines · Eric Farman
With the "mess" sorted out, we should be able to inline the
vfio_free_devicecall introduced by commitcb9ff3f3b84c("vfio: Add helpers for unifyingvfio_devicelife cycle") and remove them from driver release callbacks.Signed-off-by Eric Farman <[email protected]>Reviewed-by Jason Gunthorpe <[email protected]>Reviewed-by Kevin Tian <[email protected]>
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for vfio-ccw parent rework (rev2)
In reply to Eric Farman== Series Details ==
== Series Details ==
Series: vfio-ccw parent rework (rev2)
URL : https://patchwork.freedesktop.org/series/109899/
State : warning
== Summary ==
Error: dim checkpatch failed23f3cebda691 vfio/ccw: create a parent struct
-:57: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #57: FILE: drivers/s390/cio/vfio_ccw_drv.c:144:
+ VFIO_CCW_MSG_EVENT(2, "sch %x.%x.%04x: unexpected interrupt\n",
+ sch->schid.cssid, sch->schid.ssid, sch->schid.sch_no);
total: 0 errors, 0 warnings, 1 checks, 234 lines checked 02cab55b9976 vfio/ccw: remove private->sch 8e956d5bb94a vfio/ccw: move private initialization to callback 906c43a0e358 vfio/ccw: move private to mdev lifecycle 172ada9ff137 vfio/ccw: remove release completion f713625f9690 vfio/ccw: replace vfio_init_device with _alloc_ e91b7fbb1ab1 vfio: Remove vfio_free_device
Patchwork
CI[Intel-gfx] ✗ Fi.CI.DOCS: warning for vfio-ccw parent rework (rev2)
In reply to Eric Farman== Series Details ==
== Series Details ==
Series: vfio-ccw parent rework (rev2)
URL : https://patchwork.freedesktop.org/series/109899/
State : warning
== Summary ==
Error: make htmldocs had i915 warnings./drivers/gpu/drm/i915/i915_perf_types.h:319: warning: Function parameter or member 'lock' not described in 'i915_perf_stream'
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for vfio-ccw parent rework (rev2)
In reply to Eric Farman== Series Details ==
== Series Details ==
Series: vfio-ccw parent rework (rev2)
URL : https://patchwork.freedesktop.org/series/109899/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_12332 -> Patchwork_109899v2
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/index.html
Participating hosts (40 -> 29)
------------------------------
Missing (11): bat-dg2-8 bat-adlm-1 bat-dg2-9 bat-adlp-6 bat-adlp-4 bat-adln-1 bat-rplp-1 bat-rpls-1 bat-rpls-2 bat-dg2-11 bat-jsl-1
Known issues
------------
Here are the changes found in Patchwork_109899v2 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_lmem_swapping@random-engines:
- fi-icl-u2: NOTRUN -> [SKIP][1] ([i915#4613]) +3 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/fi-icl-u2/igt@[email protected]
* igt@i915_selftest@live@gt_heartbeat:
- fi-cfl-8109u: [PASS][2] -> [DMESG-FAIL][3] ([i915#5334])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/fi-cfl-8109u/igt@i915_selftest@live@gt_heartbeat.html
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/fi-cfl-8109u/igt@i915_selftest@live@gt_heartbeat.html
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-hsw-g3258: NOTRUN -> [SKIP][4] ([fdo#109271] / [fdo#111827])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/fi-hsw-g3258/igt@[email protected]
- fi-icl-u2: NOTRUN -> [SKIP][5] ([fdo#111827])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/fi-icl-u2/igt@[email protected]
* igt@kms_pipe_crc_basic@suspend-read-crc@pipe-a-edp-1:
- fi-bsw-kefka: [PASS][6] -> [DMESG-WARN][7] ([i915#1982])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/fi-bsw-kefka/igt@kms_pipe_crc_basic@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/fi-bsw-kefka/igt@kms_pipe_crc_basic@[email protected]
* igt@prime_vgem@basic-userptr:
- fi-icl-u2: NOTRUN -> [SKIP][8] ([fdo#109295] / [i915#3301])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/fi-icl-u2/igt@[email protected]
#### Possible fixes ####
* igt@i915_pm_rpm@basic-rte:
- fi-icl-u2: [DMESG-WARN][9] ([i915#4890]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/fi-icl-u2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/fi-icl-u2/igt@[email protected]
* igt@i915_selftest@live@gt_heartbeat:
- fi-apl-guc: [DMESG-FAIL][11] ([i915#5334]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
* igt@i915_selftest@live@hangcheck:
- fi-adl-ddr5: [DMESG-WARN][13] ([i915#5591]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/fi-adl-ddr5/igt@i915_selftest@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/fi-adl-ddr5/igt@i915_selftest@[email protected]
- fi-hsw-g3258: [INCOMPLETE][15] ([i915#3303] / [i915#4785]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/fi-hsw-g3258/igt@i915_selftest@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/fi-hsw-g3258/igt@i915_selftest@[email protected]
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
[i915#4890]: https://gitlab.freedesktop.org/drm/intel/issues/4890
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#5591]: https://gitlab.freedesktop.org/drm/intel/issues/5591
Build changes
-------------
* Linux: CI_DRM_12332 -> Patchwork_109899v2
CI-20190529: 20190529
CI_DRM_12332: 601b2ef606e4b83d5518aa6a5011bb2b1c5954d9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7038: 5389b3f3b9b75df6bd8506e4aa3da357fd0c0ab1 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_109899v2: 601b2ef606e4b83d5518aa6a5011bb2b1c5954d9 @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
c5dc5cc4efd2 vfio: Remove vfio_free_device ecc18ef9eba8 vfio/ccw: replace vfio_init_device with _alloc_ 937d5504e40a vfio/ccw: remove release completion 0b6a57f7f1cc vfio/ccw: move private to mdev lifecycle b516e6331408 vfio/ccw: move private initialization to callback 09b4444cc593 vfio/ccw: remove private->sch 922e5aef5a6c vfio/ccw: create a parent struct
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/index.html
Patchwork
CI[Intel-gfx] ✗ Fi.CI.IGT: failure for vfio-ccw parent rework (rev2)
In reply to Eric Farman== Series Details ==
== Series Details ==
Series: vfio-ccw parent rework (rev2)
URL : https://patchwork.freedesktop.org/series/109899/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_12332_full -> Patchwork_109899v2_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_109899v2_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_109899v2_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
Participating hosts (9 -> 9)
------------------------------
No changes in participating hosts
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_109899v2_full:
### IGT changes ###
#### Possible regressions ####
* igt@gem_exec_whisper@basic-queues-forked:
- shard-iclb: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb5/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb6/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_109899v2_full that come from known issues:
### CI changes ###
#### Issues hit ####
* boot:
- shard-skl: ([PASS][3], [PASS][4], [PASS][5], [PASS][6], [PASS][7], [PASS][8], [PASS][9], [PASS][10], [PASS][11], [PASS][12], [PASS][13], [PASS][14], [PASS][15], [PASS][16], [PASS][17], [PASS][18], [PASS][19], [PASS][20], [PASS][21], [PASS][22], [PASS][23], [PASS][24], [PASS][25], [PASS][26], [PASS][27]) -> ([PASS][28], [PASS][29], [PASS][30], [PASS][31], [PASS][32], [PASS][33], [PASS][34], [PASS][35], [PASS][36], [PASS][37], [PASS][38], [PASS][39], [FAIL][40], [PASS][41], [PASS][42], [PASS][43], [PASS][44], [PASS][45], [PASS][46], [PASS][47], [PASS][48], [PASS][49], [PASS][50], [PASS][51], [PASS][52]) ([i915#5032])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl9/boot.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl9/boot.html
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl9/boot.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl7/boot.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl7/boot.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl7/boot.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl6/boot.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl6/boot.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl6/boot.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl5/boot.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl5/boot.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl5/boot.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl4/boot.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl4/boot.html
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl4/boot.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl3/boot.html
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl3/boot.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl3/boot.html
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl1/boot.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl1/boot.html
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl1/boot.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl10/boot.html
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl10/boot.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl10/boot.html
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl10/boot.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl9/boot.html
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl9/boot.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl9/boot.html
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl7/boot.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl7/boot.html
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl7/boot.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl7/boot.html
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl6/boot.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl6/boot.html
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl6/boot.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl5/boot.html
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl5/boot.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl5/boot.html
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl5/boot.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl4/boot.html
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl4/boot.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl4/boot.html
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl4/boot.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl1/boot.html
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl1/boot.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl1/boot.html
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl1/boot.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl10/boot.html
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl10/boot.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl10/boot.html
### IGT changes ###
#### Issues hit ####
* igt@feature_discovery@psr2:
- shard-iclb: [PASS][53] -> [SKIP][54] ([i915#658])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb2/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb3/igt@[email protected]
* igt@gem_ctx_exec@basic-nohangcheck:
- shard-tglb: [PASS][55] -> [FAIL][56] ([i915#6268])
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-tglb5/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-tglb7/igt@[email protected]
* igt@gem_ctx_isolation@preservation-s3@vecs0:
- shard-tglb: [PASS][57] -> [DMESG-WARN][58] ([i915#2411] / [i915#2867]) +1 similar issue
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-tglb6/igt@gem_ctx_isolation@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-tglb2/igt@gem_ctx_isolation@[email protected]
* igt@gem_exec_balancer@parallel-keep-in-fence:
- shard-iclb: [PASS][59] -> [SKIP][60] ([i915#4525]) +1 similar issue
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb2/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb8/igt@[email protected]
* igt@gem_exec_fair@basic-deadline:
- shard-glk: [PASS][61] -> [FAIL][62] ([i915#2846])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-glk8/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-glk1/igt@[email protected]
* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-glk: [PASS][63] -> [FAIL][64] ([i915#2842])
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-glk7/igt@gem_exec_fair@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-glk9/igt@gem_exec_fair@[email protected]
* igt@gem_lmem_swapping@basic:
- shard-skl: NOTRUN -> [SKIP][65] ([fdo#109271] / [i915#4613]) +1 similar issue
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl9/igt@[email protected]
* igt@gem_lmem_swapping@parallel-random:
- shard-apl: NOTRUN -> [SKIP][66] ([fdo#109271] / [i915#4613]) +2 similar issues
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl6/igt@[email protected]
* igt@gem_pread@exhaustion:
- shard-apl: NOTRUN -> [INCOMPLETE][67] ([i915#7248])
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl8/igt@[email protected]
* igt@gem_softpin@evict-single-offset:
- shard-apl: NOTRUN -> [FAIL][68] ([i915#4171])
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl6/igt@[email protected]
* igt@gem_tiled_wb:
- shard-skl: NOTRUN -> [TIMEOUT][69] ([i915#6990])
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl10/igt@gem_tiled_wb.html
* igt@kms_ccs@pipe-a-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc:
- shard-apl: NOTRUN -> [SKIP][70] ([fdo#109271] / [i915#3886]) +5 similar issues
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl3/igt@kms_ccs@pipe-a-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc.html
* igt@kms_chamelium@hdmi-edid-change-during-suspend:
- shard-apl: NOTRUN -> [SKIP][71] ([fdo#109271] / [fdo#111827]) +2 similar issues
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl3/igt@[email protected]
* igt@kms_color_chamelium@gamma:
- shard-skl: NOTRUN -> [SKIP][72] ([fdo#109271] / [fdo#111827])
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl9/igt@[email protected]
* igt@kms_cursor_crc@cursor-sliding-32x32:
- shard-apl: NOTRUN -> [SKIP][73] ([fdo#109271]) +63 similar issues
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl6/igt@[email protected]
* igt@kms_fbcon_fbt@fbc-suspend:
- shard-apl: [PASS][74] -> [FAIL][75] ([i915#4767])
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-apl2/igt@[email protected]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl1/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank-interruptible@a-dp1:
- shard-apl: [PASS][76] -> [FAIL][77] ([i915#79])
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-apl7/igt@kms_flip@[email protected]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl8/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-expired-vblank@b-edp1:
- shard-skl: [PASS][78] -> [FAIL][79] ([i915#79])
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl6/igt@kms_flip@[email protected]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl5/igt@kms_flip@[email protected]
* igt@kms_flip@plain-flip-fb-recreate@c-edp1:
- shard-skl: [PASS][80] -> [FAIL][81] ([i915#2122]) +3 similar issues
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl4/igt@kms_flip@[email protected]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl10/igt@kms_flip@[email protected]
* igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-32bpp-yftileccs-downscaling@pipe-a-default-mode:
- shard-iclb: NOTRUN -> [SKIP][82] ([i915#6375])
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb2/igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-32bpp-yftileccs-downscaling@pipe-a-default-mode.html
* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-64bpp-ytile-downscaling@pipe-a-default-mode:
- shard-iclb: NOTRUN -> [SKIP][83] ([i915#3555]) +1 similar issue
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb2/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-64bpp-ytile-downscaling@pipe-a-default-mode.html
* igt@kms_flip_scaled_crc@flip-64bpp-4tile-to-16bpp-4tile-upscaling@pipe-a-default-mode:
- shard-iclb: NOTRUN -> [SKIP][84] ([i915#2672]) +3 similar issues
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb2/igt@kms_flip_scaled_crc@flip-64bpp-4tile-to-16bpp-4tile-upscaling@pipe-a-default-mode.html
* igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-16bpp-yftile-upscaling@pipe-a-valid-mode:
- shard-iclb: NOTRUN -> [SKIP][85] ([i915#2587] / [i915#2672]) +1 similar issue
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb8/igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-16bpp-yftile-upscaling@pipe-a-valid-mode.html
* igt@kms_frontbuffer_tracking@fbcpsr-suspend:
- shard-skl: NOTRUN -> [SKIP][86] ([fdo#109271]) +53 similar issues
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl9/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-blt:
- shard-skl: [PASS][87] -> [DMESG-WARN][88] ([i915#1982])
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl6/igt@[email protected]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl5/igt@[email protected]
* igt@kms_plane_alpha_blend@alpha-basic@pipe-a-dp-1:
- shard-apl: NOTRUN -> [FAIL][89] ([i915#4573]) +2 similar issues
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl6/igt@kms_plane_alpha_blend@[email protected]
* igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-edp-1:
- shard-iclb: [PASS][90] -> [SKIP][91] ([i915#5235]) +2 similar issues
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb5/igt@kms_plane_scaling@[email protected]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb2/igt@kms_plane_scaling@[email protected]
* igt@kms_psr2_sf@cursor-plane-move-continuous-sf:
- shard-skl: NOTRUN -> [SKIP][92] ([fdo#109271] / [i915#658]) +1 similar issue
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl9/igt@[email protected]
* igt@kms_psr2_su@page_flip-p010@pipe-b-edp-1:
- shard-iclb: NOTRUN -> [FAIL][93] ([i915#5939]) +2 similar issues
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb2/igt@kms_psr2_su@[email protected]
* igt@kms_psr@psr2_cursor_blt:
- shard-iclb: [PASS][94] -> [SKIP][95] ([fdo#109441]) +2 similar issues
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb2/igt@kms_psr@psr2_cursor_blt.html
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb3/igt@kms_psr@psr2_cursor_blt.html
* igt@kms_setmode@basic-clone-single-crtc:
- shard-glk: NOTRUN -> [SKIP][96] ([fdo#109271])
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-glk7/igt@[email protected]
* igt@kms_sysfs_edid_timing:
- shard-skl: [PASS][97] -> [FAIL][98] ([i915#6493])
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl10/igt@kms_sysfs_edid_timing.html
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl1/igt@kms_sysfs_edid_timing.html
* igt@kms_vblank@pipe-c-accuracy-idle:
- shard-skl: [PASS][99] -> [FAIL][100] ([i915#43])
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl10/igt@[email protected]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl7/igt@[email protected]
* igt@kms_vblank@pipe-c-ts-continuation-suspend:
- shard-apl: [PASS][101] -> [DMESG-WARN][102] ([i915#180])
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-apl7/igt@[email protected]
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl3/igt@[email protected]
* igt@kms_writeback@writeback-invalid-parameters:
- shard-skl: NOTRUN -> [SKIP][103] ([fdo#109271] / [i915#2437])
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl9/igt@[email protected]
* igt@sysfs_clients@busy:
- shard-glk: NOTRUN -> [SKIP][104] ([fdo#109271] / [i915#2994])
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-glk7/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_balancer@parallel-bb-first:
- shard-iclb: [SKIP][105] ([i915#4525]) -> [PASS][106] +1 similar issue
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb5/igt@[email protected]
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb2/igt@[email protected]
* igt@gem_mmap_offset@bad-object:
- shard-skl: [DMESG-WARN][107] ([i915#1982]) -> [PASS][108] +3 similar issues
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl4/igt@[email protected]
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl10/igt@[email protected]
* igt@i915_pm_rpm@basic-pci-d3-state:
- shard-iclb: [FAIL][109] -> [PASS][110]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb3/igt@[email protected]
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb3/igt@[email protected]
* igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions-varying-size:
- shard-glk: [FAIL][111] ([i915#2346]) -> [PASS][112] +1 similar issue
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-glk8/igt@kms_cursor_legacy@[email protected]
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-glk1/igt@kms_cursor_legacy@[email protected]
* igt@kms_flip@flip-vs-absolute-wf_vblank@a-edp1:
- shard-skl: [FAIL][113] ([i915#2122]) -> [PASS][114] +1 similar issue
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl5/igt@kms_flip@[email protected]
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl1/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-expired-vblank-interruptible@c-edp1:
- shard-skl: [FAIL][115] ([i915#79]) -> [PASS][116] +1 similar issue
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl3/igt@kms_flip@[email protected]
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl10/igt@kms_flip@[email protected]
* igt@kms_flip_scaled_crc@flip-64bpp-xtile-to-16bpp-xtile-downscaling@pipe-a-default-mode:
- shard-iclb: [SKIP][117] ([i915#3555]) -> [PASS][118]
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb2/igt@kms_flip_scaled_crc@flip-64bpp-xtile-to-16bpp-xtile-downscaling@pipe-a-default-mode.html
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb3/igt@kms_flip_scaled_crc@flip-64bpp-xtile-to-16bpp-xtile-downscaling@pipe-a-default-mode.html
* igt@kms_plane_lowres@tiling-y@pipe-a-hdmi-a-1:
- shard-glk: [DMESG-FAIL][119] ([i915#118]) -> [PASS][120]
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-glk9/igt@kms_plane_lowres@[email protected]
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-glk8/igt@kms_plane_lowres@[email protected]
* igt@kms_plane_lowres@tiling-y@pipe-c-hdmi-a-1:
- shard-glk: [FAIL][121] ([i915#7307]) -> [PASS][122] +1 similar issue
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-glk9/igt@kms_plane_lowres@[email protected]
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-glk8/igt@kms_plane_lowres@[email protected]
* igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-5@pipe-b-edp-1:
- shard-iclb: [SKIP][123] ([i915#5176]) -> [PASS][124] +2 similar issues
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb2/igt@kms_plane_scaling@[email protected]
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb3/igt@kms_plane_scaling@[email protected]
* igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-5@pipe-b-edp-1:
- shard-iclb: [SKIP][125] ([i915#5235]) -> [PASS][126] +2 similar issues
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb2/igt@kms_plane_scaling@[email protected]
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb3/igt@kms_plane_scaling@[email protected]
* igt@kms_psr@psr2_primary_mmap_cpu:
- shard-iclb: [SKIP][127] ([fdo#109441]) -> [PASS][128] +2 similar issues
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb5/igt@kms_psr@psr2_primary_mmap_cpu.html
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
* igt@kms_vblank@pipe-b-ts-continuation-suspend:
- shard-apl: [DMESG-WARN][129] ([i915#180]) -> [PASS][130] +3 similar issues
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-apl2/igt@[email protected]
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl8/igt@[email protected]
* igt@perf@polling:
- shard-skl: [FAIL][131] ([i915#1542]) -> [PASS][132]
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl9/igt@[email protected]
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl7/igt@[email protected]
* igt@prime_mmap_coherency@ioctl-errors:
- shard-skl: [INCOMPLETE][133] ([i915#2295]) -> [PASS][134]
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl3/igt@[email protected]
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl10/igt@[email protected]
* igt@syncobj_wait@wait-all-for-submit-snapshot:
- shard-skl: [FAIL][135] ([i915#7109]) -> [PASS][136]
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl10/igt@[email protected]
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl4/igt@[email protected]
#### Warnings ####
* igt@gem_pwrite@basic-exhaustion:
- shard-glk: [WARN][137] ([i915#2658]) -> [INCOMPLETE][138] ([i915#7248])
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-glk5/igt@[email protected]
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-glk2/igt@[email protected]
- shard-skl: [TIMEOUT][139] ([i915#7248]) -> [INCOMPLETE][140] ([i915#7248])
[139]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl3/igt@[email protected]
[140]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl9/igt@[email protected]
* igt@i915_pm_dc@dc3co-vpb-simulation:
- shard-iclb: [SKIP][141] ([i915#588]) -> [SKIP][142] ([i915#658])
[141]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb2/igt@[email protected]
[142]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb3/igt@[email protected]
* igt@kms_cursor_legacy@cursor-vs-flip@toggle:
- shard-skl: [INCOMPLETE][143] -> [FAIL][144] ([i915#5072])
[143]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-skl6/igt@kms_cursor_legacy@[email protected]
[144]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-skl7/igt@kms_cursor_legacy@[email protected]
* igt@kms_psr2_sf@cursor-plane-move-continuous-exceed-fully-sf:
- shard-iclb: [SKIP][145] ([i915#2920]) -> [SKIP][146] ([i915#658])
[145]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb2/igt@[email protected]
[146]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb3/igt@[email protected]
* igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-sf:
- shard-iclb: [SKIP][147] ([i915#658]) -> [SKIP][148] ([i915#2920])
[147]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb8/igt@[email protected]
[148]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb2/igt@[email protected]
* igt@kms_psr2_sf@overlay-plane-update-continuous-sf:
- shard-iclb: [SKIP][149] ([fdo#111068] / [i915#658]) -> [SKIP][150] ([i915#2920])
[149]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-iclb5/igt@[email protected]
[150]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-iclb2/igt@[email protected]
* igt@runner@aborted:
- shard-apl: ([FAIL][151], [FAIL][152], [FAIL][153], [FAIL][154], [FAIL][155], [FAIL][156]) ([fdo#109271] / [i915#180] / [i915#3002] / [i915#4312]) -> ([FAIL][157], [FAIL][158], [FAIL][159]) ([i915#3002] / [i915#4312])
[151]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-apl2/igt@[email protected]
[152]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-apl3/igt@[email protected]
[153]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-apl3/igt@[email protected]
[154]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-apl8/igt@[email protected]
[155]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-apl1/igt@[email protected]
[156]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12332/shard-apl6/igt@[email protected]
[157]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl3/igt@[email protected]
[158]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl2/igt@[email protected]
[159]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/shard-apl2/igt@[email protected]
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2295]: https://gitlab.freedesktop.org/drm/intel/issues/2295
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
[i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
[i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#4171]: https://gitlab.freedesktop.org/drm/intel/issues/4171
[i915#43]: https://gitlab.freedesktop.org/drm/intel/issues/43
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
[i915#4573]: https://gitlab.freedesktop.org/drm/intel/issues/4573
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4767]: https://gitlab.freedesktop.org/drm/intel/issues/4767
[i915#5032]: https://gitlab.freedesktop.org/drm/intel/issues/5032
[i915#5072]: https://gitlab.freedesktop.org/drm/intel/issues/5072
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#588]: https://gitlab.freedesktop.org/drm/intel/issues/588
[i915#5939]: https://gitlab.freedesktop.org/drm/intel/issues/5939
[i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
[i915#6375]: https://gitlab.freedesktop.org/drm/intel/issues/6375
[i915#6493]: https://gitlab.freedesktop.org/drm/intel/issues/6493
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6990]: https://gitlab.freedesktop.org/drm/intel/issues/6990
[i915#7109]: https://gitlab.freedesktop.org/drm/intel/issues/7109
[i915#7248]: https://gitlab.freedesktop.org/drm/intel/issues/7248
[i915#7307]: https://gitlab.freedesktop.org/drm/intel/issues/7307
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
Build changes
-------------
* Linux: CI_DRM_12332 -> Patchwork_109899v2
CI-20190529: 20190529
CI_DRM_12332: 601b2ef606e4b83d5518aa6a5011bb2b1c5954d9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7038: 5389b3f3b9b75df6bd8506e4aa3da357fd0c0ab1 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_109899v2: 601b2ef606e4b83d5518aa6a5011bb2b1c5954d9 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109899v2/index.html
Quoted 15 lines · On Wed, 2 Nov 2022 16:01:45 +0100 Eric Farman <[email protected]> wrote:
Hi all,
Here is an update to the vfio-ccw lifecycle changes that have been discussed in various forms over the past year [1][2] or so, and which I dusted off recently.
Patches 1-5 rework the behavior of the vfio-ccw driver's private struct. In summary, the mdev pieces are split out of
vfio_ccw_privateand into a newvfio_ccw_parentstruct that will continue to follow today's lifecycle. The remainder (bulk) of the private struct moves to follow the mdev probe/remove pair. There's opportunity for further separation of the things in the private struct, which would simplify some of the vfio-ccw code, but it got too hairy as I started that. Once vfio-ccw is no longer considered unique, those cleanups can happen at our leisure.
Quoted 5 lines
Patch 6 removes the trickery where vfio-ccw uses
vfio_init_deviceinstead ofvfio_alloc_device, and thus removesvfio_init_devicefrom the outside world.Patch 7 removes
vfio_free_devicefrom vfio-ccw and the other drivers (hello, CC list!), letting it be handled byvfio_device_releasedirectly.
Looks like another spin is pending, but the vfio core and collateral changes in 6 and 7 look good to me. Would this go in through the vfio or s390 tree? I'd be happy to merge or provide a branch, depending on the route.
For 6 & 7:
Thanks,
Alex
Quoted 56 lines
Looking forward to the feedback.
Thanks,
Eric[1] https://lore.kernel.org/kvm/[email protected]/
[2] https://lore.kernel.org/kvm/[email protected]/
v1->v2:
- Rebase to 6.1-rc3
- Patch 1:
[EF] s/device_initialize/device_register/ and associated adjustments [MR] AddWARN_ON(!private)invfio_ccw_sch_quiesce()
[MR] Move structvfio_ccw_parentto_private.h, instead of standalone file
- Patch 2:
[MR] Added r-b (Thank you!)
- Patch 3:
[MR] Update commit message to point to introduction ofprivate->release_comp[MR] Replace the remnants ofvfio_ccw_alloc_privatewith a straight kzalloc [MR] Added r-b (Thank you!)
- Patch 5:
[KT] Added r-b (Thank you!)
- Patch 6:
[JG] Makevfio_init_devicestatic
[KT] Added r-b (Thank you!)
- Patch 7:
[JG, KT] Added r-b (Thank you!)
v1: https://lore.kernel.org/kvm/[email protected]/Eric Farman (7):
vfio/ccw: create a parent struct vfio/ccw: removeprivate->sch
vfio/ccw: move private initialization to callback vfio/ccw: move private to mdev lifecycle vfio/ccw: remove release completion vfio/ccw: replacevfio_init_devicewith _alloc_
vfio: Removevfio_free_devicedrivers/gpu/drm/i915/gvt/kvmgt.c | 1 - drivers/s390/cio/vfio_ccw_chp.c | 5 +- drivers/s390/cio/vfio_ccw_drv.c | 174 +++++++++++--------------- drivers/s390/cio/vfio_ccw_fsm.c | 27 ++-- drivers/s390/cio/vfio_ccw_ops.c | 107 +++++++++++----- drivers/s390/cio/vfio_ccw_private.h | 37 ++++-- drivers/s390/crypto/vfio_ap_ops.c | 6 - drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 - drivers/vfio/pci/vfio_pci_core.c | 1 - drivers/vfio/platform/vfio_amba.c | 1 - drivers/vfio/platform/vfio_platform.c | 1 - drivers/vfio/vfio_main.c | 32 ++--- include/linux/vfio.h | 3 - samples/vfio-mdev/mbochs.c | 1 - samples/vfio-mdev/mdpy.c | 1 - samples/vfio-mdev/mtty.c | 1 - 16 files changed, 197 insertions(+), 202 deletions(-)
Matthew Rosato
maintainerQuoted 29 lines · Alex Williamson
Quoted 15 lines · On Wed, 2 Nov 2022 16:01:45 +0100 Eric Farman <[email protected]> wrote:
Hi all,
Here is an update to the vfio-ccw lifecycle changes that have been discussed in various forms over the past year [1][2] or so, and which I dusted off recently.
Patches 1-5 rework the behavior of the vfio-ccw driver's private struct. In summary, the mdev pieces are split out of
vfio_ccw_privateand into a newvfio_ccw_parentstruct that will continue to follow today's lifecycle. The remainder (bulk) of the private struct moves to follow the mdev probe/remove pair. There's opportunity for further separation of the things in the private struct, which would simplify some of the vfio-ccw code, but it got too hairy as I started that. Once vfio-ccw is no longer considered unique, those cleanups can happen at our leisure.Quoted 5 lines
Patch 6 removes the trickery where vfio-ccw uses
vfio_init_deviceinstead ofvfio_alloc_device, and thus removesvfio_init_devicefrom the outside world.Patch 7 removes
vfio_free_devicefrom vfio-ccw and the other drivers (hello, CC list!), letting it be handled byvfio_device_releasedirectly.Looks like another spin is pending, but the vfio core and collateral changes in 6 and 7 look good to me. Would this go in through the vfio or s390 tree? I'd be happy to merge or provide a branch, depending on the route.
Quoted 5 lines
For 6 & 7:
Acked-by Alex Williamson <[email protected]>Thanks,
Alex
LGTM with those few comments addressed -- @Eric please send a v3 and I think it's ready.
I would suggest vfio tree to reduce the chance of conflicts; this touches various vfio drivers (and main) with the last patches while the s390 hits are at least all contained to the vfio-ccw driver code.
Eric Farman
maintainerQuoted 45 lines · Matthew Rosato
Quoted 44 lines · Alex Williamson
Quoted 24 lines · On Wed, 2 Nov 2022 16:01:45 +0100 Eric Farman <[email protected]> wrote:
Hi all,
Here is an update to the vfio-ccw lifecycle changes that have been discussed
in various forms over the past year [1][2] or so, and which I dusted off
recently.Patches 1-5 rework the behavior of the vfio-ccw driver's private struct.
In summary, the mdev pieces are split out ofvfio_ccw_privateand into a
newvfio_ccw_parentstruct that will continue to follow today's lifecycle.
The remainder (bulk) of the private struct moves to follow the mdev
probe/remove pair. There's opportunity for further separation of the
things in the private struct, which would simplify some of the vfio-ccw
code, but it got too hairy as I started that. Once vfio-ccw is no longer
considered unique, those cleanups can happen at our leisure.Quoted 8 lines
Patch 6 removes the trickery where vfio-ccw uses
vfio_init_deviceinstead ofvfio_alloc_device, and thus removesvfio_init_devicefrom the outside world.Patch 7 removes
vfio_free_devicefrom vfio-ccw and the other drivers (hello,
CC list!), letting it be handled byvfio_device_releasedirectly.Looks like another spin is pending, but the vfio core and collateral
changes in 6 and 7 look good to me. Would this go in through the vfio
or s390 tree? I'd be happy to merge or provide a branch, depending on
the route.
Quoted 8 lines
Quoted 5 lines
For 6 & 7:
Acked-by Alex Williamson <[email protected]>Thanks,
AlexLGTM with those few comments addressed -- @Eric please send a v3 and I think it's ready.
Will do that now; thanks Matt.
Quoted 5 lines
I would suggest vfio tree to reduce the chance of conflicts; this touches various vfio drivers (and main) with the last patches while the s390 hits are at least all contained to the vfio-ccw driver code.
Agreed. Thanks to you both.