Skip to content

Commit 843c328

Browse files
Claudio ImbrendaAlexander Gordeev
authored andcommitted
s390/mm: Fix storage key clearing for guest huge pages
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: 964c2c0 ("s390/mm: Clear huge page storage keys on enable_skey") Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Claudio Imbrenda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexander Gordeev <[email protected]>
1 parent d111855 commit 843c328

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/mm/gmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2661,7 +2661,7 @@ static int __s390_enable_skey_hugetlb(pte_t *pte, unsigned long addr,
26612661
return 0;
26622662

26632663
start = pmd_val(*pmd) & HPAGE_MASK;
2664-
end = start + HPAGE_SIZE - 1;
2664+
end = start + HPAGE_SIZE;
26652665
__storage_key_init_range(start, end);
26662666
set_bit(PG_arch_1, &page->flags);
26672667
cond_resched();

0 commit comments

Comments
 (0)