[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZKxo79JYjEvMGAW3@casper.infradead.org>
Date: Mon, 10 Jul 2023 21:24:15 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Christophe Leroy <christophe.leroy@...roup.eu>
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
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.
Powered by blists - more mailing lists