[lkml]   [2017]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH AUTOSEL for 4.14 02/51] s390: vfio-ccw: Do not attempt to free no-op, test and tic cda.
From: "Jason J. Herne" <>

[ Upstream commit 408358b50deaf59b07c82a7bff8c7e7cce031fae ]

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.

Signed-off-by: Jason J. Herne <>
Reviewed-by: Dong Jia Shi <>
Reviewed-by: Pierre Morel <>
Message-Id: <>
Reviewed-by: Halil Pasic <>
Acked-by: Christian Borntraeger <>
Signed-off-by: Cornelia Huck <>
Signed-off-by: Sasha Levin <>
drivers/s390/cio/vfio_ccw_cp.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c
index f20b4d66c75f..4a39b54732d0 100644
--- a/drivers/s390/cio/vfio_ccw_cp.c
+++ b/drivers/s390/cio/vfio_ccw_cp.c
@@ -330,6 +330,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)

 \ /
  Last update: 2017-11-23 00:05    [W:0.233 / U:1.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site