Unable to handle kernel paging request for data at address 0x00000000

这篇博客讨论了一个Linux内核启动时遇到的问题,即在处理内存请求时遇到0x00000000地址的页错误。内容涉及内核版本、设备树解析、PCI内存空间设置、初始化RAMdisk和设备树 blob加载等。在尝试使用调试内核和分析调用踪迹后,作者指出问题可能出现在设备树或内存管理方面,但没有找到确切原因。讨论中提到了内存分配、u-boot配置以及可能的硬件问题,包括内存大小限制和BAT寄存器设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. Linux version 2.6.26.3 (gr1x@mars) (gcc version 4.2.2) #1 Mon Sep 8 23:39:50 CS8
  2. console [udbg0] enabled
  3. setup_arch: bootmem
  4. arch: exit
  5. Zone PFN ranges:
  6.   DMA             0 ->   131072
  7.   Normal     131072 ->   131072
  8. Movable zone start PFN for each node
  9. early_node_map[1] active PFN ranges
  10.     0:        0 ->   131072
  11. Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
  12. Kernel command line:
  13. UIC3 (32 IRQ sources) at DCR 0x200
  14. UIC0 (32 IRQ sources) at DCR 0xc0
  15. UIC1 (32 IRQ sources) at DCR 0xd0
  16. UIC2 (32 IRQ sources) at DCR 0x210
  17. Unable to handle kernel paging request for data at address 0x00000000
  18. Faulting instruction address: 0xc0010a2c
  19. Oops: Kernel access of bad area, sig: 11 [#1]
  20. Galaxy
  21. Modules linked in:
  22. NIP: c0010a2c LR: c01418cc CTR: c0013aec
  23. REGS: c0265e60 TRAP: 0300   Not tainted  (2.6.26.3)
  24. MSR: 00021000 <ME>  CR: 84e22448  XER: 20000000
  25. DEAR: 00000000, ESR: 00000000
  26. TASK = c024d4a0[0] 'swapper' THREAD: c0264000
  27. GPR00: c014190c c0265f10 c024d4a0 00000000 c01f6103 ffffffff 00000000 00000090
  28. GPR08: 00000000 00000069 c025be8c c07faafb 42e22484 4a1060c1 1ffe5f00 00000000
  29. GPR16: 1ffdb7e4 1ffe0178 00000000 00000000 00000000 00000000 1ffe111c 00000006
  30. GPR24: 00000000 00000000 c00161f4 c01f6220 dfffe434 c0265f48 c01f6104 dffff048
  31. NIP [c0010a2c] strcmp+0x8/0x24
  32. LR [c01418cc] of_find_property+0x4c/0x7c
  33. Call Trace:
  34. [c0265f10] [c0047784] set_irq_type+0x60/0x98 (unreliable)
  35. [c0265f30] [c014190c] of_get_property+0x10/0x34
  36. [c0265f40] [c0141ce8] of_device_is_compatible+0x24/0xa0
  37. [c0265f70] [c0141f54] of_find_compatible_node+0x78/0xc4
  38. [c0265f90] [c023303c] uic_init_tree+0x140/0x17c
  39. [c0265fb0] [c022e7e0] init_IRQ+0x24/0x34
  40. [c0265fc0] [c02288f8] start_kernel+0x174/0x2a8
  41. [c0265ff0] [c00001e8] skpinv+0x190/0x1cc
  42. Instruction dump:
  43. 3884ffff 8c050001 2c000000 4082fff8 38a5ffff 8c040001 2c000000 9c050001
  44. 4082fff4 4e800020 38a3ffff 3884ffff <8c650001> 2c830000 8c040001 7c601851
  45. ---[ end trace 31fd0ba7d8756001 ]---
  46. Kernel panic - not syncing: Attempted to kill the idle task!
  47. Rebooting in 180 seconds..
昨天的问题,邮件列表里曾有人问过相同的问题,摘录一下: http://ozlabs.org/pipermail/linuxppc-dev/2008-April/054087.html,
crash位置是 "console_init()" ...(bdi2000,羡慕)
  1. after building a debug kernel and attaching the bdi2000 it looks like  
  2. the crash occurs during "console_init()" ...
和我一样,最开始也认为dts文件有问题
  1. > Kernel starts and crashes with "unable to handle kernel paging request @  
  2. > 00000000".
  3. >
  4. > After turning debug on in some files I can see that the initrd memory  
  5. > gets reserved and the dtb is parsed correctly.
  6. > PCI memory/io spaces are set up fine.
  7. >
  8. > At first I thought this is a problem with the device tree since the call  
  9. > trace always points to "of_"-functions and "strcmp".
  10. >     
  11. Could you provide this call trace?
  12. -Scott
邮件中的backtrace
  1. ## Booting kernel from Legacy Image at ff810000 ...
  2.    Image Name:   2.6.25 mvBL-M7 MPC8343 #12
  3.    Image Type:   PowerPC Linux Kernel Image (uncompressed)
  4.    Data Size:    2494236 Bytes =  2.4 MB
  5.    Load Address: 00000000
  6.    Entry Point:  00000000
  7.    Verifying Checksum ... OK
  8.    Loading Kernel Image ... OK
  9. OK
  10. ## Flattened Device Tree blob at 00000000
  11.    Booting using the fdt blob at 0x600000
  12. ## Loading init Ramdisk from Legacy Image at 01000000 ...
  13.    Image Name:   mvBC-1G uInitrd #1.1.03
  14.    Image Type:   PowerPC Linux RAMDisk Image (uncompressed)
  15.    Data Size:    2654208 Bytes =  2.5 MB
  16.    Load Address: 00000000
  17.    Entry Point:  00000000
  18.    Verifying Checksum ... OK
  19.    Loading Ramdisk to 1fcb7000, end 1ff3f000 ... OK
  20.  -> early_init_devtree(c0600000)
  21. search "chosen", depth: 0, uname:
  22. search "chosen", depth: 1, uname: chosen
  23. Looking for initrd properties... <3>initrd_start=0xdfcb7000  
  24. initrd_end=0xdff3f000
  25. Command line is: root=/dev/ram ro rootfstype=squashfs
  26. dt_root_size_cells = 1
  27. dt_root_addr_cells = 1
  28. memory scan node memory, reg size 8, data: 0 20000000 2 1,
  29.  - 0 ,  20000000
  30. reserving: 1fcb7000 -> 288001
  31. Phys. mem: 20000000
  32. -> move_device_tree
  33. <- move_device_tree
  34. Scanning CPUs ...
  35. boot cpu: logical 0 physical 0
  36.  <- early_init_devtree()
  37. Using mvBlueLYNX-M7 machine description
  38. Linux version 2.6.25-rc8-01197-g1de15bb-dirty (root at nova) (gcc version 
  39. 4.0.0 (DENX ELDK 4.1 4.0.0)) #12 PREEMPT Wed Apr 9 14:40:48 CEST 2008
  40.  -> unflatten_device_tree()
  41.   size is 192c, allocating...
  42.   unflattening dfffe6d0...
  43. fixed up name for  ->
  44. fixed up name for chosen -> chosen
  45. fixed up name for wdt at 200 -> wdt
  46. fixed up name for ethernet-phy at 0 -> ethernet-phy
  47. fixed up name for ethernet-phy at 1 -> ethernet-phy
  48. fixed up name for ethernet at 24000 -> ethernet
  49. fixed up name for ethernet at 25000 -> ethernet
  50. fixed up name for serial at 4500 -> serial
  51. fixed up name for serial at 4600 -> serial
  52. fixed up name for pic at 700 -> pic
  53. fixed up name for ppcboot_env at 0 -> ppcboot_env
  54. fixed up name for ppcboot_env_red at 0x2000 -> ppcboot_env_red
  55. fixed up name for u-boot_autoscript at 0x4000 -> u-boot_autoscript
  56. fixed up name for u-boot_autoscript_red at 0x4000 -> u-boot_autoscript_red
  57. fixed up name for dtb at 0x8000 -> dtb
  58. fixed up name for dtb_red at 0xa000 -> dtb_red
  59. fixed up name for kernel at 0x10000 -> kernel
  60. fixed up name for rfs at 0x400000 -> rfs
  61. fixed up name for u-boot at 0x700000 -> u-boot
  62. fixed up name for fpga at 0x780000 -> fpga
  63.  <- unflatten_device_tree()
  64. Found initrd at 0xdfcb7000:0xdff3f000
  65.  -> find_legacy_serial_port()
  66. stdout is /soc8343 at e0000000/serial at 4500
  67. legacy_serial_console = 0
  68. default console speed = 115740
  69.  <- find_legacy_serial_port()
  70. console [udbg0] enabled
  71. setup_arch: bootmem
  72. mvblm7_setup_arch()
  73. arch: exit
  74. Zone PFN ranges:
  75.   DMA             0 ->   131072
  76.   Normal     131072 ->   131072
  77. Movable zone start PFN for each node
  78. early_node_map[1] active PFN ranges
  79.     0:        0 ->   131072
  80. Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
  81. Kernel command line: root=/dev/ram ro rootfstype=squashfs
  82. PID hash table entries: 2048 (order: 11, 8192 bytes)
  83. clocksource: timebase mult[3c00001] shift[22] registered
  84. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  85.  -> check_legacy_serial_console()
  86.  can't find stdout package /soc8343 at e0000000/serial at 4500 !
  87. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  88. Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
  89. Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
  90. Memory: 514048k/524288k available (2328k kernel code, 9676k reserved, 
  91. 88k data, 126k bss, 140k init)
  92. SLUB: Genslabs=12, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
  93. Mount-cache hash table entries: 512
  94. ------------[ cut here ]------------
  95. Badness at lib/kref.c:43
  96. NIP: c00f5494 LR: c000d6b0 CTR: 00000000
  97. REGS: c025de60 TRAP: 0700   Not tainted  (2.6.25-rc8-01197-g1de15bb-dirty)
  98. MSR: 00029032 <EE,ME,IR,DR>  CR: 84000048  XER: 00000000
  99. TASK = c0248510[0] 'swapper' THREAD: c025c000
  100. GPR00: 00000001 c025df10 c0248510 dffff170 dffff050 00000009 df80fc6a 
  101. 00000000
  102. GPR08: 0007ffff 00000000 df80b990 c06011cf 24000042 5fffffff 1fffd000 
  103. 00000000
  104. GPR16: 1fffffff 9fffffff 00000000 00000000 1fff8910 1ff426f8 00000004 
  105. 00288000
  106. GPR24: 00000000 00000000 c02630a0 c0260000 dfffefa0 c025c000 dffff050 
  107. dffff13c
  108. NIP [c00f5494] kref_get+0xc/0x24
  109. LR [c000d6b0] of_node_get+0x20/0x38
  110. Call Trace:
  111. [c025df10] [c06011cf] 0xc06011cf (unreliable)
  112. [c025df20] [c01571a4] of_get_next_child+0x40/0x9c
  113. [c025df40] [c00bab5c] proc_device_tree_add_node+0x4c/0x144
  114. [c025df60] [c00bab50] proc_device_tree_add_node+0x40/0x144
  115. [c025df80] [c00bab50] proc_device_tree_add_node+0x40/0x144
  116. [c025dfa0] [c00bacc8] proc_device_tree_init+0x74/0xa0
  117. [c025dfb0] [c0235c70] proc_root_init+0xd4/0x10c
  118. [c025dfc0] [c022374c] start_kernel+0x244/0x2cc
  119. [c025dff0] [00003438] 0x3438
  120. Instruction dump:
  121. 4bf289e1 7fa3eb78 3ba00000 4bfff3ad 4bffffd8 90830000 4e800020 38800001
  122. 4bfffff4 80030000 21200000 7c090114 <0f000000> 7d201828 31290001 7d20192d
  123. WARNING: Bad of_node_put() on
  124. Call Trace:
  125. [c025ded0] [c00088fc] show_stack+0x50/0x190 (unreliable)
  126. [c025df00] [c000de70] of_node_release+0xb0/0xcc
  127. [c025df20] [c00f5500] kref_put+0x54/0x6c
  128. [c025df30] [c000d6ec] of_node_put+0x24/0x34
  129. [c025df40] [c00babc8] proc_device_tree_add_node+0xb8/0x144
  130. [c025df60] [c00bab50] proc_device_tree_add_node+0x40/0x144
  131. [c025df80] [c00bab50] proc_device_tree_add_node+0x40/0x144
  132. [c025dfa0] [c00bacc8] proc_device_tree_init+0x74/0xa0
  133. [c025dfb0] [c0235c70] proc_root_init+0xd4/0x10c
  134. [c025dfc0] [c022374c] start_kernel+0x244/0x2cc
  135. [c025dff0] [00003438] 0x3438
  136. Unable to handle kernel paging request for data at address 0x00000000
  137. Faulting instruction address: 0xc0014454
  138. Oops: Kernel access of bad area, sig: 11 [#1]
  139. PREEMPT mvBlueLYNX-M7
  140. Modules linked in:
  141. NIP: c0014454 LR: c00ba9e0 CTR: 00000000
  142. REGS: c025de70 TRAP: 0300   Not tainted  (2.6.25-rc8-01197-g1de15bb-dirty)
  143. MSR: 00009032 <EE,ME,IR,DR>  CR: 44000048  XER: 00000000
  144. DAR: 00000000, DSISR: 20000000
  145. TASK = c0248510[0] 'swapper' THREAD: c025c000
  146. GPR00: c00bac0c c025df20 c0248510 00000023 ffffffff df80fd60 df80fd6e 
  147. 00000000
  148. GPR08: 001fffff 00000002 df80b990 c06010f5 24000022 5fffffff 1fffd000 
  149. 00000000
  150. GPR16: 1fffffff 9fffffff 00000000 00000000 1fff8910 1ff426f8 00000004 
  151. 00288000
  152. GPR24: 00000000 00000000 c02630a0 c0260000 dfffefa0 00000000 c025c000 
  153. df80fd00
  154. NIP [c0014454] strcmp+0x10/0x24
  155. LR [c00ba9e0] duplicate_name+0x3c/0x94
  156. Call Trace:
  157. [c025df20] [c00ba870] __proc_device_tree_add_prop+0x54/0xd4 (unreliable)
  158. [c025df40] [c00bac0c] proc_device_tree_add_node+0xfc/0x144
  159. [c025df60] [c00bab50] proc_device_tree_add_node+0x40/0x144
  160. [c025df80] [c00bab50] proc_device_tree_add_node+0x40/0x144
  161. [c025dfa0] [c00bacc8] proc_device_tree_init+0x74/0xa0
  162. [c025dfb0] [c0235c70] proc_root_init+0xd4/0x10c
  163. [c025dfc0] [c022374c] start_kernel+0x244/0x2cc
  164. [c025dff0] [00003438] 0x3438
  165. Instruction dump:
  166. 2c000000 4082fff8 38a5ffff 8c040001 2c000000 9c050001 4082fff4 4e800020
  167. 38a3ffff 3884ffff 8c650001 2c830000 <8c040001> 7c601851 4d860020 4182ffec
  168. ---[ end trace 8640abe69a316dee ]---
  169. Kernel panic - not syncing: Attempted to kill the idle task!
  170. Rebooting in 180 
  171. seconds..                                                    
提到问题可能出现在memory corruption
  1. > It looks like you have some memory corruption between here...
  2. >

  3. >
  4. > ...and here.
  5. >
  6. > -Scott
  7. Scott,
  8. are you talking about a possible hardware problem or misbehaving code ?
  9. Does it look like something gets overwritten during initrd 
  10. extraction/movement ?
  11. The system has 512MB RAM which means that we need 2 BAT regs to map the 
  12. memory. I've found comments in Freescale u-boot header files that 
  13. currently a max of 256MB is supported. I never understood why ? Could 
  14. this problem be related to this ?
  15. Do I need to supply reserved memory regions ? I thought u-boot is doing 
  16. so for initrd and the kernel don't need it ...
  17. I'll rebuild u-boot with 256MB memory size and do an extra run with 
  18. memory test - just to make sure.
  19. Any hints where to look else ?
最终问题是这样的
  1. Scott + Kim,
  2. as mentioned before I have re-built u-boot with the following 
  3. modifications :
  4. - Reduce Memsize from 512 to 256MB
  5. - Skipped 2nd BAT setup
  6. dtb looks the same but memory size set to 256MB.
  7. System boots fine - this is weird !

  8. I'm not really familiar with the powerpc tree of the kernel and far out 
  9. of sync with the current development.
  10. Could you have a look at this ?
  11. Any ideas right now ?
  12. Thanks,
  13. Andre
同样,我移植uboot时,meomry部分也有些奇怪的问题:买来条假内存条,默认设为2个bank256M则crash,直接一个bank512M正常,且通过mtest测试,现在还搞不清内存条的bank数,spd信息无法读出,插到笔记本不能启动。同样将内存设置256M试试吧。

不能用bdi2000调试,真是很郁闷,不知道具体的代码位置,下午再玩玩kdb。


101.664615: Call trace: 101.664617: dump_backtrace+0xf0/0x140 101.664627: show_stack+0x18/0x28 101.664631: dump_stack_lvl+0x70/0xa4 101.664639: __kernel_unpoison_pages+0x16c/0x1ac 101.664647: post_alloc_hook+0x184/0x1ac 101.664653: prep_new_page+0x28/0x188 101.664658: get_page_from_freelist+0x1bb8/0x1d54 101.664664: __alloc_pages+0xe8/0x2cc 101.664670: __erofs_allocpage+0x88/0xb8 101.664677: z_erofs_do_read_page+0x8f0/0xcb4 101.664683: z_erofs_readahead+0x1f8/0x378 101.664690: read_pages+0x80/0x38c 101.664695: page_cache_ra_unbounded+0x1c4/0x238 101.664701: page_cache_ra_order+0x2c4/0x350 101.664706: do_sync_mmap_readahead+0x27c/0x56c 101.664713: filemap_fault+0x1c0/0xa78 101.664718: handle_mm_fault+0x558/0x20c0 101.664723: do_page_fault+0x20c/0x4b0 101.664730: do_translation_fault+0x38/0x54 101.664736: do_mem_abort+0x58/0x118 101.664742: el0_da+0x48/0x84 101.664748: el0t_64_sync_handler+0x98/0xbc 101.664753: el0t_64_sync+0x1a8/0x1ac 101.664761: page:fffffffe24132000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x984c80 101.664770: flags: 0x2000000000000000(zone=1|kasantag=0x0) 101.664779: page_type: 0xffffffff() 101.664787: raw: 2000000000000000 dead000000000100 dead000000000122 0000000000000000 101.664796: raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 101.664802: page dumped because: pagealloc: corrupted page details 101.664809: page_owner info is not present (never set?) 101.667247: Unable to handle kernel paging request at virtual address ffffff891b25a00c 101.667254: Mem abort info: 101.667257: ESR = 0x0000000096000021 101.667261: EC = 0x25: DABT (current EL), IL = 32 bits 101.667265: SET = 0, FnV = 0 101.667268: EA = 0, S1PTW = 0 101.667272: FSC = 0x21: alignment fault 101.667275: Data abort info:
03-08
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值