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: <f13b3394-cd16-dc20-4069-083c86f5b706@arm.com>
Date:   Mon, 10 May 2021 17:21:40 +0530
From:   Anshuman Khandual <anshuman.khandual@....com>
To:     Oscar Salvador <osalvador@...e.de>
Cc:     Peter Zijlstra <peterz@...radead.org>, linux-mm@...ck.org,
        akpm@...ux-foundation.org, Heiko Carstens <hca@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
        linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/thp: Make ARCH_ENABLE_SPLIT_PMD_PTLOCK dependent on
 PGTABLE_LEVELS > 2



On 5/10/21 3:46 PM, Anshuman Khandual wrote:
> 
> 
> On 5/10/21 3:40 PM, Oscar Salvador wrote:
>> On Mon, May 10, 2021 at 03:36:29PM +0530, Anshuman Khandual wrote:
>>>
>>>
>>> On 5/10/21 2:23 PM, Peter Zijlstra wrote:
>>>> On Mon, May 10, 2021 at 10:05:45AM +0530, Anshuman Khandual wrote:
>>>>> -	select ARCH_ENABLE_SPLIT_PMD_PTLOCK if X86_64 || X86_PAE
>>>>> +	select ARCH_ENABLE_SPLIT_PMD_PTLOCK if (PGTABLE_LEVELS > 2) && (X86_64 || X86_PAE)
>>>>
>>>> It's still very early on a Monday, but IIRC this new condition is
>>>> identical to the pre-existing one.
>>>
>>> Did not get it, could you please elaborate ?
>>
>> When using x86_PAE, you must have more than two pgtable levels, right?
>> And not speaking of x86_64.
> 
> arch/x86/Kconfig..
> 
> config PGTABLE_LEVELS
>         int
>         default 5 if X86_5LEVEL
>         default 4 if X86_64
>         default 3 if X86_PAE
>         default 2
> 
> Both X86_PAE and X86_64 will always have page table levels > 2 ? But
> regardless, it might be still useful to assert (PGTABLE_LEVELS > 2)
> before selecting ARCH_ENABLE_SPLIT_PMD_PTLOCK.

PGTABLE_LEVELS > 2 is a necessary condition for this PMD split lock
config. The problem is that for arch selectable configs like this,
conditional statements would not work properly when defined along
with the config. Otherwise the following change would have been
sufficient.

diff --git a/mm/Kconfig b/mm/Kconfig
index 02d44e3420f5..5830ea7746b3 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -214,6 +214,7 @@ config SPLIT_PTLOCK_CPUS
 
 config ARCH_ENABLE_SPLIT_PMD_PTLOCK
        bool
+       depends on PGTABLE_LEVELS > 2

Hence this just moves the condition to all subscribing platforms
while making the selection for ARCH_ENABLE_SPLIT_PMD_PTLOCK.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ