Re: [PATCH] parisc: Use LINUX_GATEWAY_SPACE constant in entry.S

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

 



On 26.10.2018 01:33, John David Anglin wrote:
> On 2018-10-25 2:31 AM, Helge Deller wrote:
>> Use the predefined LINUX_GATEWAY_SPACE constant in the various important
>> code sections which deal with the gateway page.
>>
>> Signed-off-by: Helge Deller <deller@xxxxxx>
>>
>> diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
>> index 1c60408a64ad..9f3673351924 100644
>> --- a/arch/parisc/kernel/entry.S
>> +++ b/arch/parisc/kernel/entry.S
>> @@ -394,11 +394,13 @@
>>       */
>>       .macro        space_check    spc,tmp,fault
>>       mfsp        %sr7,\tmp
>> -    or,COND(<>)    %r0,\spc,%r0    /* user may execute gateway page
>> +    or,COND(<>)    LINUX_GATEWAY_SPACE,\spc,%r0
>> +                    /* user may execute gateway page
>>                        * as kernel, so defeat the space
>>                        * check if it is */
>>       copy        \spc,\tmp
>> -    or,COND(=)    %r0,\tmp,%r0    /* nullify if executing as kernel */
>> +    or,COND(=)    LINUX_GATEWAY_SPACE,\tmp,%r0
>> +                    /* nullify if executing as kernel */
>>       cmpb,COND(<>),n    \tmp,\spc,\fault
>>       .endm
> The above is somewhat misleading as the "or" instruction doesn't support an immediate
> operand.  It only works because LINUX_GATEWAY_SPACE is 0 and that picks register r0 for
> the inclusive or.

Thanks!
I've changed it to simply be a comment now. That way it's at least easy to find gateway-related code...

Updated patch is in the for-next tree:
https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git/commit/?h=for-next&id=87613bb9d20c556b5eeae04f4caf40701189f07b

Helge



[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux