Re: [PATCH v11 3/8] powerpc/perf: consolidate read_user_stack_32

From: Nicholas Piggin
Date: Fri Apr 03 2020 - 07:26:44 EST


Michal SuchÃnek's on April 3, 2020 8:52 pm:
> Hello,
>
> there are 3 variants of the function
>
> read_user_stack_64
>
> 32bit read_user_stack_32
> 64bit read_user_Stack_32

Right.

> On Fri, Apr 03, 2020 at 05:13:25PM +1000, Nicholas Piggin wrote:
[...]
>> #endif /* CONFIG_PPC64 */
>>
>> +static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret)
>> +{
>> + return __read_user_stack(ptr, ret, sizeof(*ret));
> Does not work for 64bit read_user_stack_32 ^ this should be 4.
>
> Other than that it should preserve the existing logic just fine.

sizeof(int) == 4 on 64bit so it should work.

Thanks,
Nick