lkml.org 
[lkml]   [1999]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Address spaces on a i386 - Getting Confused
Date
From

Paul.Sargent@3dlabs.com said:
> But I'm still confused by the virt-to-phys macro. I would have
> thought if I want to find the physical address of a user space buffer
> I would have to go through the page table to fins out where is
> physical page is, not just mask off some bits.

My understanding is that you shouldn't want to find the physical address that
corresponds to the userspace buffer. The result of such a lookup would be out
of date before it's even returned to you, because another processor could have
swapped the page out. That's why virt_to_phys doesn't work for that case.

If you want to access user memory directly via DMA, you have to make sure it's
locked down, in which case you have to muck about with the page tables anyway,
and you can note the physical address while you're at it.





---- ---- ----
David Woodhouse David.Woodhouse@mvhi.com Office: (+44) 1223 810302
Project Leader, Process Information Systems Mobile: (+44) 976 658355
Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
finger dwmw2@ferret.lmh.ox.ac.uk for PGP key.



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.053 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site