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: <613ae7bd-b006-4f5a-8916-345001beb50f@arm.com>
Date: Thu, 8 May 2025 09:30:12 +0530
From: Dev Jain <dev.jain@....com>
To: Gavin Shan <gshan@...hat.com>, linux-arm-kernel@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org, catalin.marinas@....com, will@...nel.org,
 anshuman.khandual@....com, ryan.roberts@....com, peterx@...hat.com,
 joey.gouly@....com, yangyicong@...ilicon.com, shan.gavin@...il.com
Subject: Re: [PATCH] arm64: mm: Drop duplicate check in pmd_trans_huge()



On 08/05/25 9:21 am, Gavin Shan wrote:
> pmd_val(pmd) is inclusive to pmd_present(pmd) since the PMD entry
> value isn't zero when pmd_present() returns true. Just drop the
> duplicate check done by pmd_val(pmd).
> 
> No functional changes intended.
> 
> Signed-off-by: Gavin Shan <gshan@...hat.com>
> ---
> Found this by code inspection
> ---
>   arch/arm64/include/asm/pgtable.h | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> index d3b538be1500..2599b9b8666f 100644
> --- a/arch/arm64/include/asm/pgtable.h
> +++ b/arch/arm64/include/asm/pgtable.h
> @@ -739,8 +739,7 @@ static inline int pmd_trans_huge(pmd_t pmd)
>   	 * If pmd is present-invalid, pmd_table() won't detect it
>   	 * as a table, so force the valid bit for the comparison.
>   	 */
> -	return pmd_val(pmd) && pmd_present(pmd) &&
> -	       !pmd_table(__pmd(pmd_val(pmd) | PTE_VALID));
> +	return pmd_present(pmd) && !pmd_table(__pmd(pmd_val(pmd) | PTE_VALID));
>   }
>   #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>   

LGTM

Reviewed-by: Dev Jain <dev.jain@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ