From 21c7996917cb5c9d8669409b00d990b75d22a849 Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Mon, 21 Nov 2022 17:58:35 +0100 Subject: [PATCH] vfio/ccw: sort out physical vs virtual pointers usage The ORB's interrupt parameter field is stored unmodified into the interruption code when an I/O interrupt occurs. As this reflects a real device, let's store the physical address of the subchannel struct so it can be used when processing an interrupt. Note: this currently doesn't fix a real bug, since virtual addresses are identical to physical ones. Signed-off-by: Alexander Gordeev [EF: Updated commit message] Signed-off-by: Eric Farman Reviewed-by: Matthew Rosato Reviewed-by: Nico Boehr Link: https://lore.kernel.org/r/20221121165836.283781-2-farman@linux.ibm.com --- drivers/s390/cio/vfio_ccw_fsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/cio/vfio_ccw_fsm.c b/drivers/s390/cio/vfio_ccw_fsm.c index a59c758..0a5e8b4 100644 --- a/drivers/s390/cio/vfio_ccw_fsm.c +++ b/drivers/s390/cio/vfio_ccw_fsm.c @@ -29,7 +29,7 @@ static int fsm_io_helper(struct vfio_ccw_private *private) spin_lock_irqsave(sch->lock, flags); - orb = cp_get_orb(&private->cp, (u32)(addr_t)sch, sch->lpm); + orb = cp_get_orb(&private->cp, (u32)virt_to_phys(sch), sch->lpm); if (!orb) { ret = -EIO; goto out; -- 2.7.4