Messages in this thread | | | Subject | Re: Address spaces on a i386 - Getting Confused | Date | Tue, 30 Mar 1999 12:55:38 +0100 | From | David Woodhouse <> |
| |
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/
| |