linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "huangpei@loongson.cn" <huangpei@loongson.cn>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	ambrosehua <ambrosehua@gmail.com>, 毛碧波 <maobibo@loongson.cn>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-mips <linux-mips@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	"jiaxun.yang" <jiaxun.yang@flygoat.com>,
	"Paul Burton" <paulburton@kernel.org>,
	lixuefeng <lixuefeng@loongson.cn>,
	"Yang Tiezhu" <yangtiezhu@loongson.cn>,
	gaojuxin <gaojuxin@loongson.cn>, 张福新 <zhangfx@lemote.com>,
	陈华才 <chenhc@lemote.com>
Subject: Re: Re: [PATCH] MIPS: clean up CONFIG_MIPS_PGD_C0_CONTEXT handling
Date: Mon, 8 Mar 2021 09:27:13 +0800	[thread overview]
Message-ID: <2021030809271272187712@loongson.cn> (raw)
In-Reply-To: alpine.DEB.2.21.2103051752310.51127@angie.orcam.me.uk

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@loongson.cn/

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

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


      reply	other threads:[~2021-03-08  1:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-27  6:19 [PATCH V2] MIPS: clean up CONFIG_MIPS_PGD_C0_CONTEXT Huang Pei
2021-02-27  6:19 ` [PATCH] MIPS: clean up CONFIG_MIPS_PGD_C0_CONTEXT handling Huang Pei
2021-02-28 23:00   ` Maciej W. Rozycki
2021-03-04  1:06     ` Huang Pei
2021-03-04  1:40       ` Maciej W. Rozycki
2021-03-05  7:13         ` Huang Pei
2021-03-07 20:54           ` Maciej W. Rozycki
2021-03-08  1:27             ` huangpei [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2021030809271272187712@loongson.cn \
    --to=huangpei@loongson.cn \
    --cc=akpm@linux-foundation.org \
    --cc=ambrosehua@gmail.com \
    --cc=chenhc@lemote.com \
    --cc=gaojuxin@loongson.cn \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lixuefeng@loongson.cn \
    --cc=macro@orcam.me.uk \
    --cc=maobibo@loongson.cn \
    --cc=paulburton@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=yangtiezhu@loongson.cn \
    --cc=zhangfx@lemote.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).