linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* cpu_get_pgd()
@ 2010-08-05 14:23 Bahadir Balban
  2010-08-05 14:47 ` cpu_get_pgd() Russell King - ARM Linux
  0 siblings, 1 reply; 2+ messages in thread
From: Bahadir Balban @ 2010-08-05 14:23 UTC (permalink / raw)
  To: linux-arm-kernel

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)?

Thanks,

-- 
Bahadir

^ permalink raw reply	[flat|nested] 2+ messages in thread

* cpu_get_pgd()
  2010-08-05 14:23 cpu_get_pgd() Bahadir Balban
@ 2010-08-05 14:47 ` Russell King - ARM Linux
  0 siblings, 0 replies; 2+ messages in thread
From: Russell King - ARM Linux @ 2010-08-05 14:47 UTC (permalink / raw)
  To: linux-arm-kernel

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-05 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-05 14:23 cpu_get_pgd() Bahadir Balban
2010-08-05 14:47 ` cpu_get_pgd() Russell King - ARM Linux

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).