From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Hong H. Pham" <hong.pham@windriver.com>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
Paul Mackerras <paulus@samba.org>,
linux-rt-users <linux-rt-users@vger.kernel.org>,
linux-stable <stable@vger.kernel.org>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: [PATCH v3] powerpc: Fix PTE page address mismatch in pgtable ctor/dtor
Date: Sun, 08 Dec 2013 07:32:25 +1100 [thread overview]
Message-ID: <1386448345.21910.106.camel@pasglop> (raw)
In-Reply-To: <1386448079.21910.105.camel@pasglop>
On Sun, 2013-12-08 at 07:27 +1100, Benjamin Herrenschmidt wrote:
> On Sat, 2013-12-07 at 09:06 -0500, Hong H. Pham wrote:
>
> > diff --git a/arch/powerpc/include/asm/pgalloc-32.h b/arch/powerpc/include/asm/pgalloc-32.h
> > index 27b2386..842846c 100644
> > --- a/arch/powerpc/include/asm/pgalloc-32.h
> > +++ b/arch/powerpc/include/asm/pgalloc-32.h
> > @@ -84,10 +84,8 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb,
> > static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
> > unsigned long address)
> > {
> > - struct page *page = page_address(table);
> > -
> > tlb_flush_pgtable(tlb, address);
> > - pgtable_page_dtor(page);
> > - pgtable_free_tlb(tlb, page, 0);
> > + pgtable_page_dtor(table);
> > + pgtable_free_tlb(tlb, page_address(table), 0);
> > }
>
> Ok so your description of the problem confused me a bit, but I see that
> in the !64K page, pgtable_t is already a struct page so yes, the
> page_address() call here is bogus.
>
> However, I also noticed that in the 64k page case, we don't call the dto
> at all. Is that a problem ?
Actually we do, just elsewhere... ignore the above.
> Also, Aneesh, shouldn't we just fix the disconnect here and have
> pgtable_t always be the same type ? The way this is now is confusing
> and error prone...
>
> > #endif /* _ASM_POWERPC_PGALLOC_32_H */
> > diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h
> > index f65e27b..256d6f8 100644
> > --- a/arch/powerpc/include/asm/pgalloc-64.h
> > +++ b/arch/powerpc/include/asm/pgalloc-64.h
> > @@ -144,11 +144,9 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb,
> > static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
> > unsigned long address)
> > {
> > - struct page *page = page_address(table);
> > -
> > tlb_flush_pgtable(tlb, address);
> > - pgtable_page_dtor(page);
> > - pgtable_free_tlb(tlb, page, 0);
> > + pgtable_page_dtor(table);
> > + pgtable_free_tlb(tlb, page_address(table), 0);
> > }
> >
> > #else /* if CONFIG_PPC_64K_PAGES */
>
> Ben.
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
next prev parent reply other threads:[~2013-12-07 20:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-05 15:54 [PATCH] powerpc: Fix PTE page address mismatch in pgtable ctor/dtor Hong H. Pham
2013-12-06 10:38 ` Aneesh Kumar K.V
2013-12-06 16:15 ` Hong H. Pham
2013-12-07 14:05 ` Hong H. Pham
2013-12-06 16:17 ` [PATCH v2] " Hong H. Pham
2013-12-07 14:06 ` [PATCH v3] " Hong H. Pham
2013-12-07 20:27 ` Benjamin Herrenschmidt
2013-12-07 20:32 ` Benjamin Herrenschmidt [this message]
2013-12-09 8:41 ` Aneesh Kumar K.V
2013-12-09 8:42 ` Aneesh Kumar K.V
2013-12-15 12:59 ` Sebastian Andrzej Siewior
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=1386448345.21910.106.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=hong.pham@windriver.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).