Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jan 2000 17:53:12 -0500 (EST)
From:      Luoqi Chen <luoqi@watermarkgroup.com>
To:        freebsd-hackers@FreeBSD.ORG, zzhang@cs.binghamton.edu
Subject:   Re:  Accessing user data from kernel
Message-ID:  <200001192253.RAA01221@lor.watermarkgroup.com>

next in thread | raw e-mail | index | archive | help
> When the kernel wants to access any user data, it either copies them into
> the kernel or maps them into kernel address space.  Can anyone tell me the
> reasons why this is done?  When a process enters the kernel mode, the
> page tables are not changed. 
> 
> I have taken this for granted for a long time without knowing the reasons.
> 
> Thanks,
> 
> -Zhihui
> 
In theory, the kernel and user address spaces are separate. But in practice,
for performance reasons, the kernel address space is always mapped at the
top of user address space, so the kernel can directly access the current
process' address space (copyin/copyout are just normal bcopy with bound
check and guard against page fault). Under certain circumstances, you might
want them to be truely separate, for example, if you have to use the full
4G in a user process, the tradeoff of course is the user/kernel context switch
overhead.

-lq


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001192253.RAA01221>