ioctl() returns EFAULT / MMU domain problem?

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Jan 18 08:47:23 EST 2010


On Mon, Jan 18, 2010 at 10:35:26PM +0900, Koyo Takenoshita wrote:
> I think that the problem is that there is a possibility of schedule
> while doing set_fs(KERNEL_DS) and copy_to_user.

The domain register setting is stored in the per-thread cpu_domain
variable (current_thread_info()->cpu_domain).  set_fs() modifies
this according to KERNEL_DS vs USER_DS.

On context switches, the domain register is reloaded from cpu_domain,
so it will be preserved across context switches for the same thread;
if it wasn't, kernel boot wouldn't work (because the kernel boot uses
KERNEL_DS to be able to call execve(), open(), etc.)



More information about the linux-arm-kernel mailing list