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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZqlpbuJ7bXE_r9dO@x1n>
Date: Tue, 30 Jul 2024 18:30:06 -0400
From: Peter Xu <peterx@...hat.com>
To: James Houghton <jthoughton@...gle.com>
Cc: David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, stable@...r.kernel.org,
	Oscar Salvador <osalvador@...e.de>,
	Muchun Song <muchun.song@...ux.dev>,
	Baolin Wang <baolin.wang@...ux.alibaba.com>
Subject: Re: [PATCH v2] mm/hugetlb: fix hugetlb vs. core-mm PT locking

On Tue, Jul 30, 2024 at 01:43:35PM -0700, James Houghton wrote:
> On Tue, Jul 30, 2024 at 1:03 PM David Hildenbrand <david@...hat.com> wrote:
> > diff --git a/include/linux/mm.h b/include/linux/mm.h
> > index b100df8cb5857..1b1f40ff00b7d 100644
> > --- a/include/linux/mm.h
> > +++ b/include/linux/mm.h
> > @@ -2926,6 +2926,12 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
> >         return ptlock_ptr(page_ptdesc(pmd_page(*pmd)));
> >  }
> >
> > +static inline spinlock_t *ptep_lockptr(struct mm_struct *mm, pte_t *pte)
> > +{
> > +       BUILD_BUG_ON(IS_ENABLED(CONFIG_HIGHPTE));
> > +       return ptlock_ptr(virt_to_ptdesc(pte));
> 
> Hi David,
> 
> Small question: ptep_lockptr() does not handle the case where the size
> of the PTE table is larger than PAGE_SIZE, but pmd_lockptr() does.
> IIUC, for pte_lockptr() and ptep_lockptr() to return the same result
> in this case, ptep_lockptr() should be doing the masking that
> pmd_lockptr() is doing. Are you sure that you don't need to be doing
> it? (Or maybe I am misunderstanding something.)

I was just curious and looked at pte_alloc_one(), not too much archs
implemented it besides the default (which calls pte_alloc_one_noprof(), and
should be order=0 there).  I didn't see any arch that actually allocated
with non-zero orders.

The motorola/m68k one is slightly involved, but still.. nothing I spot yet.

Thanks,

-- 
Peter Xu


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ