;-)
> OK, so user process address space lies below 0xC0000000 and there is
> a different mapping per process. Kernel mappings are above
> 0xC0000000 and are constant. So when a syscall is run, we're still
> in the user process context, therefore the userspace mappings still
> exist for that process. (How am I doing?)
Yep.
> This means that the copy-from-user() and copy-to-user() can just be
> simple copies.
Yep.
> 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.
The virt-to-phys macro is to convert kernel virtual addresses (those
returned by get_free_page() and kmalloc()) to physical
addresses. Stuff returned by vmalloc() can't be converted to physical
addresses this way: you have to walk the page tables.
Similarly, for user addresses you have to walk the page tables.
Regards,
Richard....
-
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/