Re: Re: [PATCH] MIPS: clean up CONFIG_MIPS_PGD_C0_CONTEXT handling

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

 



Hi,
>On Fri, 5 Mar 2021, Huang Pei wrote:
>
>> /home/hp/projects/Linux/temp/linux-stable/arch/mips/include/asm/io.h: In function ‘phys_to_virt’:
>> /home/hp/projects/Linux/temp/linux-stable/arch/mips/include/asm/io.h:122:9: error: cast to pointer
>> from integer of different size [-Werror=int-to-pointer-cast]
>>   return (void *)(address + PAGE_OFFSET - PHYS_OFFSET);
>>
>>
>> .........
>>
>> Only change CAC_BASE Does NOT work
>
> Thank you for checking.
>
> Right.  I don't know why it fails for `phys_to_virt' where `address' is
>of the `unsigned long' type, but there are other places where the macros
>themselves are cast to `void *'.  We may want to rework that stuff, but
>not necessarily on this occasion.
>
> Use an explicit cast of the macro to `s64' here then, as my other
>suggestion was.  Anything is better than hardcoded magic numbers.
>
>  Maciej 

cast into s64 works. I will resend v3 soon.

Another issue, please take a look at GCC bug 99217, there is a partial fix, but I am not sure
that if it is advised mips16 should also be covered and how?

I found the ftrace on MIPS is not safe on SMP, since when disabling tracing,  the callsite of
_mcount need two writes to transform 

jal    _mcount
addiu sp, sp, -offset

into 

nop
nop

no matter in what order these two writes are seen, it is wrecked in these two case

jal    _mcount
nop

or

nop
addiu    sp, sp, -offset

so, I add a new ftrace implementation based on -fpatchable-function-entry=3, which is blocked by 
GCC bug 99217

see https://lore.kernel.org/linux-mips/20210305101933.9799-1-huangpei@xxxxxxxxxxx/

At last, is it possible to add fix 99217 and 93242 into gcc 8.5?

-----------------
Huang Pei





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux