Re: getcpu() returns EFAULT when called via the vdso

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 08 May 2012 17:13:28 Tony Luck wrote:
> On Mon, May 7, 2012 at 4:53 PM, Mike Frysinger wrote:
> > i guess that needs to load some p reg with a NULL pointer test and then
> > do the loads/stores based on that.  calling getcpu(NULL, NULL, NULL)
> > from userspace shouldn't trigger EFAULT.
> 
> We could do that (see attached, untested, patch). But it wouldn't help
> the sched_getcpu() code much ... it would stop getting -EFAULT, but
> it still wouldn't have the right return value.

wouldn't it though ?  the return value with getcpu is just "0" when things 
worked.  if i do:
	int i;
	syscall(__NR_getcpu, &i, NULL, NULL);
this should return 0 and fill in "i" with the cpu value.  i think your proposed 
patch would make things work as no fault would be triggered, and the return 
value (r8) would be set to 0.

i'll have to rebuild the kernel to double check though.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux Kernel]     [Sparc Linux]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux x86_64]     [Linux for Ham Radio]

  Powered by Linux