OSDN Git Service

KVM: s390: gaccess: Refactor access address range check
authorJanis Schoetterl-Glausch <scgl@linux.ibm.com>
Fri, 26 Nov 2021 16:45:48 +0000 (17:45 +0100)
committerJanosch Frank <frankja@linux.ibm.com>
Fri, 17 Dec 2021 13:49:26 +0000 (14:49 +0100)
commit7faa543df19bf62d4583a64d3902705747f2ad29
tree2311f14c5b40bba8d8e1376a71b5b9b765a64742
parent416e7f0c9d613bf84e182eba9547ae8f9f5bfa4c
KVM: s390: gaccess: Refactor access address range check

Do not round down the first address to the page boundary, just translate
it normally, which gives the value we care about in the first place.
Given this, translating a single address is just the special case of
translating a range spanning a single page.

Make the output optional, so the function can be used to just check a
range.

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>
Message-Id: <20211126164549.7046-3-scgl@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
arch/s390/kvm/gaccess.c