[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240416114220.28489-3-imbrenda@linux.ibm.com>
Date: Tue, 16 Apr 2024 13:42:20 +0200
From: Claudio Imbrenda <imbrenda@...ux.ibm.com>
To: linux-s390@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, frankja@...ux.ibm.com, nrb@...ux.ibm.com,
nsg@...ux.ibm.com, borntraeger@...ibm.com, hca@...ux.ibm.com,
gerald.schaefer@...ux.ibm.com, david@...hat.com
Subject: [PATCH v1 2/2] s390/mm: fix clearing storage keys for 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: 3afdfca69870 ("s390/mm: Clear skeys for newly mapped huge guest pmds")
Signed-off-by: Claudio Imbrenda <imbrenda@...ux.ibm.com>
---
arch/s390/mm/hugetlbpage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index c2e8242bd15d..dc3db86e13ff 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -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,
--
2.44.0
Powered by blists - more mailing lists