linux-stable/drivers/s390
Tony Krowiak f88fb13357 s390/vfio-ap: make sure nib is shared
Since the NIB is visible by HW, KVM and the (PV) guest it needs to be
in non-secure or secure but shared storage. Return code 6 is used to
indicate to a PV guest that its NIB would be on secure, unshared
storage and therefore the NIB address is invalid.

Unfortunately we have no easy way to check if a page is unshared after
vfio_pin_pages() since it will automatically export an unshared page
if the UV pin shared call did not succeed due to a page being in
unshared state.

Therefore we use the fact that UV pinning it a second time is a nop
but trying to pin an exported page is an error (0x102). If we
encounter this error, we do a vfio unpin and import the page again,
since vfio_pin_pages() exported it.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Acked-by: Halil Pasic <pasic@linux.ibm.com>
Tested-by: Viktor Mihajlovski <mihajlov@linux.ibm.com>
Link: https://lore.kernel.org/r/20230815184333.6554-13-akrowiak@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-08-18 15:24:39 +02:00
..
block s390 updates for 6.5 merge window part 2 2023-07-06 13:18:30 -07:00
char s390 updates for 6.5 merge window part 2 2023-07-06 13:18:30 -07:00
cio s390: fix various typos 2023-07-03 11:19:42 +02:00
crypto s390/vfio-ap: make sure nib is shared 2023-08-18 15:24:39 +02:00
net Networking fixes for 6.5-rc2, including fixes from netfilter, 2023-07-13 14:21:22 -07:00
scsi scsi: zfcp: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
virtio virtio: add VIRTIO_F_NOTIFICATION_DATA feature support 2023-04-21 03:02:35 -04:00
Makefile