ioctl() returns EFAULT / MMU domain problem?
koyo.take at gmail.com
Tue Jan 19 01:35:23 EST 2010
2010/1/18 Russell King - ARM Linux <linux at arm.linux.org.uk>:
> 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.
But, Neither current_thread_info()->cpu_domain nor CP15 domain register were
matched in my case.
The variables are
current_thread_info()->cpu_domain=0x17 (DOMAIN_KERNEL is DOMAIN_MANAGER)
CP15 domain register = 0x15 (DOMAIN_KERNEL is DOMAIN_CLIENT)
It seems that "A" has been changed where i don't know.
> 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.)
Would you please tell me where the context switch is done in kernel code?
And, Is there any other point to change the domain register?
More information about the linux-arm-kernel