]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Nov 2024 00:52:35 +0000 (01:52 +0100)
commit567e7bcb10cccf5bf273476cc2d4bd7883e23495
treeaffd5bf8fb8c738a0939f8f3652719c9c6f256f8
parent1f1c1ccdcb50e626bff00545740e2e7e0df1586c
KVM: s390: gaccess: Refactor access address range check

[ Upstream commit 7faa543df19bf62d4583a64d3902705747f2ad29 ]

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>
Stable-dep-of: e8061f06185b ("KVM: s390: gaccess: Check if guest address is in memslot")
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/kvm/gaccess.c