[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <679a7aea-f754-2ad4-1d6d-36a9647e617f@csgroup.eu>
Date: Tue, 11 Jul 2023 04:40:09 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Matthew Wilcox <willy@...radead.org>
CC: "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [PATCH v4 20/36] powerpc: Implement the new page table range API
Le 10/07/2023 à 22:24, Matthew Wilcox a écrit :
> On Sat, Mar 18, 2023 at 09:19:04AM +0000, Christophe Leroy wrote:
>> void set_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
>> pte_t pte, unsigned int nr)
>> {
>> pgprot_t prot;
>> unsigned long pfn;
>> /*
>> * Make sure hardware valid bit is not set. We don't do
>> * tlb flush for this update.
>> */
>> VM_WARN_ON(pte_hw_valid(*ptep) && !pte_protnone(*ptep));
>>
>> /* Note: mm->context.id might not yet have been assigned as
>> * this context might not have been activated yet when this
>> * is called.
>> */
>> pte = set_pte_filter(pte);
>>
>> prot = pte_pgprot(pte);
>> pfn = pte_pfn(pte);
>> /* Perform the setting of the PTE */
>> for (;;) {
>> __set_pte_at(mm, addr, ptep, pfn_pte(pfn, prot), 0);
>> if (--nr == 0)
>> break;
>> ptep++;
>> pfn++;
>> addr += PAGE_SIZE;
>> }
>> }
>
> I'd rather the per-arch code were as similar to each other and the
> generic implementation as possible. Fewer bugs that way and easier
> for other people to make changes that have to touch every architecture
> in the future.
I understand your point but I dislike the idea of open coding pte
manipulations when you have helpers for that. If you had used helpers
from the begining you wouldn't have had the mishap you had in v4.
Powered by blists - more mailing lists