[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c7f08247-8bcd-184c-5e06-91f91257f1f6@csgroup.eu>
Date: Wed, 15 Mar 2023 10:18:22 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
CC: "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 15/03/2023 à 10:43, Christophe Leroy a écrit :
>
>
> Le 15/03/2023 à 06:14, Matthew Wilcox (Oracle) a écrit :
>> Add set_ptes(), update_mmu_cache_range() and flush_dcache_folio().
>> Change the PG_arch_1 (aka PG_dcache_dirty) flag from being per-page to
>> per-folio.
>>
>> Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
>> Cc: Michael Ellerman <mpe@...erman.id.au>
>> Cc: Nicholas Piggin <npiggin@...il.com>
>> Cc: Christophe Leroy <christophe.leroy@...roup.eu>
>> Cc: linuxppc-dev@...ts.ozlabs.org
>> ---
>> @@ -203,7 +203,14 @@ void set_pte_at(struct mm_struct *mm, unsigned
>> long addr, pte_t *ptep,
>> pte = set_pte_filter(pte);
>> /* Perform the setting of the PTE */
>> - __set_pte_at(mm, addr, ptep, pte, 0);
>> + for (;;) {
>> + __set_pte_at(mm, addr, ptep, pte, 0);
>> + if (--nr == 0)
>> + break;
>> + ptep++;
>> + pte = __pte(pte_val(pte) + PAGE_SIZE);
>
> I don't like that math too much, but I have no better idea at the moment.
>
> Maybe set_ptes() should take a pgprot_t and rebuild the pte with
> mk_pte() or similar ?
>
>> + addr += PAGE_SIZE;
>> + }
>> }
>> void unmap_kernel_page(unsigned long va)
I investigated a bit further and can confirm now that the above won't
always work, see comment
https://elixir.bootlin.com/linux/v6.3-rc2/source/arch/powerpc/include/asm/nohash/32/pgtable.h#L147
And then you see
https://elixir.bootlin.com/linux/v6.3-rc2/source/arch/powerpc/include/asm/nohash/pte-e500.h#L63
Christophe
Powered by blists - more mailing lists