From: Hideo S. <sa...@de...> - 2007-02-20 01:03:28
|
Hi, I am H.Saito. It seems that a synonym problem issues on linux-2.6.20 for SH4. The problem is that some virtual addresses are mapped onto a single physical address as follows. The following log is our debugger's log when broke at line 257 in fs/binfmt_elf.c. #d 8eab33c0 LOC. 0 4 8 c ASCII-CODE ---------------------------------------------------------------------- 8eab 33c0 : 3334 3330 3030 3000 3030 3030 0034 3433 / 0343.0000000344. 8eab 33d0 : 3030 3030 3330 3030 3000 3534 3030 3030 / 0000000345.00000 8eab 33e0 : 3433 3030 3030 0036 3030 3030 3734 3330 / 00346.0000000347 8eab 33f0 : 3030 3000 3030 3030 0038 3433 3030 3030 / .0000000348.0000 8eab 3400 : 3330 3030 3000 3934 3030 3030 3533 3030 / 000349.000000035 8eab 3410 : 3030 0030 3030 3030 3135 3330 3030 3000 / 0.0000000351.000 8eab 3420 : 3030 3030 0032 3533 3030 3030 3330 3030 / 0000352.00000003 8eab 3430 : 3000 3335 3030 3030 3533 3030 3030 0034 / 53.0000000354.00 #d 7bd823c0 LOC. 0 4 8 c ASCII-CODE ---------------------------------------------------------------------- 7bd8 23c0 : 0000 0000 0000 0000 0000 0000 0000 0000 / ................ 7bd8 23d0 : 0000 0000 0000 0000 0000 0000 0000 0000 / ................ 7bd8 23e0 : 3433 3030 3030 0036 3030 3030 3734 3330 / 00346.0000000347 7bd8 23f0 : 3030 3000 3030 3030 0038 3433 3030 3030 / .0000000348.0000 7bd8 2400 : 3330 3030 3000 3934 3030 3030 3533 3030 / 000349.000000035 7bd8 2410 : 3030 0030 3030 3030 3135 3330 3030 3000 / 0.0000000351.000 7bd8 2420 : 3030 3030 0032 3533 3030 3030 3330 3030 / 0000352.00000003 7bd8 2430 : 3000 3335 3030 3030 3533 3030 3030 0034 / 53.0000000354.00 #s f40053c0 f400 53c0 : 4eab 3003 #s f40043c0 f400 43c0 : 4eab 3001 OC address array for 0x8eab33c0 is 0xf40053c0 on way2. OC address array for 0x7bd823c0 is 0xf40043c0 on way2. The physical memory area is in from 0x48000000 to 0x48ffffff. The cached data line on 0x7bd823c0 can not be read because the data line on 0x8eab33c0 is not moved to the physical address yet. This problem is caused when a process is executed after vfork. In the result, the executed process can not read the arguments correctly. I think that the copied arguments from parent process should be copied back to the physical memory as following patch, in other words, a mapped page to process should be copied back to the physical memory unconditionally. --- fs/exec.c.org Mon Feb 5 03:44:54 2007 +++ fs/exec.c Sat Feb 17 17:54:53 2007 @@ -308,17 +308,21 @@ void install_arg_page(struct vm_area_str { struct mm_struct *mm = vma->vm_mm; pte_t * pte; spinlock_t *ptl; if (unlikely(anon_vma_prepare(vma))) goto out; +#if 0 flush_dcache_page(page); +#else + __flush_wback_region((void *)P1SEGADDR(PHYSADDR(page_address(page))), PA GE_SIZE); +#endif pte = get_locked_pte(mm, address, &ptl); if (!pte) goto out; if (!pte_none(*pte)) { pte_unmap_unlock(pte, ptl); goto out; } inc_mm_counter(mm, anon_rss); |