Skip to content

Commit 582b4e5

Browse files
gerald-schaeferVasily Gorbik
authored andcommitted
s390/mm: fix panic in gup_fast on large pud
On s390 there currently is no implementation of pud_write(). That was ok as long as we had our own implementation of get_user_pages_fast() which checked for pud protection by testing the bit directly w/o using pud_write(). The other callers of pud_write() are not reachable on s390. After commit 1a42010 ("s390/mm: convert to the generic get_user_pages_fast code") we use the generic get_user_pages_fast(), which does call pud_write() in pud_access_permitted() for FOLL_WRITE access on a large pud. Without an s390 specific pud_write(), the generic version is called, which contains a BUG() statement to remind us that we don't have a proper implementation. This results in a kernel panic. Fix this by providing an implementation of pud_write(). Cc: <[email protected]> # 5.2+ Fixes: 1a42010 ("s390/mm: convert to the generic get_user_pages_fast code") Signed-off-by: Gerald Schaefer <[email protected]> Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 98d54f8 commit 582b4e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/s390/include/asm/pgtable.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,12 @@ static inline int pmd_write(pmd_t pmd)
752752
return (pmd_val(pmd) & _SEGMENT_ENTRY_WRITE) != 0;
753753
}
754754

755+
#define pud_write pud_write
756+
static inline int pud_write(pud_t pud)
757+
{
758+
return (pud_val(pud) & _REGION3_ENTRY_WRITE) != 0;
759+
}
760+
755761
static inline int pmd_dirty(pmd_t pmd)
756762
{
757763
return (pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY) != 0;

0 commit comments

Comments
 (0)