Skip to content

Commit

Permalink
KVM: s390/mm: Fix CMMA reset during reboot
Browse files Browse the repository at this point in the history
commit 1e133ab ("s390/mm: split arch/s390/mm/pgtable.c") factored
out the page table handling code from __gmap_zap and  __s390_reset_cmma
into ptep_zap_unused and added a simple flag that tells which one of the
function (reset or not) is to be made. This also changed the behaviour,
as it also zaps unused page table entries on reset.
Turns out that this is wrong as s390_reset_cmma uses the page walker,
which DOES NOT take the ptl lock.

The most simple fix is to not do the zapping part on reset (which uses
the walker)

Signed-off-by: Christian Borntraeger <[email protected]>
Fixes: 1e133ab ("s390/mm: split arch/s390/mm/pgtable.c")
Cc: [email protected] # 4.6+
Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
borntraeger authored and Martin Schwidefsky committed Jun 13, 2016
1 parent 5edb564 commit 1c343f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/s390/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ void ptep_zap_unused(struct mm_struct *mm, unsigned long addr,
pgste = pgste_get_lock(ptep);
pgstev = pgste_val(pgste);
pte = *ptep;
if (pte_swap(pte) &&
if (!reset && pte_swap(pte) &&
((pgstev & _PGSTE_GPS_USAGE_MASK) == _PGSTE_GPS_USAGE_UNUSED ||
(pgstev & _PGSTE_GPS_ZERO))) {
ptep_zap_swap_entry(mm, pte_to_swp_entry(pte));
Expand Down

0 comments on commit 1c343f7

Please sign in to comment.