我正在尝试使用 nfs 根文件系统启动内核。我怀疑存在一些内存问题。我的内核版本是 4.12.28。这个版本有很多缓存变化。我怀疑内核内存没有正确初始化。此版本使用 Yocto Sumo 和 DTC 版本 4.7。这是一个 Power PC 32 位架构。我在这里分享了 .config 文件。我不确定问题是什么以及在哪里查找。
我启用了QUOTA,我认为这没有用。该系统有 512 MB RAM。所以,我并不怀疑它内存不足。 dcache_bsize 和 icache_bsize 是否足够?我在这里缺少任何明显的东西吗?
这是日志 -
*## Booting kernel from Legacy Image at f8100000 ...
Image Name: Linux-4.12.28
Created: 2019-07-22 7:01:05 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 3683596 Bytes = 3.5 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at f8000000
Booting using the fdt blob at 0xf8000000
Uncompressing Kernel Image ... OK
Loading Device Tree to 007fb000, end 007ff8e8 ... OK
Linux version 4.12.28 (oe-user@oe-host) (gcc version 7.3.0 (GCC) ) #1 Mon Jul 22 00:42:12 UTC 2019
Using MPC837x RDB/WLAN machine description
bootconsole [udbg0] enabled
-----------------------------------------------------
Hash_size = 0x0
phys_mem_size = 0x20000000
dcache_bsize = 0x20
icache_bsize = 0x20
cpu_features = 0x0000000000020460
possible = 0x0000000005a6fd77
always = 0x0000000000020000
cpu_user_features = 0x8c000000 0x00000000
mmu_features = 0x00210000
-----------------------------------------------------
mpc83xx_setup_arch()
Zone ranges:
DMA [mem 0x0000000000000000-0x000000001fffffff]
Normal empty
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x0000000000000000-0x000000001fffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x000000001fffffff]
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
Kernel command line: console=ttyS1,115200 root=/dev/nfs rw ip=dhcp nfsroot=11.12.98.2:/home/sh/server_rootfs
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512064K/524288K available (5852K kernel code, 248K rwdata, 1200K rodata, 172K init, 166K bss, 12224K reserved, 0K cma-reserved)
Kernel virtual memory layout:
* 0xfffdf000..0xfffff000 : fixmap
* 0xfdffd000..0xfe000000 : early ioremap
* 0xe1000000..0xfdffd000 : vmalloc & ioremap
NR_IRQS:512 nr_irqs:512 16
IPIC (128 IRQ sources) at e1000700
clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0x12049cd416, max_idle_ns: 440795202745 ns
clocksource: timebase mult[ccccccd] shift[24] registered
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
Oops: Exception in kernel mode, sig: 4 [#1]
MPC837x RDB/WLAN
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 4.12.28-sira-standard #1
task: c06772f0 task.stack: c06a6000
NIP: c01000fc LR: c013f414 CTR: 00000005
REGS: c06a7ce0 TRAP: 0700 Not tainted (4.12.28-sira-standard)
MSR: 00089032 <EE,ME,IR,DR,RI>
CR: 24028244 XER: 20000000
GPR00: c013f2e8 c06a7d90 c06772f0 df004e98 00000008 00000001 00000006 00000008
GPR08: 00000000 00000000 00000000 007a1200 84028242 00040000 00000000 00000001
GPR16: 00800300 df416a60 1ffbf05c df414e80 c067c480 ffffffff 00000001 00000000
GPR24: c06c0000 00000000 df416c10 00000000 c013f440 00400000 c0683ba8 df004e98
NIP [c01000fc] set_nlink+0x0/0x58
LR [c013f414] proc_get_inode+0x164/0x190
Call Trace:
[c06a7d90] [c013f2e8] proc_get_inode+0x38/0x190 (unreliable)
[c06a7db0] [c013f4e0] proc_fill_super+0xa0/0x124
[c06a7dd0] [c00e5914] mount_ns+0xa8/0x184
[c06a7e00] [c00e6728] mount_fs+0x24/0xb4
[c06a7e20] [c010581c] vfs_kern_mount.part.8+0x5c/0x158
[c06a7e50] [c0105950] kern_mount_data+0x24/0x50
[c06a7e60] [c013f960] pid_ns_prepare_proc+0x28/0x50
[c06a7e80] [c003e284] alloc_pid+0x4d4/0x4f8
[c06a7ee0] [c0022500] copy_process.isra.7.part.8+0x914/0x12a4
[c06a7f60] [c0023328] _do_fork+0xbc/0x300
[c06a7fa0] [c000409c] rest_init+0x24/0x78
[c06a7fb0] [c06499a0] start_kernel+0x304/0x330
[c06a7ff0] [00003438] 0x3438
Instruction dump:
5cec9cb4 15d573b4 01320182 c865c007 4700e2e1 9303fa22 2f6abc88 24d19205
925583f0 7e007927 f2207002 52600025 <116b5917> 21758908 ac204100 002054e1
---[ end trace 0000000000000000 ]---
Kernel panic - not syncing: Attempted to kill the idle task!
Rebooting in 180 seconds..
I want this to mount nfs root file system and run the /sbin/init successfully.*
这是默认配置。
[https://docs.google.com/document/d/11XpGHxtEhP9DezyNPYiPqIuPhIpa7y0zF_o4Pl6QkZQ/edit?usp=sharing][内核配置]
答案1
看起来内核遇到了非法指令异常(700
是一个Program
异常 - 可能有很多原因,但sig: 4
确实是SIGILL
)。
核心中有许多未实现的指令e300
- 仔细检查用于构建内核的编译器是否正确,并使用正确的命令行选项,并且选择了正确的 cpu 选项.config
(对我来说它们看起来不错,但我不不知道芯片)。
阅读这可能会有所帮助(只是我发现的一篇随机文章)并查看附录 Be300coreRM.pdf。
[id]cache_bsize
是指令和数据高速缓存的高速缓存块(又名行)大小 - 0x20
(32 字节)对于此类处理器来说似乎是一个合理的值。