From: Qi Zheng <zhengqi.arch@bytedance.com>
To: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>,
Andy Lutomirski <luto@kernel.org>,
"Mike Rapoport (IBM)" <rppt@kernel.org>,
Ryan Roberts <ryan.roberts@arm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Will Deacon <will@kernel.org>,
Matthew Wilcox <willy@infradead.org>,
linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org,
linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org,
linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org,
linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org,
loongarch@lists.linux.dev, x86@kernel.org,
Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: [PATCH 01/10] mm: Move common parts of pagetable_*_[cd]tor to helpers
Date: Fri, 20 Dec 2024 22:16:22 +0800 [thread overview]
Message-ID: <33ce9b58-4787-49cd-a7f2-34272cb3ecf7@bytedance.com> (raw)
In-Reply-To: <2f65f93e-9d44-4acc-b63c-8f5a35f59699@arm.com>
On 2024/12/20 21:50, Kevin Brodsky wrote:
> On 20/12/2024 12:46, Qi Zheng wrote:
>> Hi Kevin,
>>
>> On 2024/12/20 18:49, Kevin Brodsky wrote:
>>> [...]
>>>
>>> Qi, shall we collaborate to make our series complementary? I believe my
>>> series covers patch 2 and 4 of your series, but it goes further by
>>> covering all levels and all architectures, and patches introducing
>>> ctor/dtor are already split as Alexander suggested on your series. So my
>>> suggestion would be:
>>>
>>> * Remove patch 1 in my series - I'd just introduce
>>> pagetable_{p4d,pgd}_[cd]tor with the same implementation as
>>> pagetable_pud_[cd]tor.
>>> * Remove patch 2 and 4 from your series and rebase it on mine.
>>
>> I quickly went through your patch series. It looks like my patch 2 and
>> your patch 6 are duplicated, so you want me to remove my patch 2.
>>
>> But I think you may not be able to simple let arm64, riscv and x86 to
>> use generic p4d_{alloc_one,free}(). Because even if
>> CONFIG_PGTABLE_LEVELS > 4, the pgtable_l5_enabled() may not be true.
>>
>> For example, in arm64:
>>
>> #if CONFIG_PGTABLE_LEVELS > 4
>>
>> static __always_inline bool pgtable_l5_enabled(void)
>> {
>> if (!alternative_has_cap_likely(ARM64_ALWAYS_BOOT))
>> return vabits_actual == VA_BITS;
>> return alternative_has_cap_unlikely(ARM64_HAS_VA52);
>> }
>
> Correct. That's why the implementation of p4d_free() I introduce in
> patch 6 checks mm_p4d_folded(), which is implemented as
> !pgtable_l5_enabled() on those architectures (see last paragraph in
> commit message). In fact it turns out Alexander suggested exactly this
> approach [2].
OK, I see.
>
>>
>> Did I miss something?
>>
>> My patch series is not only for cleanup, but also for fixes of
>> UAF issue [1], so is it possible to rebase your patch series onto
>> mine? I can post v3 ASAP.
>
> I see, yours should be merged first then. The issue is that yours would
> depend on some of the patches in mine, not the other way round.
>
> My suggestion would then be for you to take patch 5, 6 and 7 from my
> series, as they match Alexander's suggestions (and patch 5 is I think a
> useful simplification), and replace patch 2 in your series with those. I
> would then rebase my series on top and adapt it accordingly. Does that
> sound reasonable?
Sounds good. But maybe just patch 5 and 6. Because I actually did
the work of your patch 7 in my patch 2 and 4.
So, is it okay to do something like the following?
1. I separate the ctor()/dtor() part from my patch 2, and then replace
the rest with your patch 6.
2. take your patch 5 form your series
If it's ok, I will post the v3 next Monday. ;)
Thanks!
>
> - Kevin
>
> [2]
> https://lore.kernel.org/all/Z2RKpdv7pL34MIEt@tuxmaker.boeblingen.de.ibm.com/
>
next prev parent reply other threads:[~2024-12-20 14:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 16:44 [PATCH 00/10] Account page tables at all levels Kevin Brodsky
2024-12-19 16:44 ` [PATCH 01/10] mm: Move common parts of pagetable_*_[cd]tor to helpers Kevin Brodsky
2024-12-19 17:19 ` Peter Zijlstra
2024-12-20 10:49 ` Kevin Brodsky
2024-12-20 11:46 ` Qi Zheng
2024-12-20 13:50 ` Kevin Brodsky
2024-12-20 14:16 ` Qi Zheng [this message]
2024-12-20 14:28 ` Kevin Brodsky
2024-12-20 14:35 ` Qi Zheng
2024-12-19 16:44 ` [PATCH 02/10] parisc: mm: Ensure pagetable_pmd_[cd]tor are called Kevin Brodsky
2024-12-19 16:44 ` [PATCH 03/10] m68k: mm: Add calls to pagetable_pmd_[cd]tor Kevin Brodsky
2024-12-19 16:44 ` [PATCH 04/10] s390/mm: Add calls to pagetable_pud_[cd]tor Kevin Brodsky
2024-12-19 16:44 ` [PATCH 05/10] riscv: mm: Skip pgtable level check in {pud,p4d}_alloc_one Kevin Brodsky
2025-01-03 10:31 ` Alexandre Ghiti
2025-01-03 10:36 ` Kevin Brodsky
2024-12-19 16:44 ` [PATCH 06/10] asm-generic: pgalloc: Provide generic p4d_{alloc_one,free} Kevin Brodsky
2024-12-19 16:44 ` [PATCH 07/10] mm: Introduce ctor/dtor at P4D level Kevin Brodsky
2024-12-19 16:44 ` [PATCH 08/10] ARM: mm: Rename PGD helpers Kevin Brodsky
2024-12-19 16:44 ` [PATCH 09/10] asm-generic: pgalloc: Provide generic __pgd_{alloc,free} Kevin Brodsky
2024-12-19 16:44 ` [PATCH 10/10] mm: Introduce ctor/dtor at PGD level Kevin Brodsky
2024-12-19 17:13 ` [PATCH 00/10] Account page tables at all levels Dave Hansen
2024-12-20 10:58 ` Kevin Brodsky
2024-12-20 14:45 ` Dave Hansen
2024-12-20 19:31 ` Dave Hansen
2025-01-03 9:28 ` Kevin Brodsky
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=33ce9b58-4787-49cd-a7f2-34272cb3ecf7@bytedance.com \
--to=zhengqi.arch@bytedance.com \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@linux.intel.com \
--cc=kevin.brodsky@arm.com \
--cc=linus.walleij@linaro.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-openrisc@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=linux-um@lists.infradead.org \
--cc=loongarch@lists.linux.dev \
--cc=luto@kernel.org \
--cc=peterz@infradead.org \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox