免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 16876 | 回复: 6
打印 上一主题 下一主题

请问这种打印是什么意思:“Unhandled kernel unaligned access[#1]??? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-03-06 18:13 |只看该作者 |倒序浏览
本帖最后由 hanyihong 于 2010-03-07 19:59 编辑

大家好!


      在执行linux驱动代码时,打印信息如下,不知是什么原因?请各位前辈看看,谢谢!

*****************************************************
flash: Erasing chip 0, region 0, block 0
Unhandled kernel unaligned access[#1]:Cpu 0
$ 0   : 0000000000000000 0000005555774b70 0000000000000000 0000000000000000
$ 4   : dfb20010dfb1006c a80000002ef24000 ffffffff81147cc0 0000000000000012
$ 8   : 0000000000000000 a80000002ef24020 000000003b9aca00 ffffffff822bbcc0
$12   : 0000000010104ce0 000000001000001e ffffffff811d25d0 0000000120000c58
$16   : dfb20010dfb10068 ffffffffc0051088 0000000000000118 a80000002ef24020
$20   : dfb20010dfb10008 8001070000000108 ffffffffc0051088 dfb20010dfb10068
$24   : 0000000000000014 ffffffff812cd488                                 
$28   : a80000002ef24000 a80000002ef23f10 000000ffffefd290 ffffffff815047c4
Hi    : 000000000c800000
Lo    : 0000000007811800
epc   : ffffffff81504a3c _spin_lock_irq+0x4/0x38
    Not tainted
ra    : ffffffff815047c4 __down_read+0x1c/0x170
Status: 10104ce2    KX SX UX KERNEL EXL
Cause : 00800010
BadVA : dfb20010dfb1006c
PrId  : 000d0409 (Cavium Octeon)
Modules linked in: ipv6 flash

*** NMI Watchdog interrupt on Core 0x0 ***
        $0      0x0000000000000000      at      0x0000005555774b70
        v0      0x0000000000000000      v1      0x0000000000000001
        a0      0xffffffff822b2f80      a1      0xa80000002eed8010
        a2      0xffffffff822b0000      a3      0x0000000000004000
        a4      0xffffffff822b0000      a5      0x0000000000000010
        a6      0xffffffffffffffff      a7      0xffffffff81528e48
        t0      0xa80000002eed7c21      t1      0xa80000002eed7c20
        t2      0x0000000000000001      t3      0x0000000120000c58
        s0      0xffffffff822b0000      s1      0xffffffff81594ec8
        s2      0xa80000002eed8010      s3      0xa80000002eed8010
        s4      0x0000000000000000      s5      0x8001070000000108
        s6      0xffffffffc0051088      s7      0xdfb20010dfb10068
        t8      0x0000000000000014      t9      0xffffffff812cd488
        k0      0x000000555557eb00      k1      0x0000000000bc0447
        gp      0xa80000002eed8000      sp      0xa80000002eed7f20
        s8      0x000000ffffefd290      ra      0xffffffff811381ec
        epc     0xffffffff81504ff0
        status  0x0000000010584ce4      cause   0x0000000040808c08
        sum0    0x4000000000000000      en0     0x4100400700000000
*** Chip soft reset soon ***

flash.rar

139.38 KB, 下载次数: 46

论坛徽章:
0
2 [报告]
发表于 2010-03-07 20:03 |只看该作者
请各位看看是什么原因造成的,谢谢!

论坛徽章:
0
3 [报告]
发表于 2010-03-07 21:56 |只看该作者
感觉好像是没有字节对齐。

论坛徽章:
0
4 [报告]
发表于 2010-03-10 10:47 |只看该作者
这个问题应该是在MIPS架构下的吧?是在insmod的时候打印的吗?

论坛徽章:
0
5 [报告]
发表于 2010-03-10 22:03 |只看该作者
是的,是在MIPS架构 insmod模块的时候。

请问楼上

论坛徽章:
0
6 [报告]
发表于 2010-03-11 08:33 |只看该作者
打印这个消息的文件的作者有如下的注解,希望对你有帮助。

* Handle unaligned accesses by emulation.
*
* This file is subject to the terms and conditions of the GNU General Public
* License.  See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1996, 1998, 1999, 2002 by Ralf Baechle
* Copyright (C) 1999 Silicon Graphics, Inc.
*
* This file contains exception handler for address error exception with the
* special capability to execute faulting instructions in software.  The
* handler does not try to handle the case when the program counter points
* to an address not aligned to a word boundary.
*
* Putting data to unaligned addresses is a bad practice even on Intel where
* only the performance is affected.  Much worse is that such code is non-
* portable.  Due to several programs that die on MIPS due to alignment
* problems I decided to implement this handler anyway though I originally
* didn't intend to do this at all for user code.
*
* For now I enable fixing of address errors by default to make life easier.
* I however intend to disable this somewhen in the future when the alignment
* problems with user programs have been fixed.  For programmers this is the
* right way to go.
*
* Fixing address errors is a per process option.  The option is inherited
* across fork(2) and execve(2) calls.  If you really want to use the
* option in your user programs - I discourage the use of the software
* emulation strongly - use the following code in your userland stuff:
*
* #include <sys/sysmips.h>
*
* ...
* sysmips(MIPS_FIXADE, x);
* ...
*
* The argument x is 0 for disabling software emulation, enabled otherwise.
*
* Below a little program to play around with this feature.
*
* #include <stdio.h>
* #include <sys/sysmips.h>
*
* struct foo {
*         unsigned char bar[8];
* };
*
* main(int argc, char *argv[])
* {
*         struct foo x = {0, 1, 2, 3, 4, 5, 6, 7};
*         unsigned int *p = (unsigned int *) (x.bar + 3);
*         int i;
*
*         if (argc > 1)
*                 sysmips(MIPS_FIXADE, atoi(argv[1]));
*
*         printf("*p = %08lx\n", *p);
*
*         *p = 0xdeadface;
*
*         for(i = 0; i <= 7; i++)
*         printf("%02x ", x.bar[i]);
*         printf("\n");
* }
*
* Coprocessor loads are not supported; I think this case is unimportant
* in the practice.

论坛徽章:
0
7 [报告]
发表于 2010-10-08 15:49 |只看该作者
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP