s390/mm: Fix storage key clearing for guest huge pages
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Tue, 16 Apr 2024 11:42:19 +0000 (13:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 09:50:47 +0000 (11:50 +0200)
commite27a0db415377b8c047f1226e9b6e491e8cd88f9
treebf2a033a03c5391bbf803ee19f3f181ea81b97bc
parentfef735072de846164e9760be6b4a4a579937d1f3
s390/mm: Fix storage key clearing for guest huge pages

[ Upstream commit 843c3280686fc1a83d89ee1e0b5599c9f6b09d0c ]

The function __storage_key_init_range() expects the end address to be
the first byte outside the range to be initialized. I.e. end - start
should be the size of the area to be initialized.

The current code works because __storage_key_init_range() will still loop
over every page in the range, but it is slower than using sske_frame().

Fixes: 964c2c05c9f3 ("s390/mm: Clear huge page storage keys on enable_skey")
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Link: https://lore.kernel.org/r/20240416114220.28489-2-imbrenda@linux.ibm.com
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/mm/gmap.c