Skip to content

Commit

Permalink
s390/mm: Fix clearing storage keys for huge pages
Browse files Browse the repository at this point in the history
[ Upstream commit 412050a ]

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: 3afdfca ("s390/mm: Clear skeys for newly mapped huge guest pmds")
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]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Claudio Imbrenda authored and gregkh committed May 17, 2024
1 parent c12d92b commit 53ba53a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/s390/mm/hugetlbpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static void clear_huge_pte_skeys(struct mm_struct *mm, unsigned long rste)
}

if (!test_and_set_bit(PG_arch_1, &page->flags))
__storage_key_init_range(paddr, paddr + size - 1);
__storage_key_init_range(paddr, paddr + size);
}

void __set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
Expand Down

0 comments on commit 53ba53a

Please sign in to comment.