linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: cpu_get_pgd()
Date: Thu, 5 Aug 2010 15:47:59 +0100	[thread overview]
Message-ID: <20100805144759.GD23473@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4C5AC972.4010109@l4dev.org>

On Thu, Aug 05, 2010 at 05:23:46PM +0300, Bahadir Balban wrote:
> There's a call to cpu_get_pgd() from do_translation_fault()
> that reads the TTBR to reach the pgd pointer.
> 
> Why not use pgd_offset(current->mm, addr)?

Because current->mm might not refer to the page table which is currently
being used by the hardware.  Think about this sequence:

task = current
schedule()
next = some_other_task
switch_mm(next)
IRQ occurs, handler is in a module which is unmapped in next's mm but
exists in task's mm
prefetch fault occurs

Now at this point, if we look at current->mm, we find that the entry exists.
If we used this, and just returned, we'd repeat the prefetch fault, and
make no progress.

So we have to read the page tables which the hardware is currently using
to ensure that we update the right set of page tables.

      reply	other threads:[~2010-08-05 14:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-05 14:23 cpu_get_pgd() Bahadir Balban
2010-08-05 14:47 ` Russell King - ARM Linux [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=20100805144759.GD23473@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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).