vfio/ccw: calculate number of IDAWs regardless of format
authorEric Farman <farman@linux.ibm.com>
Wed, 2 Dec 2020 18:37:24 +0000 (19:37 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 9 Jan 2023 13:34:08 +0000 (14:34 +0100)
commit6a6dc14ac84733cf5864a7cf9f5b3e43f6a79be8
tree7a9ea8fb6919d9d0414be728428ea4313dfa45c0
parent667e5dbabf2bb790640525cff7d563cf88eb3e61
vfio/ccw: calculate number of IDAWs regardless of format

The idal_nr_words() routine works well for 4K IDAWs, but lost its
ability to handle the old 2K formats with the removal of 31-bit
builds in commit 5a79859ae0f3 ("s390: remove 31 bit support").

Since there's nothing preventing a guest from generating this IDAW
format, let's re-introduce the math for them and use both when
calculating the number of IDAWs based on the bits specified in
the ORB.

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>
arch/s390/include/asm/idals.h
drivers/s390/cio/vfio_ccw_cp.c