Re: [PATCH v5 21/23] KVM: S390: Remove PGSTE code from linux/s390 mm

From: Claudio Imbrenda
Date: Wed Nov 26 2025 - 03:47:28 EST


On Wed, 26 Nov 2025 09:38:18 +0100
Heiko Carstens <hca@xxxxxxxxxxxxx> wrote:

> On Tue, Nov 25, 2025 at 08:24:12PM +0100, Heiko Carstens wrote:
> > On Mon, Nov 24, 2025 at 12:55:52PM +0100, Claudio Imbrenda wrote:
> > > Remove the PGSTE config option.
> > > Remove all code from linux/s390 mm that involves PGSTEs.
> > >
> > > Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
> > > ---
> > > arch/s390/Kconfig | 3 -
> > > arch/s390/include/asm/mmu.h | 13 -
> > > arch/s390/include/asm/page.h | 4 -
> > > arch/s390/include/asm/pgalloc.h | 4 -
> > > arch/s390/include/asm/pgtable.h | 121 +----
> > > arch/s390/kvm/dat.h | 1 +
> > > arch/s390/mm/hugetlbpage.c | 24 -
> > > arch/s390/mm/pgalloc.c | 24 -
> > > arch/s390/mm/pgtable.c | 829 +-------------------------------
> > > mm/khugepaged.c | 9 -
> > > 10 files changed, 17 insertions(+), 1015 deletions(-)
> >
> > ...
> >
> > > pte_t ptep_modify_prot_start(struct vm_area_struct *vma, unsigned long addr,
> > > pte_t *ptep)
> > > {
> > > + preempt_disable();
> > > + return ptep_flush_lazy(vma->vm_mm, addr, ptep, 1);
> > > }
> > >
> > > void ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr,
> > > pte_t *ptep, pte_t old_pte, pte_t pte)
> > > {
> ...
> > > + set_pte(ptep, pte);
> > > + preempt_enable();
> > > }
> >
> > Why did you add the preempt_disable()/preempt_enable() pair?
> > This causes preempt_count overflows.
> >
> > See modify_prot_start_ptes() + modify_prot_commit_ptes()...
>
> Ah, I guess this is probably just a rebase error, which by accident
> re-introduced the code which was removed with commit 57834ce5a6a4
> ("s390/mm: Prevent possible preempt_count overflow").

that would indeed explain where that code comes from...

I'll fix it