lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251125192412.7336A36-hca@linux.ibm.com>
Date: Tue, 25 Nov 2025 20:24:12 +0100
From: Heiko Carstens <hca@...ux.ibm.com>
To: Claudio Imbrenda <imbrenda@...ux.ibm.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-s390@...r.kernel.org, borntraeger@...ibm.com,
        frankja@...ux.ibm.com, nsg@...ux.ibm.com, nrb@...ux.ibm.com,
        seiden@...ux.ibm.com, gra@...ux.ibm.com, schlameuss@...ux.ibm.com,
        svens@...ux.ibm.com, agordeev@...ux.ibm.com, gor@...ux.ibm.com,
        david@...hat.com, gerald.schaefer@...ux.ibm.com
Subject: Re: [PATCH v5 21/23] KVM: S390: Remove PGSTE code from linux/s390 mm

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@...ux.ibm.com>
> ---
>  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)
>  {
> -	pgste_t pgste;
> -	pte_t old;
> -	int nodat;
> -	struct mm_struct *mm = vma->vm_mm;
> -
> -	pgste = ptep_xchg_start(mm, addr, ptep);
> -	nodat = !!(pgste_val(pgste) & _PGSTE_GPS_NODAT);
> -	old = ptep_flush_lazy(mm, addr, ptep, nodat);
> -	if (mm_has_pgste(mm)) {
> -		pgste = pgste_update_all(old, pgste, mm);
> -		pgste_set(ptep, pgste);
> -	}
> -	return old;
> +	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)
>  {
> -	pgste_t pgste;
> -	struct mm_struct *mm = vma->vm_mm;
> -
> -	if (mm_has_pgste(mm)) {
> -		pgste = pgste_get(ptep);
> -		pgste_set_key(ptep, pgste, pte, mm);
> -		pgste = pgste_set_pte(ptep, pgste, pte);
> -		pgste_set_unlock(ptep, pgste);
> -	} else {
> -		set_pte(ptep, 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()...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ