Skip to contentSkip to conversation

s390: vfio-ccw: Do not attempt to free no-op, test and tic cda.

PATCH Cornelia Huck 1 participant 1 message Nov 8, 2017 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Cornelia Huck

author Applied
#1 lore raw
Quoted 21 lines · On Tue, 7 Nov 2017 10:22:32 -0500 "Jason J. Herne"…

Because we do not make use of the cda (channel data address) for test, no-op ccws no address translation takes place. This means cda could contain a guest address which we do not want to attempt to free. Let's check the command type and skip cda free when it is not needed.

For a TIC ccw, ccw->cda points to either a ccw in an existing chain or it points to a whole new allocated chain. In either case the data will be freed when the owning chain is freed.

---
 drivers/s390/cio/vfio_ccw_cp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/s390/cio/vfio_ccw_cp.c +0 -0
index 5ccfdc8..325a9f4 100644

drivers/s390/cio/vfio_ccw_cp.c static void ccwchain_cda_free(struct ccwchain *chain, int idx) · line 336

Quoted 8 lines
drivers/s390/cio/vfio_ccw_cp.c +2 -0
@@ -329,6 +329,8 @@ static void ccwchain_cda_free(struct ccwchain *chain, int idx)
 {
 	struct ccw1 *ccw = chain->ch_ccw + idx;
 
+	if (ccw_is_test(ccw) || ccw_is_noop(ccw) || ccw_is_tic(ccw))
+		return;
 	if (!ccw->count)
 		return;
 

Thanks, applied.