Re: [PATCH] MIPS: KASLR: Fix sync_icache() trapped in loop when synci_step is zero

2020-12-07 Thread Maciej W. Rozycki
On Thu, 3 Dec 2020, Jinyang He wrote: > Thus, only one synci operation is required when synci_step is 0 > on Loongson64 platform. I guess that some other platforms have > similar implementations on synci, so add judgment conditions in > `while` to ensure that at least all platforms perform synci

Re: [PATCH] MIPS: KASLR: Fix sync_icache() trapped in loop when synci_step is zero

2020-12-07 Thread Maciej W. Rozycki
On Wed, 2 Dec 2020, Thomas Bogendoerfer wrote: > PS: Does anybody know a reason, why this code doesn't use an old fashioned > dache/icache flushing, which might be slower but would work also on > legecy cores ? Hmm, this was contributed by ImgTec in 2016 only, so I guess there was no reason as

Re: [PATCH] MIPS: KASLR: Fix sync_icache() trapped in loop when synci_step is zero

2020-12-04 Thread Thomas Bogendoerfer
On Thu, Dec 03, 2020 at 12:02:10PM +0800, Jiaxun Yang wrote: > > > 在 2020/12/2 下午6:39, Thomas Bogendoerfer 写道: > > On Wed, Dec 02, 2020 at 11:00:05AM +0800, Jinyang He wrote: > > > Reading synci_step by using rdhwr instruction may return zero if no cache > > > need be synchronized. On the one

Re: [PATCH] MIPS: KASLR: Fix sync_icache() trapped in loop when synci_step is zero

2020-12-02 Thread Jiaxun Yang
在 2020/12/2 下午6:39, Thomas Bogendoerfer 写道: On Wed, Dec 02, 2020 at 11:00:05AM +0800, Jinyang He wrote: Reading synci_step by using rdhwr instruction may return zero if no cache need be synchronized. On the one hand, to make sure all load operation and store operation finished we do __sync()

Re: [PATCH] MIPS: KASLR: Fix sync_icache() trapped in loop when synci_step is zero

2020-12-02 Thread Jinyang He
Hi, Thomas, On 12/02/2020 06:39 PM, Thomas Bogendoerfer wrote: On Wed, Dec 02, 2020 at 11:00:05AM +0800, Jinyang He wrote: Reading synci_step by using rdhwr instruction may return zero if no cache need be synchronized. On the one hand, to make sure all load operation and store operation

Re: [PATCH] MIPS: KASLR: Fix sync_icache() trapped in loop when synci_step is zero

2020-12-02 Thread Thomas Bogendoerfer
On Wed, Dec 02, 2020 at 11:00:05AM +0800, Jinyang He wrote: > Reading synci_step by using rdhwr instruction may return zero if no cache > need be synchronized. On the one hand, to make sure all load operation and > store operation finished we do __sync() for every platform. On the other > hand,

[PATCH] MIPS: KASLR: Fix sync_icache() trapped in loop when synci_step is zero

2020-12-01 Thread Jinyang He
Reading synci_step by using rdhwr instruction may return zero if no cache need be synchronized. On the one hand, to make sure all load operation and store operation finished we do __sync() for every platform. On the other hand, some platform need operate synci one time although step is zero.