From: Masahiro A. <m-...@aa...> - 2003-01-27 11:24:36
|
Menefy-san and all, sorry for relatively long post, On Mon, 18 Nov 2002 11:51:32 +0000 Stuart Menefy <stu...@st...> wrote: > Folks > > Attached is my second attempt at an improved TLB miss handler. > > Unfortuntaly the previous patch was corrupted, so I've double checked this > one, and it applies cleanly to 2.4 brach HEAD (2.4.20-pre10) and almost > cleanly to 2.4.18. > > This should build for both SH3 and SH4, although it has only been tested > on SH4. > > As always, all comments welcome > > Stuart I've tried your patch on "linux-2_4_18" tagged CVS source, and ran on SolutionEngine 7750S, but kernel oops at startup. I really want to see the speed-up of TLB-Miss handling, due to the likelihood of fact that it may be the source of large latency of RTLinux patch. I would be more than happy if you can spend a little time to read my report below, and give me some thought you might have. Only if you have such time, of course. 1. I've taken stock 2.4.18 kernel and dropped "linux-2_4_18" tagged CVS source in it. Then I've simply applied "2.4.20-tlb" file as patch. As Mundt-san pointed out, it #error in entry.S. I've simply put "!" before #error. 2. I've done make xconfig dep zImage, and put zImage onto CompactFlash. Kernel starts booting, but "Oops" in mem_init. I've put some debug printk and see some values. The output is like this: --- Memory: 63288k/65536k available (1044k kernel code, 2248k reserved, 32k data, 40k init) remap_area_pages begin -->remap_area_pages(address = 0xc0000000, phys_addr = 0x00000000, size = 0x00004000, flags = 0x00000008) -->remap_area_pmd(pmd = 0x8c11dc28, address = 0xc0000000, size = 0x00004000, phys_addr = 0x00000000, flags = 0x00000008) in pte_alloc() pmd_none(*pmd) is true new = 0x8c13f000 pmd_val(*pmd) = 0x8c13f000 pmd_page(*(pmd)) = 0x0c13f000 __pte_offset(address) = 0x00000000 -->remap_area_pte(pte = 0x0c13f000, address = 0x00000000, size = 0x00004000, phys_addr = 0x00000000, flags = 0x00000008) Unable to handle kernel paging request at virtual address 0c13f000 pc = 8c00ddde *pde = 8c001000 Oops: 0000 PC : 8c00ddde SP : 8c111f94 SR : 40008100 TEA : 0c13f000 Not tainted R0 : 00000026 R1 : 00000000 R2 : 40008100 R3 : 00400000 R4 : 8c1076c4 R5 : 00000001 R6 : 00000001 R7 : 8c011920 R8 : 00001000 R9 : 00004000 R10 : 00000000 R11 : 8c011b40 R12 : 00000000 R13 : 0c13f000 R14 : 00000000 MACH: 0004deb8 MACL: 00000000 GBR : b7e3fb6c PR : 8c00ddbe Kernel panic: Attempted to kill the idle task! In idle task - not syncing --- "pte" to remap_area_pte seems wrong. 3.I've put same printk to the flesh 2.4.18cvs source and the output was: --- in pte_alloc() pmd_none(*pmd) is true new = 0x8c13f000 pmd_val(*pmd) = 0x0c13f564 pmd_page(*(pmd)) = 0x8c13f000 __pte_offset(address) = 0x00000000 -->remap_area_pte(pte = 0x8c13f000, --- "pte" looks fine here. 4.I thought "pmd_populate" is generating invalid value, so changed it from: extern inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) { set_pmd(pmd, __pmd((unsigned long)pte)); } to: #define pmd_populate(mm, pmd, pte) \ set_pmd(pmd, __pmd(__pa(pte))) Then, --- in pte_alloc() pmd_none(*pmd) is true new = 0x8c13f000 pmd_val(pmd) = 0x0c13f000 pmd_page(*(pmd)) = 0x8c13f000 __pte_offset(address) = 0x00000000 -->remap_area_pte(pte = 0x8c13f000, --- kernel passes mem_init, but just around when init starts, system resets. 5.I reversed my thinking. Maybe pmd_populate is fine, but pmd_page is to blame. So I changed it from: #define pmd_page(pmd) ((unsigned long) __va(pmd_val(pmd))) to: #define pmd_page(pmd) ((unsigned long) pmd_val(pmd)) kernel passes mem_init again, but just around when init starts, system freezes. Thank you for reading till this point. I suspect that some changes are missing from the patch, or the patch works only for 2.4.20-pre10. I appreciate any input on this matter. ================================= Masahiro ABE, A&D Co., Ltd. Japan |