[PATCH v2 5/5] KVM: s390: Properly reset zero bit in PGSTE
From: Claudio Imbrenda
Date: Tue May 12 2026 - 14:27:55 EST
When calling _gmap_ptep_xchg(), always clear the pgste.zero bit. This
prevents the page from being accidentally discarded when getting
unmapped.
Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
---
arch/s390/kvm/gmap.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/s390/kvm/gmap.h b/arch/s390/kvm/gmap.h
index e490f2995a26..4de9ed8d58ba 100644
--- a/arch/s390/kvm/gmap.h
+++ b/arch/s390/kvm/gmap.h
@@ -199,6 +199,7 @@ static inline union pgste _gmap_ptep_xchg(struct gmap *gmap, union pte *ptep, un
}
if (!ptep->s.d && newpte.s.d && !newpte.s.s)
SetPageDirty(pfn_to_page(newpte.h.pfra));
+ pgste.zero = 0;
return __dat_ptep_xchg(ptep, pgste, newpte, gfn, gmap->asce, uses_skeys(gmap));
}
--
2.54.0