load_gs_index(0); ret = checking_wrmsrl(MSR_KERNEL_GS_BASE, addr); 
load_gs_index(0); ret = checking_wrmsrl(MSR_KERNEL_GS_BASE, addr); 
long do_arch_prctl(struct task_struct *task, int code, unsigned long addr){ 	int ret = 0; 	int doit = task == current;	int cpu;	switch (code) { 	case ARCH_SET_GS:		if (addr >= TASK_SIZE_OF(task))			return -EPERM; 		cpu = get_cpu();		/* handle small bases via the GDT because that's faster to 		   switch. */		if (addr <= 0xffffffff) {  			set_32bit_tls(task, GS_TLS, addr); 			if (doit) { 				load_TLS(&task->thread, cpu);				load_gs_index(GS_TLS_SEL); 			}			task->thread.gsindex = GS_TLS_SEL; 			task->thread.gs = 0;		} else { 			task->thread.gsindex = 0;			task->thread.gs = addr;			if (doit) {		load_gs_index(0);		ret = checking_wrmsrl(MSR_KERNEL_GS_BASE, addr); 			} 		}		put_cpu();		break;	case ARCH_SET_FS:		/* Not strictly needed for fs, but do it for symmetry		   with gs */		if (addr >= TASK_SIZE_OF(task))			return -EPERM; 		cpu = get_cpu();		/* handle small bases via the GDT because that's faster to 		   switch. */		if (addr <= 0xffffffff) { 			set_32bit_tls(task, FS_TLS, addr);			if (doit) { 				load_TLS(&task->thread, cpu); 				asm volatile("movl %0,%%fs" :: "r" (FS_TLS_SEL));			}			task->thread.fsindex = FS_TLS_SEL;			task->thread.fs = 0;		} else { 			task->thread.fsindex = 0;			task->thread.fs = addr;			if (doit) {				/* set the selector to 0 to not confuse				   __switch_to */		asm volatile("movl %0,%%fs" :: "r" (0));		ret = checking_wrmsrl(MSR_FS_BASE, addr); 			}		}		put_cpu();		break;	case ARCH_GET_FS: { 		unsigned long base; 		if (task->thread.fsindex == FS_TLS_SEL)			base = read_32bit_tls(task, FS_TLS);		else if (doit) {			rdmsrl(MSR_FS_BASE, base);		} else			base = task->thread.fs;		ret = put_user(base, (unsigned long __user *)addr); 		break; 	}	case ARCH_GET_GS: { 		unsigned long base;		if (task->thread.gsindex == GS_TLS_SEL)			base = read_32bit_tls(task, GS_TLS);		else if (doit) {			rdmsrl(MSR_KERNEL_GS_BASE, base);		} else			base = task->thread.gs;		ret = put_user(base, (unsigned long __user *)addr); 		break;	}	default:		ret = -EINVAL;		break;	} 	return ret;	} 
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a88cde13bae3fffd6ecc812bdd02c91eafb6073e/process.c/clean/arch/x86_64/kernel/process.c