From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] arm64: mm: print out correct page table entries
Date: Thu, 15 Jun 2017 11:16:34 +0100 [thread overview]
Message-ID: <20170615101633.GD20308@arm.com> (raw)
In-Reply-To: <20170615101230.z4fqj5ofxsmnagnq@yury-thinkpad>
On Thu, Jun 15, 2017 at 01:12:30PM +0300, Yury Norov wrote:
> On Thu, Jun 15, 2017 at 11:00:51AM +0100, Will Deacon wrote:
> > On Fri, Jun 09, 2017 at 11:22:36PM +0300, Yury Norov wrote:
> > > On Fri, Jun 09, 2017 at 04:35:52PM +0100, Kristina Martsenko wrote:
> > > > diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> > > > index c3f2b1048f83..a9dfb37c87a2 100644
> > > > --- a/arch/arm64/mm/fault.c
> > > > +++ b/arch/arm64/mm/fault.c
> > > > @@ -80,14 +80,24 @@ static inline int notify_page_fault(struct pt_regs *regs, unsigned int esr)
> > > > #endif
> > > >
> > > > /*
> > > > - * Dump out the page tables associated with 'addr' in mm 'mm'.
> > > > + * Dump out the page tables associated with 'addr' in the currently active mm.
> > > > */
> > > > -void show_pte(struct mm_struct *mm, unsigned long addr)
> > > > +void show_pte(unsigned long addr)
> > > > {
> > > > + struct mm_struct *mm;
> > > > pgd_t *pgd;
> > > >
> > > > - if (!mm)
> > > > + if (addr < TASK_SIZE) {
> > > > + /* TTBR0 */
> > > > + mm = current->active_mm;
> > > > + } else if (addr >= VA_START) {
> > > > + /* TTBR1 */
> > > > mm = &init_mm;
> > > > + } else {
> > > > + pr_alert("[%08lx] address between user and kernel address ranges\n",
> > > > + addr);
> > > > + return;
> > > > + }
> > > >
> > > > pr_alert("pgd = %p\n", mm->pgd);
> > > > pgd = pgd_offset(mm, addr);
> > >
> > > Is there any reason to change the prototype of the function?
> > > You say nothing about it in patch description. The show_pte()
> > > is implemented in several arches, and everywhere it takes mm_struct
> > > as 1st argument. For me, if you don't need to change the prototype,
> > > you'd better leave things as is. The patch will get much shorter
> > > and expressive with it.
> > >
> > > If you really need to change the prototype, it would be better to do
> > > it in separated patch and give clear explanations - what for?
> >
> > The mm is unused and this isn't a core interface. In fact, it's only
> > available on architectures that started off by copying from arch/arm/.
> >
> > We can always add the mm back if we need it in future.
>
> OK, understood that. But I still think it should be done in separeted
> patch, and it would be also good to revise sh and unicore32. It seems
> that sh may be easily switched to the proposed interface, and the
> unicore32 most probably too.
Why? This is the patch that removes the usage of the paramater, so it should
also remove the parameter. This function isn't called by anybody outside of
arm64, so there's no "proposed interface" to speak of.
If this was a core function with lots of tree-wide callers, then I'd agree
with you: remove use of the thing, fix the callers, then remove the
parameter. But that's not the case here.
Will
prev parent reply other threads:[~2017-06-15 10:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-09 15:35 [PATCH v2 1/3] arm64: mm: print out correct page table entries Kristina Martsenko
2017-06-09 15:35 ` [PATCH v2 2/3] arm64: mm: don't print out page table entries on EL0 faults Kristina Martsenko
2017-06-09 15:50 ` Mark Rutland
2017-06-09 15:35 ` [PATCH v2 3/3] arm64: mm: print file name of faulting vma Kristina Martsenko
2017-06-09 15:54 ` Mark Rutland
2017-06-09 16:04 ` [PATCH v2 1/3] arm64: mm: print out correct page table entries Mark Rutland
2017-06-09 16:33 ` Will Deacon
2017-06-09 16:41 ` Mark Rutland
2017-06-09 20:22 ` Yury Norov
2017-06-15 10:00 ` Will Deacon
2017-06-15 10:12 ` Yury Norov
2017-06-15 10:16 ` Will Deacon [this message]
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=20170615101633.GD20308@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).