OSDN Git Service

KVM: s390: handle_tprot: Honor storage keys
authorJanis Schoetterl-Glausch <scgl@linux.ibm.com>
Fri, 11 Feb 2022 18:22:08 +0000 (19:22 +0100)
committerChristian Borntraeger <borntraeger@linux.ibm.com>
Mon, 14 Feb 2022 15:12:57 +0000 (16:12 +0100)
commit61380a7adfce1524b8cd16c0ce4f46abce587f95
tree08cb07d8d0e88f24630c3ad24a8b304d32350cbf
parente613d83454d7da1c37d78edb278db9c20afb21a2
KVM: s390: handle_tprot: Honor storage keys

Use the access key operand to check for key protection when
translating guest addresses.
Since the translation code checks for accessing exceptions/error hvas,
we can remove the check here and simplify the control flow.
Keep checking if the memory is read-only even if such memslots are
currently not supported.

handle_tprot was the last user of guest_translate_address,
so remove it.

Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Link: https://lore.kernel.org/r/20220211182215.2730017-4-scgl@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
arch/s390/kvm/gaccess.c
arch/s390/kvm/gaccess.h
arch/s390/kvm/priv.c