From 8a54e238ef1eb6edd50335ee8626f6962c3dfb4f Mon Sep 17 00:00:00 2001 From: Eric Farman Date: Mon, 25 Jul 2022 22:21:14 +0200 Subject: vfio/ccw: cleanup some of the mdev commentary There is no longer an mdev struct accessible via a channel program struct, but there are some artifacts remaining that mention it. Clean them up. Signed-off-by: Eric Farman Reviewed-by: Matthew Rosato Signed-off-by: Heiko Carstens --- drivers/s390/cio/vfio_ccw_cp.h | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/s390/cio/vfio_ccw_cp.h') diff --git a/drivers/s390/cio/vfio_ccw_cp.h b/drivers/s390/cio/vfio_ccw_cp.h index 54d26e242533..16138a654fdd 100644 --- a/drivers/s390/cio/vfio_ccw_cp.h +++ b/drivers/s390/cio/vfio_ccw_cp.h @@ -27,7 +27,6 @@ * struct channel_program - manage information for channel program * @ccwchain_list: list head of ccwchains * @orb: orb for the currently processed ssch request - * @mdev: the mediated device to perform page pinning/unpinning * @initialized: whether this instance is actually initialized * * @ccwchain_list is the head of a ccwchain list, that contents the -- cgit v1.2.3 From 9fbed59fcd16e60dde2528038cc343abd65c0948 Mon Sep 17 00:00:00 2001 From: Eric Farman Date: Thu, 10 Nov 2022 03:30:23 +0100 Subject: vfio/ccw: simplify the cp_get_orb interface There's no need to send in both the address of the subchannel struct, and an element within it, to populate the ORB. Pass the whole pointer and let cp_get_orb() take the pieces that are needed. Suggested-by: Matthew Rosato Signed-off-by: Eric Farman Reviewed-by: Matthew Rosato Signed-off-by: Heiko Carstens --- drivers/s390/cio/vfio_ccw_cp.c | 9 ++++----- drivers/s390/cio/vfio_ccw_cp.h | 2 +- drivers/s390/cio/vfio_ccw_fsm.c | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'drivers/s390/cio/vfio_ccw_cp.h') diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c index 9e6df1f2fbee..a0060ef1119e 100644 --- a/drivers/s390/cio/vfio_ccw_cp.c +++ b/drivers/s390/cio/vfio_ccw_cp.c @@ -816,14 +816,13 @@ out_err: /** * cp_get_orb() - get the orb of the channel program * @cp: channel_program on which to perform the operation - * @intparm: new intparm for the returned orb - * @lpm: candidate value of the logical-path mask for the returned orb + * @sch: subchannel the operation will be performed against * * This function returns the address of the updated orb of the channel * program. Channel I/O device drivers could use this orb to issue a * ssch. */ -union orb *cp_get_orb(struct channel_program *cp, u32 intparm, u8 lpm) +union orb *cp_get_orb(struct channel_program *cp, struct subchannel *sch) { union orb *orb; struct ccwchain *chain; @@ -835,12 +834,12 @@ union orb *cp_get_orb(struct channel_program *cp, u32 intparm, u8 lpm) orb = &cp->orb; - orb->cmd.intparm = intparm; + orb->cmd.intparm = (u32)virt_to_phys(sch); orb->cmd.fmt = 1; orb->cmd.key = PAGE_DEFAULT_KEY >> 4; if (orb->cmd.lpm == 0) - orb->cmd.lpm = lpm; + orb->cmd.lpm = sch->lpm; chain = list_first_entry(&cp->ccwchain_list, struct ccwchain, next); cpa = chain->ch_ccw; diff --git a/drivers/s390/cio/vfio_ccw_cp.h b/drivers/s390/cio/vfio_ccw_cp.h index 16138a654fdd..fc31eb699807 100644 --- a/drivers/s390/cio/vfio_ccw_cp.h +++ b/drivers/s390/cio/vfio_ccw_cp.h @@ -43,7 +43,7 @@ struct channel_program { int cp_init(struct channel_program *cp, union orb *orb); void cp_free(struct channel_program *cp); int cp_prefetch(struct channel_program *cp); -union orb *cp_get_orb(struct channel_program *cp, u32 intparm, u8 lpm); +union orb *cp_get_orb(struct channel_program *cp, struct subchannel *sch); void cp_update_scsw(struct channel_program *cp, union scsw *scsw); bool cp_iova_pinned(struct channel_program *cp, u64 iova, u64 length); diff --git a/drivers/s390/cio/vfio_ccw_fsm.c b/drivers/s390/cio/vfio_ccw_fsm.c index 2784a4e4d2be..757b73141246 100644 --- a/drivers/s390/cio/vfio_ccw_fsm.c +++ b/drivers/s390/cio/vfio_ccw_fsm.c @@ -27,7 +27,7 @@ static int fsm_io_helper(struct vfio_ccw_private *private) spin_lock_irqsave(sch->lock, flags); - orb = cp_get_orb(&private->cp, (u32)virt_to_phys(sch), sch->lpm); + orb = cp_get_orb(&private->cp, sch); if (!orb) { ret = -EIO; goto out; -- cgit v1.2.3