<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/arch/csky/abiv2/cacheflush.c, branch v6.4</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.4</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.4'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-04-13T06:36:14+00:00</updated>
<entry>
<title>csky: mmu: Prevent spurious page faults</title>
<updated>2023-04-13T06:36:14+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2023-04-06T08:46:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1f62ed00a56bf01becaccd81bf30f2fcb0322fd2'/>
<id>urn:sha1:1f62ed00a56bf01becaccd81bf30f2fcb0322fd2</id>
<content type='text'>
C-SKY MMU would pre-fetch invalid pte entries, and it could work with
flush_tlb_fix_spurious_fault, but the additional page fault exceptions
would reduce performance. So flushing the entry of the TLB would prevent
the following spurious page faults. Here is the test code:

define DATA_LEN  4096
define COPY_NUM  (504*100)

unsigned char src[DATA_LEN*COPY_NUM] = {0};
unsigned char dst[DATA_LEN*COPY_NUM] = {0};

unsigned char func_src[DATA_LEN*COPY_NUM] = {0};
unsigned char func_dst[DATA_LEN*COPY_NUM] = {0};

void main(void)
{
	int j;
	for (j = 0; j &lt; COPY_NUM; j++)
		memcpy(&amp;dst[j*DATA_LEN], &amp;src[j*DATA_LEN], 4);
}

perf stat -e page-faults ./main.elf

The amount of page fault traps would be reduced in half with the patch.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Signed-off-by: Guo Ren &lt;guoren@kernel.org&gt;
</content>
</entry>
<entry>
<title>csky: Fixup update_mmu_cache called with user io mapping</title>
<updated>2021-01-12T01:52:41+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-12-25T06:37:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3e455cf5f30f87bc871d5fe891841a2cefb29234'/>
<id>urn:sha1:3e455cf5f30f87bc871d5fe891841a2cefb29234</id>
<content type='text'>
The function update_mmu_cache could be called by user-io mapping.
There is no space of struct page in mem_map for the pte. Just
ignore the user-io mmaping in update_mmu_cache.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>csky: Add flush_icache_mm to defer flush icache all</title>
<updated>2020-02-21T07:43:24+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-01-31T12:33:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=997153b9a75c08d545ad45e6f8ceb432435d2425'/>
<id>urn:sha1:997153b9a75c08d545ad45e6f8ceb432435d2425</id>
<content type='text'>
Some CPUs don't support icache.va instruction to maintain the whole
smp cores' icache. Using icache.all + IPI casue a lot on performace
and using defer mechanism could reduce the number of calling icache
_flush_all functions.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>csky: Enable defer flush_dcache_page for abiv2 cpus (807/810/860)</title>
<updated>2020-02-21T07:43:24+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-01-26T17:20:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d936a7e708dcf22344c4420e8b0e36f5d5f8c073'/>
<id>urn:sha1:d936a7e708dcf22344c4420e8b0e36f5d5f8c073</id>
<content type='text'>
Instead of flushing cache per update_mmu_cache() called, we use
flush_dcache_page to reduce the frequency of flashing the cache.

As abiv2 cpus are all PIPT for icache &amp; dcache, we needn't handle
dcache aliasing problem. But their icache can't snoop dcache, so
we still need sync_icache_dcache in update_mmu_cache().

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>csky: Remove unnecessary flush_icache_* implementation</title>
<updated>2020-02-21T07:43:24+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-01-24T16:37:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a1176734132c630b50908c36563e05fb3599682c'/>
<id>urn:sha1:a1176734132c630b50908c36563e05fb3599682c</id>
<content type='text'>
The abiv2 CPUs are all PIPT cache, so there is no need to implement
flush_icache_page function.

The function flush_icache_user_range hasn't been used, so just
remove it.

The function flush_cache_range is not necessary for PIPT cache when
tlb mapping changed.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>csky: Fixup wrong update_mmu_cache implementation</title>
<updated>2019-04-22T05:44:57+00:00</updated>
<author>
<name>Guo Ren</name>
<email>ren_guo@c-sky.com</email>
</author>
<published>2019-04-10T02:55:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=981bbf274b64496fd4376b44120d47dae4ca94e8'/>
<id>urn:sha1:981bbf274b64496fd4376b44120d47dae4ca94e8</id>
<content type='text'>
In our stress test, we found some crash problem caused by:

if (!(vma-&gt;vm_flags &amp; VM_EXEC))
	return;

in update_mmu_cache().

Seems current update_mmu_cache implementation is wrong and we retread
to the conservative implementation.

Also the usage of kmap_atomic in update_mmu_cache is risky, page-virtual
may be scheduled out and changed, so we must use preempt_disable &amp;
pagefault_disable which is called by kmap_atomic().

Signed-off-by: Guo Ren &lt;ren_guo@c-sky.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>csky: Cache and TLB routines</title>
<updated>2018-10-25T15:36:19+00:00</updated>
<author>
<name>Guo Ren</name>
<email>ren_guo@c-sky.com</email>
</author>
<published>2018-09-05T06:25:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=00a9730e1007c6cc87a7c78af2f24a4105d616ee'/>
<id>urn:sha1:00a9730e1007c6cc87a7c78af2f24a4105d616ee</id>
<content type='text'>
This patch adds cache and tlb sync codes for abiv1 &amp; abiv2.

Signed-off-by: Guo Ren &lt;ren_guo@c-sky.com&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
</feed>
