diff options
author | Claudio Imbrenda <imbrenda@linux.ibm.com> | 2024-04-16 14:42:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-17 12:47:59 +0300 |
commit | e93c82fa966a9106456116208beda2ef58a41235 (patch) | |
tree | 2edc034be9869944c8d07f0e4282031a14b117fb /arch | |
parent | 3994f81ab6e1e28c3a1c35916a7726ccd4dfc940 (diff) | |
download | linux-e93c82fa966a9106456116208beda2ef58a41235.tar.xz |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/mm/gmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c index b5a60fbb9664..ad4bae2465b1 100644 --- a/arch/s390/mm/gmap.c +++ b/arch/s390/mm/gmap.c @@ -2627,7 +2627,7 @@ static int __s390_enable_skey_hugetlb(pte_t *pte, unsigned long addr, return 0; start = pmd_val(*pmd) & HPAGE_MASK; - end = start + HPAGE_SIZE - 1; + end = start + HPAGE_SIZE; __storage_key_init_range(start, end); set_bit(PG_arch_1, &page->flags); cond_resched(); |