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]
Date: Tue, 19 Mar 2024 12:25:39 +0800
From: Muchun Song <muchun.song@...ux.dev>
To: Peter Xu <peterx@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
 Linux-MM <linux-mm@...ck.org>,
 Andrew Morton <akpm@...ux-foundation.org>,
 x86@...nel.org,
 Mike Rapoport <rppt@...nel.org>,
 Matthew Wilcox <willy@...radead.org>,
 sparclinux@...r.kernel.org,
 Jason Gunthorpe <jgg@...dia.com>,
 linuxppc-dev@...ts.ozlabs.org,
 Christophe Leroy <christophe.leroy@...roup.eu>,
 linux-arm-kernel@...ts.infradead.org,
 "David S . Miller" <davem@...emloft.net>,
 Andreas Larsson <andreas@...sler.com>
Subject: Re: [PATCH v2 05/14] mm/sparc: Change pXd_huge() behavior to exclude
 swap entries



> On Mar 19, 2024, at 04:03, peterx@...hat.com wrote:
> 
> From: Peter Xu <peterx@...hat.com>
> 
> Please refer to the previous patch on the reasoning for x86.  Now sparc is
> the only architecture that will allow swap entries to be reported as
> pXd_huge().  After this patch, all architectures should forbid swap entries
> in pXd_huge().
> 
> Cc: David S. Miller <davem@...emloft.net>
> Cc: Andreas Larsson <andreas@...sler.com>
> Cc: sparclinux@...r.kernel.org
> Signed-off-by: Peter Xu <peterx@...hat.com>
> ---
> arch/sparc/mm/hugetlbpage.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
> index b432500c13a5..d31c2cec35c9 100644
> --- a/arch/sparc/mm/hugetlbpage.c
> +++ b/arch/sparc/mm/hugetlbpage.c
> @@ -409,14 +409,12 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
> 
> int pmd_huge(pmd_t pmd)
> {
> - 	return !pmd_none(pmd) &&
> - 	(pmd_val(pmd) & (_PAGE_VALID|_PAGE_PMD_HUGE)) != _PAGE_VALID;
> + 	return pmd_leaf(pmd);;

There is a redundant semicolon in the end.

Thanks.

> }
> 
> int pud_huge(pud_t pud)
> {
> - 	return !pud_none(pud) &&
> - 	(pud_val(pud) & (_PAGE_VALID|_PAGE_PUD_HUGE)) != _PAGE_VALID;
> + 	return pud_leaf(pud);
> }
> 
> static void hugetlb_free_pte_range(struct mmu_gather *tlb, pmd_t *pmd,
> -- 
> 2.44.0
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ