All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Mike Rapoport <rppt@kernel.org>
Cc: Rich Felker <dalias@libc.org>,
	linux-ia64@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-sh@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-mm@kvack.org, Paul Mackerras <paulus@samba.org>,
	linux-hexagon@vger.kernel.org, Will Deacon <will@kernel.org>,
	kvmarm@lists.cs.columbia.edu, Jonas Bonn <jonas@southpole.se>,
	linux-arch@vger.kernel.org, Brian Cain <bcain@codeaurora.org>,
	Marc Zyngier <maz@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Ley Foon Tan <ley.foon.tan@intel.com>,
	Mike Rapoport <rppt@linux.ibm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	uclinux-h8-devel@lists.sourceforge.jp,
	Fenghua Yu <fenghua.yu@intel.com>, Arnd Bergmann <arnd@arndb.de>,
	kvm-ppc@vger.kernel.org,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	openrisc@lists.librecores.org, Stafford Horne <shorne@gmail.com>,
	Guan Xuetao <gxt@pku.edu.cn>,
	linux-arm-kernel@lists.infradead.org,
	Tony Luck <tony.luck@intel.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	linux-kernel@vger.kernel.org,
	Michael Ellerman <mpe@ellerman.id.au>,
	nios2-dev@lists.rocketboards.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 07/13] powerpc: add support for folded p4d page tables
Date: Wed, 26 Feb 2020 11:20:49 +0000	[thread overview]
Message-ID: <7a008227-433c-73d7-b01a-1c6c7c66f04e@c-s.fr> (raw)
In-Reply-To: <20200226105615.GB11803@hump>



Le 26/02/2020 à 11:56, Mike Rapoport a écrit :
> On Wed, Feb 26, 2020 at 10:46:13AM +0100, Christophe Leroy wrote:
>>
>>
>> Le 26/02/2020 à 10:13, Mike Rapoport a écrit :
>>> On Tue, Feb 18, 2020 at 12:54:40PM +0200, Mike Rapoport wrote:
>>>> On Sun, Feb 16, 2020 at 11:41:07AM +0100, Christophe Leroy wrote:
>>>>>
>>>>>
>>>>> Le 16/02/2020 à 09:18, Mike Rapoport a écrit :
>>>>>> From: Mike Rapoport <rppt@linux.ibm.com>
>>>>>>
>>>>>> Implement primitives necessary for the 4th level folding, add walks of p4d
>>>>>> level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h.
>>>>>
>>>>> I don't think it is worth adding all this additionnals walks of p4d, this
>>>>> patch could be limited to changes like:
>>>>>
>>>>> -		pud = pud_offset(pgd, gpa);
>>>>> +		pud = pud_offset(p4d_offset(pgd, gpa), gpa);
>>>>>
>>>>> The additionnal walks should be added through another patch the day powerpc
>>>>> need them.
>>>>
>>>> Ok, I'll update the patch to reduce walking the p4d.
>>>
>>> Here's what I have with more direct acceses from pgd to pud.
>>
>> I went quickly through. This looks promising.
>>
>> Do we need the walk_p4d() in arch/powerpc/mm/ptdump/hashpagetable.c ?
>> Can't we just do
>>
>> @@ -445,7 +459,7 @@ static void walk_pagetables(struct pg_state *st)
>>   		addr = KERN_VIRT_START + i * PGDIR_SIZE;
>>   		if (!pgd_none(*pgd))
>>   			/* pgd exists */
>> -			walk_pud(st, pgd, addr);
>> +			walk_pud(st, p4d_offset(pgd, addr), addr);
> 
> We can do
> 
> 	addr = KERN_VIRT_START + i * PGDIR_SIZE;
> 	p4d = p4d_offset(pgd, addr);
> 	if (!p4d_none(*pgd))
> 		walk_pud()
> 
> But I don't think this is really essential. Again, we are trading off code
> consistency vs line count. I don't think line count is that important.

Ok.

Christophe

WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Mike Rapoport <rppt@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Brian Cain <bcain@codeaurora.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Guan Xuetao <gxt@pku.edu.cn>, James Morse <james.morse@arm.com>,
	Jonas Bonn <jonas@southpole.se>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	Ley Foon Tan <ley.foon.tan@intel.com>,
	Marc Zyngier <maz@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>, Rich Felker <dalias@libc.org>,
	Russell King <linux@armlinux.org.uk>,
	Stafford Horne <shorne@gmail.com>,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Tony Luck <tony.luck@intel.com>, Will Deacon <will@kernel.org>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	kvmarm@lists.cs.columbia.edu, kvm-ppc@vger.kernel.org,
	linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org,
	linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org,
	linux-sh@vger.kernel.org, nios2-dev@lists.rocketboards.org,
	openrisc@lists.librecores.org,
	uclinux-h8-devel@lists.sourceforge.jp,
	Mike Rapoport <rppt@linux.ibm.com>
Subject: Re: [PATCH v2 07/13] powerpc: add support for folded p4d page tables
Date: Wed, 26 Feb 2020 12:20:49 +0100	[thread overview]
Message-ID: <7a008227-433c-73d7-b01a-1c6c7c66f04e@c-s.fr> (raw)
In-Reply-To: <20200226105615.GB11803@hump>



Le 26/02/2020 à 11:56, Mike Rapoport a écrit :
> On Wed, Feb 26, 2020 at 10:46:13AM +0100, Christophe Leroy wrote:
>>
>>
>> Le 26/02/2020 à 10:13, Mike Rapoport a écrit :
>>> On Tue, Feb 18, 2020 at 12:54:40PM +0200, Mike Rapoport wrote:
>>>> On Sun, Feb 16, 2020 at 11:41:07AM +0100, Christophe Leroy wrote:
>>>>>
>>>>>
>>>>> Le 16/02/2020 à 09:18, Mike Rapoport a écrit :
>>>>>> From: Mike Rapoport <rppt@linux.ibm.com>
>>>>>>
>>>>>> Implement primitives necessary for the 4th level folding, add walks of p4d
>>>>>> level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h.
>>>>>
>>>>> I don't think it is worth adding all this additionnals walks of p4d, this
>>>>> patch could be limited to changes like:
>>>>>
>>>>> -		pud = pud_offset(pgd, gpa);
>>>>> +		pud = pud_offset(p4d_offset(pgd, gpa), gpa);
>>>>>
>>>>> The additionnal walks should be added through another patch the day powerpc
>>>>> need them.
>>>>
>>>> Ok, I'll update the patch to reduce walking the p4d.
>>>
>>> Here's what I have with more direct acceses from pgd to pud.
>>
>> I went quickly through. This looks promising.
>>
>> Do we need the walk_p4d() in arch/powerpc/mm/ptdump/hashpagetable.c ?
>> Can't we just do
>>
>> @@ -445,7 +459,7 @@ static void walk_pagetables(struct pg_state *st)
>>   		addr = KERN_VIRT_START + i * PGDIR_SIZE;
>>   		if (!pgd_none(*pgd))
>>   			/* pgd exists */
>> -			walk_pud(st, pgd, addr);
>> +			walk_pud(st, p4d_offset(pgd, addr), addr);
> 
> We can do
> 
> 	addr = KERN_VIRT_START + i * PGDIR_SIZE;
> 	p4d = p4d_offset(pgd, addr);
> 	if (!p4d_none(*pgd))
> 		walk_pud()
> 
> But I don't think this is really essential. Again, we are trading off code
> consistency vs line count. I don't think line count is that important.

Ok.

Christophe

WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Mike Rapoport <rppt@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Brian Cain <bcain@codeaurora.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Guan Xuetao <gxt@pku.edu.cn>, James Morse <james.morse@arm.com>,
	Jonas Bonn <jonas@southpole.se>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	Ley Foon Tan <ley.foon.tan@intel.com>,
	Marc Zyngier <maz@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>, Rich Felker <dalias@libc.org>,
	Russell King <linux@armlinux.org.uk>,
	Stafford Horne <shorne@gmail.com>,
	Stefan Kristiansson <stefan.kristian>
Subject: Re: [PATCH v2 07/13] powerpc: add support for folded p4d page tables
Date: Wed, 26 Feb 2020 12:20:49 +0100	[thread overview]
Message-ID: <7a008227-433c-73d7-b01a-1c6c7c66f04e@c-s.fr> (raw)
In-Reply-To: <20200226105615.GB11803@hump>



Le 26/02/2020 à 11:56, Mike Rapoport a écrit :
> On Wed, Feb 26, 2020 at 10:46:13AM +0100, Christophe Leroy wrote:
>>
>>
>> Le 26/02/2020 à 10:13, Mike Rapoport a écrit :
>>> On Tue, Feb 18, 2020 at 12:54:40PM +0200, Mike Rapoport wrote:
>>>> On Sun, Feb 16, 2020 at 11:41:07AM +0100, Christophe Leroy wrote:
>>>>>
>>>>>
>>>>> Le 16/02/2020 à 09:18, Mike Rapoport a écrit :
>>>>>> From: Mike Rapoport <rppt@linux.ibm.com>
>>>>>>
>>>>>> Implement primitives necessary for the 4th level folding, add walks of p4d
>>>>>> level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h.
>>>>>
>>>>> I don't think it is worth adding all this additionnals walks of p4d, this
>>>>> patch could be limited to changes like:
>>>>>
>>>>> -		pud = pud_offset(pgd, gpa);
>>>>> +		pud = pud_offset(p4d_offset(pgd, gpa), gpa);
>>>>>
>>>>> The additionnal walks should be added through another patch the day powerpc
>>>>> need them.
>>>>
>>>> Ok, I'll update the patch to reduce walking the p4d.
>>>
>>> Here's what I have with more direct acceses from pgd to pud.
>>
>> I went quickly through. This looks promising.
>>
>> Do we need the walk_p4d() in arch/powerpc/mm/ptdump/hashpagetable.c ?
>> Can't we just do
>>
>> @@ -445,7 +459,7 @@ static void walk_pagetables(struct pg_state *st)
>>   		addr = KERN_VIRT_START + i * PGDIR_SIZE;
>>   		if (!pgd_none(*pgd))
>>   			/* pgd exists */
>> -			walk_pud(st, pgd, addr);
>> +			walk_pud(st, p4d_offset(pgd, addr), addr);
> 
> We can do
> 
> 	addr = KERN_VIRT_START + i * PGDIR_SIZE;
> 	p4d = p4d_offset(pgd, addr);
> 	if (!p4d_none(*pgd))
> 		walk_pud()
> 
> But I don't think this is really essential. Again, we are trading off code
> consistency vs line count. I don't think line count is that important.

Ok.

Christophe

WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Mike Rapoport <rppt@kernel.org>
Cc: Rich Felker <dalias@libc.org>,
	linux-ia64@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-sh@vger.kernel.org, linux-mm@kvack.org,
	Paul Mackerras <paulus@samba.org>,
	linux-hexagon@vger.kernel.org, Will Deacon <will@kernel.org>,
	kvmarm@lists.cs.columbia.edu, Jonas Bonn <jonas@southpole.se>,
	linux-arch@vger.kernel.org, Brian Cain <bcain@codeaurora.org>,
	Marc Zyngier <maz@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Ley Foon Tan <ley.foon.tan@intel.com>,
	Mike Rapoport <rppt@linux.ibm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	uclinux-h8-devel@lists.sourceforge.jp,
	Fenghua Yu <fenghua.yu@intel.com>, Arnd Bergmann <arnd@arndb.de>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	kvm-ppc@vger.kernel.org,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	openrisc@lists.librecores.org, Stafford Horne <shorne@gmail.com>,
	Guan Xuetao <gxt@pku.edu.cn>,
	linux-arm-kernel@lists.infradead.org,
	Tony Luck <tony.luck@intel.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	linux-kernel@vger.kernel.org, James Morse <james.morse@arm.com>,
	nios2-dev@lists.rocketboards.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 07/13] powerpc: add support for folded p4d page tables
Date: Wed, 26 Feb 2020 12:20:49 +0100	[thread overview]
Message-ID: <7a008227-433c-73d7-b01a-1c6c7c66f04e@c-s.fr> (raw)
In-Reply-To: <20200226105615.GB11803@hump>



Le 26/02/2020 à 11:56, Mike Rapoport a écrit :
> On Wed, Feb 26, 2020 at 10:46:13AM +0100, Christophe Leroy wrote:
>>
>>
>> Le 26/02/2020 à 10:13, Mike Rapoport a écrit :
>>> On Tue, Feb 18, 2020 at 12:54:40PM +0200, Mike Rapoport wrote:
>>>> On Sun, Feb 16, 2020 at 11:41:07AM +0100, Christophe Leroy wrote:
>>>>>
>>>>>
>>>>> Le 16/02/2020 à 09:18, Mike Rapoport a écrit :
>>>>>> From: Mike Rapoport <rppt@linux.ibm.com>
>>>>>>
>>>>>> Implement primitives necessary for the 4th level folding, add walks of p4d
>>>>>> level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h.
>>>>>
>>>>> I don't think it is worth adding all this additionnals walks of p4d, this
>>>>> patch could be limited to changes like:
>>>>>
>>>>> -		pud = pud_offset(pgd, gpa);
>>>>> +		pud = pud_offset(p4d_offset(pgd, gpa), gpa);
>>>>>
>>>>> The additionnal walks should be added through another patch the day powerpc
>>>>> need them.
>>>>
>>>> Ok, I'll update the patch to reduce walking the p4d.
>>>
>>> Here's what I have with more direct acceses from pgd to pud.
>>
>> I went quickly through. This looks promising.
>>
>> Do we need the walk_p4d() in arch/powerpc/mm/ptdump/hashpagetable.c ?
>> Can't we just do
>>
>> @@ -445,7 +459,7 @@ static void walk_pagetables(struct pg_state *st)
>>   		addr = KERN_VIRT_START + i * PGDIR_SIZE;
>>   		if (!pgd_none(*pgd))
>>   			/* pgd exists */
>> -			walk_pud(st, pgd, addr);
>> +			walk_pud(st, p4d_offset(pgd, addr), addr);
> 
> We can do
> 
> 	addr = KERN_VIRT_START + i * PGDIR_SIZE;
> 	p4d = p4d_offset(pgd, addr);
> 	if (!p4d_none(*pgd))
> 		walk_pud()
> 
> But I don't think this is really essential. Again, we are trading off code
> consistency vs line count. I don't think line count is that important.

Ok.

Christophe

WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Mike Rapoport <rppt@kernel.org>
Cc: Rich Felker <dalias@libc.org>,
	linux-ia64@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-sh@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-mm@kvack.org, Paul Mackerras <paulus@samba.org>,
	linux-hexagon@vger.kernel.org, Will Deacon <will@kernel.org>,
	kvmarm@lists.cs.columbia.edu, Jonas Bonn <jonas@southpole.se>,
	linux-arch@vger.kernel.org, Brian Cain <bcain@codeaurora.org>,
	Marc Zyngier <maz@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Ley Foon Tan <ley.foon.tan@intel.com>,
	Mike Rapoport <rppt@linux.ibm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	uclinux-h8-devel@lists.sourceforge.jp,
	Fenghua Yu <fenghua.yu@intel.com>, Arnd Bergmann <arnd@arndb.de>,
	kvm-ppc@vger.kernel.org,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	openrisc@lists.librecores.org, Stafford Horne <shorne@gmail.com>,
	Guan Xuetao <gxt@pku.edu.cn>,
	linux-arm-kernel@lists.infradead.org,
	Tony Luck <tony.luck@intel.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	linux-kernel@vger.kernel.org,
	Michael Ellerman <mpe@ellerman.id.au>,
	nios2-dev@lists.rocketboards.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 07/13] powerpc: add support for folded p4d page tables
Date: Wed, 26 Feb 2020 12:20:49 +0100	[thread overview]
Message-ID: <7a008227-433c-73d7-b01a-1c6c7c66f04e@c-s.fr> (raw)
In-Reply-To: <20200226105615.GB11803@hump>



Le 26/02/2020 à 11:56, Mike Rapoport a écrit :
> On Wed, Feb 26, 2020 at 10:46:13AM +0100, Christophe Leroy wrote:
>>
>>
>> Le 26/02/2020 à 10:13, Mike Rapoport a écrit :
>>> On Tue, Feb 18, 2020 at 12:54:40PM +0200, Mike Rapoport wrote:
>>>> On Sun, Feb 16, 2020 at 11:41:07AM +0100, Christophe Leroy wrote:
>>>>>
>>>>>
>>>>> Le 16/02/2020 à 09:18, Mike Rapoport a écrit :
>>>>>> From: Mike Rapoport <rppt@linux.ibm.com>
>>>>>>
>>>>>> Implement primitives necessary for the 4th level folding, add walks of p4d
>>>>>> level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h.
>>>>>
>>>>> I don't think it is worth adding all this additionnals walks of p4d, this
>>>>> patch could be limited to changes like:
>>>>>
>>>>> -		pud = pud_offset(pgd, gpa);
>>>>> +		pud = pud_offset(p4d_offset(pgd, gpa), gpa);
>>>>>
>>>>> The additionnal walks should be added through another patch the day powerpc
>>>>> need them.
>>>>
>>>> Ok, I'll update the patch to reduce walking the p4d.
>>>
>>> Here's what I have with more direct acceses from pgd to pud.
>>
>> I went quickly through. This looks promising.
>>
>> Do we need the walk_p4d() in arch/powerpc/mm/ptdump/hashpagetable.c ?
>> Can't we just do
>>
>> @@ -445,7 +459,7 @@ static void walk_pagetables(struct pg_state *st)
>>   		addr = KERN_VIRT_START + i * PGDIR_SIZE;
>>   		if (!pgd_none(*pgd))
>>   			/* pgd exists */
>> -			walk_pud(st, pgd, addr);
>> +			walk_pud(st, p4d_offset(pgd, addr), addr);
> 
> We can do
> 
> 	addr = KERN_VIRT_START + i * PGDIR_SIZE;
> 	p4d = p4d_offset(pgd, addr);
> 	if (!p4d_none(*pgd))
> 		walk_pud()
> 
> But I don't think this is really essential. Again, we are trading off code
> consistency vs line count. I don't think line count is that important.

Ok.

Christophe
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Mike Rapoport <rppt@kernel.org>
Cc: Rich Felker <dalias@libc.org>,
	linux-ia64@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-sh@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-mm@kvack.org, Paul Mackerras <paulus@samba.org>,
	linux-hexagon@vger.kernel.org, Will Deacon <will@kernel.org>,
	kvmarm@lists.cs.columbia.edu, Jonas Bonn <jonas@southpole.se>,
	linux-arch@vger.kernel.org, Brian Cain <bcain@codeaurora.org>,
	Marc Zyngier <maz@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Ley Foon Tan <ley.foon.tan@intel.com>,
	Mike Rapoport <rppt@linux.ibm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	uclinux-h8-devel@lists.sourceforge.jp,
	Fenghua Yu <fenghua.yu@intel.com>, Arnd Bergmann <arnd@arndb.de>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	kvm-ppc@vger.kernel.org,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	openrisc@lists.librecores.org, Stafford Horne <shorne@gmail.com>,
	Guan Xuetao <gxt@pku.edu.cn>,
	linux-arm-kernel@lists.infradead.org,
	Tony Luck <tony.luck@intel.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	linux-kernel@vger.kernel.org, James Morse <james.morse@arm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	nios2-dev@lists.rocketboards.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 07/13] powerpc: add support for folded p4d page tables
Date: Wed, 26 Feb 2020 12:20:49 +0100	[thread overview]
Message-ID: <7a008227-433c-73d7-b01a-1c6c7c66f04e@c-s.fr> (raw)
In-Reply-To: <20200226105615.GB11803@hump>



Le 26/02/2020 à 11:56, Mike Rapoport a écrit :
> On Wed, Feb 26, 2020 at 10:46:13AM +0100, Christophe Leroy wrote:
>>
>>
>> Le 26/02/2020 à 10:13, Mike Rapoport a écrit :
>>> On Tue, Feb 18, 2020 at 12:54:40PM +0200, Mike Rapoport wrote:
>>>> On Sun, Feb 16, 2020 at 11:41:07AM +0100, Christophe Leroy wrote:
>>>>>
>>>>>
>>>>> Le 16/02/2020 à 09:18, Mike Rapoport a écrit :
>>>>>> From: Mike Rapoport <rppt@linux.ibm.com>
>>>>>>
>>>>>> Implement primitives necessary for the 4th level folding, add walks of p4d
>>>>>> level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h.
>>>>>
>>>>> I don't think it is worth adding all this additionnals walks of p4d, this
>>>>> patch could be limited to changes like:
>>>>>
>>>>> -		pud = pud_offset(pgd, gpa);
>>>>> +		pud = pud_offset(p4d_offset(pgd, gpa), gpa);
>>>>>
>>>>> The additionnal walks should be added through another patch the day powerpc
>>>>> need them.
>>>>
>>>> Ok, I'll update the patch to reduce walking the p4d.
>>>
>>> Here's what I have with more direct acceses from pgd to pud.
>>
>> I went quickly through. This looks promising.
>>
>> Do we need the walk_p4d() in arch/powerpc/mm/ptdump/hashpagetable.c ?
>> Can't we just do
>>
>> @@ -445,7 +459,7 @@ static void walk_pagetables(struct pg_state *st)
>>   		addr = KERN_VIRT_START + i * PGDIR_SIZE;
>>   		if (!pgd_none(*pgd))
>>   			/* pgd exists */
>> -			walk_pud(st, pgd, addr);
>> +			walk_pud(st, p4d_offset(pgd, addr), addr);
> 
> We can do
> 
> 	addr = KERN_VIRT_START + i * PGDIR_SIZE;
> 	p4d = p4d_offset(pgd, addr);
> 	if (!p4d_none(*pgd))
> 		walk_pud()
> 
> But I don't think this is really essential. Again, we are trading off code
> consistency vs line count. I don't think line count is that important.

Ok.

Christophe

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: openrisc@lists.librecores.org
Subject: [OpenRISC] [PATCH v2 07/13] powerpc: add support for folded p4d page tables
Date: Wed, 26 Feb 2020 12:20:49 +0100	[thread overview]
Message-ID: <7a008227-433c-73d7-b01a-1c6c7c66f04e@c-s.fr> (raw)
In-Reply-To: <20200226105615.GB11803@hump>



Le 26/02/2020 à 11:56, Mike Rapoport a écrit :
> On Wed, Feb 26, 2020 at 10:46:13AM +0100, Christophe Leroy wrote:
>>
>>
>> Le 26/02/2020 à 10:13, Mike Rapoport a écrit :
>>> On Tue, Feb 18, 2020 at 12:54:40PM +0200, Mike Rapoport wrote:
>>>> On Sun, Feb 16, 2020 at 11:41:07AM +0100, Christophe Leroy wrote:
>>>>>
>>>>>
>>>>> Le 16/02/2020 à 09:18, Mike Rapoport a écrit :
>>>>>> From: Mike Rapoport <rppt@linux.ibm.com>
>>>>>>
>>>>>> Implement primitives necessary for the 4th level folding, add walks of p4d
>>>>>> level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h.
>>>>>
>>>>> I don't think it is worth adding all this additionnals walks of p4d, this
>>>>> patch could be limited to changes like:
>>>>>
>>>>> -		pud = pud_offset(pgd, gpa);
>>>>> +		pud = pud_offset(p4d_offset(pgd, gpa), gpa);
>>>>>
>>>>> The additionnal walks should be added through another patch the day powerpc
>>>>> need them.
>>>>
>>>> Ok, I'll update the patch to reduce walking the p4d.
>>>
>>> Here's what I have with more direct acceses from pgd to pud.
>>
>> I went quickly through. This looks promising.
>>
>> Do we need the walk_p4d() in arch/powerpc/mm/ptdump/hashpagetable.c ?
>> Can't we just do
>>
>> @@ -445,7 +459,7 @@ static void walk_pagetables(struct pg_state *st)
>>   		addr = KERN_VIRT_START + i * PGDIR_SIZE;
>>   		if (!pgd_none(*pgd))
>>   			/* pgd exists */
>> -			walk_pud(st, pgd, addr);
>> +			walk_pud(st, p4d_offset(pgd, addr), addr);
> 
> We can do
> 
> 	addr = KERN_VIRT_START + i * PGDIR_SIZE;
> 	p4d = p4d_offset(pgd, addr);
> 	if (!p4d_none(*pgd))
> 		walk_pud()
> 
> But I don't think this is really essential. Again, we are trading off code
> consistency vs line count. I don't think line count is that important.

Ok.

Christophe

  reply	other threads:[~2020-02-26 11:20 UTC|newest]

Thread overview: 189+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-16  8:18 [PATCH v2 00/13] mm: remove __ARCH_HAS_5LEVEL_HACK Mike Rapoport
2020-02-16  8:18 ` Mike Rapoport
2020-02-16  8:18 ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18 ` Mike Rapoport
2020-02-16  8:18 ` Mike Rapoport
2020-02-16  8:18 ` Mike Rapoport
2020-02-16  8:18 ` Mike Rapoport
2020-02-16  8:18 ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 01/13] arm/arm64: add support for folded p4d page tables Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 02/13] h8300: remove usage of __ARCH_USE_5LEVEL_HACK Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 03/13] hexagon: remove __ARCH_USE_5LEVEL_HACK Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 04/13] ia64: add support for folded p4d page tables Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 05/13] nios2: " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 06/13] openrisc: " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 07/13] powerpc: " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16 10:41   ` Christophe Leroy
2020-02-16 10:41     ` [OpenRISC] " Christophe Leroy
2020-02-16 10:41     ` Christophe Leroy
2020-02-16 10:41     ` Christophe Leroy
2020-02-16 10:41     ` Christophe Leroy
2020-02-16 10:41     ` Christophe Leroy
2020-02-16 10:41     ` Christophe Leroy
2020-02-18 10:54     ` Mike Rapoport
2020-02-18 10:54       ` [OpenRISC] " Mike Rapoport
2020-02-18 10:54       ` Mike Rapoport
2020-02-18 10:54       ` Mike Rapoport
2020-02-18 10:54       ` Mike Rapoport
2020-02-18 10:54       ` Mike Rapoport
2020-02-18 10:54       ` Mike Rapoport
2020-02-26  9:13       ` Mike Rapoport
2020-02-26  9:13         ` [OpenRISC] " Mike Rapoport
2020-02-26  9:13         ` Mike Rapoport
2020-02-26  9:13         ` Mike Rapoport
2020-02-26  9:13         ` Mike Rapoport
2020-02-26  9:13         ` Mike Rapoport
2020-02-26  9:13         ` Mike Rapoport
2020-02-26  9:46         ` Christophe Leroy
2020-02-26  9:46           ` [OpenRISC] " Christophe Leroy
2020-02-26  9:46           ` Christophe Leroy
2020-02-26  9:46           ` Christophe Leroy
2020-02-26  9:46           ` Christophe Leroy
2020-02-26  9:46           ` Christophe Leroy
2020-02-26  9:46           ` Christophe Leroy
2020-02-26 10:56           ` Mike Rapoport
2020-02-26 10:56             ` [OpenRISC] " Mike Rapoport
2020-02-26 10:56             ` Mike Rapoport
2020-02-26 10:56             ` Mike Rapoport
2020-02-26 10:56             ` Mike Rapoport
2020-02-26 10:56             ` Mike Rapoport
2020-02-26 10:56             ` Mike Rapoport
2020-02-26 11:20             ` Christophe Leroy [this message]
2020-02-26 11:20               ` [OpenRISC] " Christophe Leroy
2020-02-26 11:20               ` Christophe Leroy
2020-02-26 11:20               ` Christophe Leroy
2020-02-26 11:20               ` Christophe Leroy
2020-02-26 11:20               ` Christophe Leroy
2020-02-26 11:20               ` Christophe Leroy
2020-02-19 12:07   ` Christophe Leroy
2020-02-19 12:07     ` [OpenRISC] " Christophe Leroy
2020-02-19 12:07     ` Christophe Leroy
2020-02-19 12:07     ` Christophe Leroy
2020-02-19 12:07     ` Christophe Leroy
2020-02-19 12:07     ` Christophe Leroy
2020-02-19 12:07     ` Christophe Leroy
2020-02-19 13:24     ` Mike Rapoport
2020-02-19 13:24       ` [OpenRISC] " Mike Rapoport
2020-02-19 13:24       ` Mike Rapoport
2020-02-19 13:24       ` Mike Rapoport
2020-02-19 13:24       ` Mike Rapoport
2020-02-19 13:24       ` Mike Rapoport
2020-02-19 13:24       ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 08/13] sh: fault: Modernize printing of kernel messages Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 09/13] sh: drop __pXd_offset() macros that duplicate pXd_index() ones Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 10/13] sh: add support for folded p4d page tables Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 11/13] unicore32: remove __ARCH_USE_5LEVEL_HACK Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 12/13] asm-generic: remove pgtable-nop4d-hack.h Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18 ` [PATCH v2 13/13] mm: remove __ARCH_HAS_5LEVEL_HACK and include/asm-generic/5level-fixup.h Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` [OpenRISC] " Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:18   ` Mike Rapoport
2020-02-16  8:22 ` [PATCH v2 00/13] mm: remove __ARCH_HAS_5LEVEL_HACK Russell King - ARM Linux admin
2020-02-16  8:22   ` [OpenRISC] " Russell King - ARM Linux admin
2020-02-16  8:22   ` Russell King - ARM Linux admin
2020-02-16  8:22   ` Russell King - ARM Linux admin
2020-02-16  8:22   ` Russell King - ARM Linux admin
2020-02-16  8:22   ` Russell King - ARM Linux admin
2020-02-16  8:22   ` Russell King - ARM Linux admin
2020-02-16 10:45   ` Christophe Leroy
2020-02-16 10:45     ` [OpenRISC] " Christophe Leroy
2020-02-16 10:45     ` Christophe Leroy
2020-02-16 10:45     ` Christophe Leroy
2020-02-16 10:45     ` Christophe Leroy
2020-02-16 10:45     ` Christophe Leroy
2020-02-16 10:45     ` Christophe Leroy
2020-02-17  6:23   ` Mike Rapoport
2020-02-17  6:23     ` [OpenRISC] " Mike Rapoport
2020-02-17  6:23     ` Mike Rapoport
2020-02-17  6:23     ` Mike Rapoport
2020-02-17  6:23     ` Mike Rapoport
2020-02-17  6:23     ` Mike Rapoport
2020-02-17  6:23     ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a008227-433c-73d7-b01a-1c6c7c66f04e@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bcain@codeaurora.org \
    --cc=benh@kernel.crashing.org \
    --cc=catalin.marinas@arm.com \
    --cc=dalias@libc.org \
    --cc=fenghua.yu@intel.com \
    --cc=geert+renesas@glider.be \
    --cc=gxt@pku.edu.cn \
    --cc=jonas@southpole.se \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=ley.foon.tan@intel.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hexagon@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maz@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=nios2-dev@lists.rocketboards.org \
    --cc=openrisc@lists.librecores.org \
    --cc=paulus@samba.org \
    --cc=rppt@kernel.org \
    --cc=rppt@linux.ibm.com \
    --cc=shorne@gmail.com \
    --cc=stefan.kristiansson@saunalahti.fi \
    --cc=tony.luck@intel.com \
    --cc=uclinux-h8-devel@lists.sourceforge.jp \
    --cc=will@kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.