This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

arm linux内核启动local_flush_tlb_all异常

公司产品基于linux内核开发,对linux-2.6.26内核做了裁剪,添加了部分功能。

现在有需求:需要编译出能够支持ARM Versatile/PB (ARM926EJ-S)的内核。

现在存在问题:

我用标准linux内核2.6.26编译出的内核(格式zImage),在CentOS 7上使用qemu-system-arm模拟arm平台进行启动,可以启动走到加载文件系统的位置,相关打印如下:
[root@localhost ~]# qemu-system-arm -M versatilepb -m 512M -kernel /home/g11303/QEMU_simulate_ARM/zImage-2.6.26 -nographic -append "root=/dev/ram console=ttyAMA0 mem=256M"
pulseaudio: pa_context_connect() failed
pulseaudio: Reason: Connection refused
pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

sdl: SDL_OpenAudio failed
sdl: Reason: No available audio device
sdl: SDL_OpenAudio failed
sdl: Reason: No available audio device
audio: Failed to create voice `lm4549.out'
Uncompressing Linux....................................................................................... done, booting the kernel.
Linux version 2.6.26 (g11303@NFV.COMPILE) (gcc version 4.4.3 (ctng-1.6.1) ) #2 Wed Nov 11 19:17:48 CST 2015
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00093177
Machine: ARM-Versatile PB
setup_arch:__atags_pointer = 0x100
setup_arch:fixup = 00000000
iBankLoop = 0:start = 0, size = 268435456, node = 0.
pgprot_kernel=0xef
Memory policy: ECC disabled, Data cache writeback
iBankLoop = 0:start = 0, size = 268435456, node = 0.
check_initrd:phys_initrd_start = 0, phys_initrd_size = 0.
come in create_mapping<7>On node 0 totalpages: 65536
come in free_area_init_core.
PAGE_SHIFT = 12, PAGE_SIZE = 4096, PAGE_MASK = 4294963200.
DMA zone: size = 65536, sizeof(struct page) = 32.
  DMA zone: 512 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 65024 pages, LIFO batch:15
Normal zone: size = 0, sizeof(struct page) = 32.
  Normal zone: 0 pages used for memmap
Movable zone: size = 0, sizeof(struct page) = 32.
  Movable zone: 0 pages used for memmap
go out free_area_init_core.
bootmem_init:high_memory = 0xd0000000
come in create_mappingcome in create_mappingcome in create_mappingcome in create_mappingcome in create_mappingcome in create_mappingcome in local_flush_tlb_all.
if TLB_WB.
if TLB_V4_D_FULL | TLB_V6_D_FULL.
if TLB_V4_I_FULL | TLB_V6_I_FULL.
CPU0: D VIVT write-through cache
CPU0: I cache: 4096 bytes, associativity 4, 32 byte lines, 32 sets
CPU0: D cache: 65536 bytes, associativity 4, 32 byte lines, 512 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
Kernel command line: root=/dev/ram console=ttyAMA0 mem=256M
PID hash table entries: 1024 (order: 10, 4096 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 256MB = 256MB total
Memory: 257024KB available (2464K code, 215K data, 100K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 192 bytes
NET: Registered protocol family 16
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
JFFS2 version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
msgmni has been set to 502
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
CLCD: Versatile hardware, VGA display
Clock CLCDCLK: setting VCO reg params: S=1 R=99 V=98
Console: switching to colour frame buffer device 80x60
Serial: AMBA PL011 UART driver
dev:f1: ttyAMA0 at MMIO 0x101f1000 (irq = 12) is a AMBA/PL011
console [ttyAMA0] enabled
dev:f2: ttyAMA1 at MMIO 0x101f2000 (irq = 13) is a AMBA/PL011
dev:f3: ttyAMA2 at MMIO 0x101f3000 (irq = 14) is a AMBA/PL011
fpga:09: ttyAMA3 at MMIO 0x10009000 (irq = 38) is a AMBA/PL011
brd: module loaded
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@cam.org>
eth0: SMC91C11xFD (rev 1) at d0866000 IRQ 25 [nowait]
eth0: Ethernet addr: 52:54:00:12:34:56
armflash.0: Found 1 x32 devices at 0x0 in 32-bit bank
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
RedBoot partition parsing not available
afs partition parsing not available
mice: PS/2 mouse device common for all mice
input: AT Raw Set 2 keyboard as /class/input/input0
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
VFP support v0.3: implementor 41 architecture 1 part 10 variant 9 rev 0
input: ImExPS/2 Generic Explorer Mouse as /class/input/input1
rd_load_image:in_fd = -2
initrd_load:err = 0
mount_block_root:fs_names = ext2
mount_block_root:err = -22
mount_block_root:err = -22
mount_block_root:err = -22
mount_block_root:err = -22
List of all partitions:
No filesystem could mount root, tried:  ext2 cramfs minix romfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

但是用我们自己代码编译出的内核,启动失败,会挂死在start_kernel->setup_arch->paging_init->devicemaps_init->local_flush_tlb_all处,相关打印如下:

[root@localhost ~]# qemu-system-arm -M versatilepb -m 512M -kernel /home/g11303/QEMU_simulate_ARM/zImage -nographic -append "root=/dev/ram console=ttyAMA0 mem=256M"
pulseaudio: pa_context_connect() failed
pulseaudio: Reason: Connection refused
pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

sdl: SDL_OpenAudio failed
sdl: Reason: No available audio device
sdl: SDL_OpenAudio failed
sdl: Reason: No available audio device
audio: Failed to create voice `lm4549.out'
Uncompressing Linux............................................................................................... done, booting the kernel.
gyb test!!come in start_kernel.
vprintk: NULL exec env (env)
smp_setup_processor_id done.
init_ve0 done.
unwind_init done.
lockdep_init done.
debug_objects_early_init done.
<6>Initializing cgroup subsys cpu <6>done
cgroup_init_early done.
local_irq_disable done.
early_boot_irqs_off done.
early_init_irq_lock_class done.
lock_kernel done.
ub_init_early done.
tick_init done.
boot_cpu_init done.
page_address_init done.
<5>Linux version (none) (@) (gcc version 4.4.1 (GCC) ) #60 Wed Nov 11 20:12:38 CST 2015
Standard version 0.50
processor_id = 0x41069265
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00093177
machine_arch_type = 387.
Machine: ARM-Versatile PB
__atags_pointer = 256, tags = 0xc0000100
boot_command_line = root=/dev/ram console=ttyAMA0 mem=256M.
Parsing ARGS: root=/dev/ram console=ttyAMA0 mem=256M
parse_cmdline done
processor_id = 0x41069265
cpu_arch = 7
pgprot_kernel=0x4f
Memory policy: ECC disabled, Data cache writeback
build_mem_type_table done
<7>On node 0 totalpages: 65536
come in free_area_init_core.
PAGE_SHIFT = 12, PAGE_SIZE = 4096, PAGE_MASK = 4294963200.
DMA zone: size = 65536, sizeof(struct page) = 44.
<7>  DMA zone: 704 pages used for memmap
<7>  DMA zone: 0 pages reserved
<7>  DMA zone: 64832 pages, LIFO batch:15
Normal zone: size = 0, sizeof(struct page) = 44.
<7>  Normal zone: 0 pages used for memmap
HighMem zone: size = 0, sizeof(struct page) = 44.
<7>  HighMem zone: 0 pages used for memmap
Movable zone: size = 0, sizeof(struct page) = 44.
<7>  Movable zone: 0 pages used for memmap
go out free_area_init_core.
bootmem_init done
PAGE_SIZE = 4096
come in versatile_map_io.
come in local_flush_tlb_all
if TLB_WB.
if TLB_V4_D_FULL | TLB_V6_D_FUL.

社区中的达人是否遇到过类似的现象?或者是哪些修改可以引起这个问题?

小弟不太了解这方面的知识,希望各位前辈可以不吝赐教。