vfio/ccw: read only one Format-1 IDAW
authorEric Farman <farman@linux.ibm.com>
Thu, 20 Oct 2022 17:00:14 +0000 (19:00 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 9 Jan 2023 13:34:08 +0000 (14:34 +0100)
commit667e5dbabf2bb790640525cff7d563cf88eb3e61
treeb76ac80096f6a6e6443a0cf8caad010f9fa8457d
parentb21f9cb1124e9fee33dd3c07108aabde060b6ef8
vfio/ccw: read only one Format-1 IDAW

The intention is to read the first IDAW to determine the starting
location of an I/O operation, knowing that the second and any/all
subsequent IDAWs will be aligned per architecture. But, this read
receives 64-bits of data, which is the size of a Format-2 IDAW.

In the event that Format-1 IDAWs are presented, adjust the size
of the read to 32-bits. The data will end up occupying the upper
word of the target iova variable, so shift it down to the lower
word for use as an address. (By definition, this IDAW format
uses a 31-bit address, so the "sign" bit will always be off and
there is no concern about sign extension.)

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/cio/vfio_ccw_cp.c