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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251028170251.11688Aa3-hca@linux.ibm.com>
Date: Tue, 28 Oct 2025 18:02:51 +0100
From: Heiko Carstens <hca@...ux.ibm.com>
To: Joao Martins <joao.m.martins@...cle.com>
Cc: Luiz Capitulino <luizcap@...hat.com>, osalvador@...e.de,
        akpm@...ux-foundation.org, david@...hat.com, aneesh.kumar@...nel.org,
        borntraeger@...ux.ibm.com, mike.kravetz@...cle.com,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-s390@...r.kernel.org
Subject: Re: [PATCH] mm: hugetlb: fix HVO crash on s390

On Tue, Oct 28, 2025 at 04:48:57PM +0000, Joao Martins wrote:
> On 28/10/2025 16:14, Heiko Carstens wrote:
> > On Tue, Oct 28, 2025 at 04:05:45PM +0000, Joao Martins wrote:
> >>> +static inline void vmemmap_flush_tlb_all(void)
> >>> +{
> >>> +#ifdef CONFIG_S390
> >>> +	__tlb_flush_kernel();
> >>> +#else
> >>> +	flush_tlb_all();
> >>> +#endif
> >>> +}
> >>> +
> >>
> >> Wouldn't a better fix be to implement flush_tlb_all() in
> >> s390/include/asm/tlbflush.h since that aliases to __tlb_flush_kernel()?
> > 
> > The question is rather what is flush_tlb_all() supposed to flush? Is
> > it supposed to flush only tlb entries corresponding to the kernel
> > address space, or should it flush just everything?
> > 
> The latter i.e. everything
> 
> At least as far as I understand
> 
> > Within this context it looks like only tlb flushing for the kernel
> > address space is required(?)
> 
> That's correct. We are changing the vmemmap which is in the kernel address
> space, so that's the intent.
> 
> flush_tlb_all() however is the *closest* equivalent to this that's behind an
> arch generic API i.e. flushing kernel address space on all CPUs TLBs. IIUC, x86
> when doing flush_tlb_kernel_range with enough pages it switches to flush_tlb_all
> (these days on modern AMDs it's even one instruction solely in the calling CPU).

Considering that flush_tlb_all() should be mapped to __tlb_flush_global()
and not __tlb_flush_kernel() on s390.

However if there is only a need to flush tlb entries for the complete(?)
kernel address space, then I'd rather propose a new tlb_flush_kernel()
instead of a big hammer. If I'm not mistaken flush_tlb_kernel_range()
exists for just avoiding that. And if architectures can avoid a global
flush of _all_ tlb entries then that should be made possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ