【问题标题】:Kernel Oops page fault error codes for ARMARM 的内核糟糕页面错误错误代码
【发布时间】:2012-10-29 10:00:42
【问题描述】:

Oops 之后的错误代码提供了有关 arm ex 中恐慌的信息。 Oops: 17 [#1] PREEMPT SMP 在这种情况下,17 提供了什么信息。 在 x86 中它代表 -

  • bit 0 == 0: no page found 1: protection fault

  • bit 1 == 0: read access 1: write access

  • bit 2 == 0: kernel-mode access 1: user-mode access

  • bit 3 == 1: use of reserved bit detected

  • bit 4 == 1: fault was an instruction fetch

但我无法在 arm 中找到任何信息。

谢谢 分流

【问题讨论】:

  • 你用过谷歌吗?我尝试了“linux kernel oops arm”并获得了很多成功。
  • 我在问什么数字 17 提供有关 arm 中页面错误的信息,在 x86 中,oops 之后的数字是 0X0000,其中每个位都表示错误。

标签: linux linux-kernel arm fault


【解决方案1】:

您在上面打印的位描述是页面错误描述,而不是 Oops 错误。

有关查找 Linux 崩溃分析的更多信息,请参阅 Linux 的 oops-tracing

下面是你的Oops: 17 [#1] PREEMPT SMParch/arm/kernel/traps.c

    #define S_PREEMPT " PREEMPT"
    ...
    #define S_SMP " SMP"
    ...
    printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP S_ISA "\n", str, err, ++die_counter);

页面错误不需要使内核崩溃,也不是所有的内核崩溃都是页面错误。所以很有可能Oops: 17 根本与页面错误无关。 (作为奖励,我的疯狂猜测是它是关于调度/只是听起来对我来说很熟悉。)

【讨论】:

  • 我打印的是 x86 架构的页面错误描述,我想知道 ARM 也是如此。
  • @shunty 那么你想知道 arm arch 的页面错误描述吗?你为什么不这样问?你为什么提到 Oops 代码?
  • 在 X86 中如果页面错误发生在 Oops: 0000 之后的值会给出关于页面错误的信息,对于 arm 也是一样的吗?
【解决方案2】:

您似乎在询问 ARM 故障状态寄存器 (FSR) 位。我查看了内核代码(arch/arm/mm/fault.c),发现这实际上是作为参数传递给 Oops 代码的:

    static void
    __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
              struct pt_regs *regs)
    {
    [...]
        pr_alert("Unable to handle kernel %s at virtual address %08lx\n",
             (addr < PAGE_SIZE) ? "NULL pointer dereference" :
             "paging request", addr);

        show_pte(mm, addr);
        die("Oops", regs, **fsr**);
   [...]
   }

所以,无论如何,我追踪到了 ARM(v4 及更高版本?)MMU 上的 FSR 寄存器:

来源:http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0438d/BABFFDFD.html

...
    [3:0]   FS[3:0] 
    Fault Status bits. This field indicates the type of exception generated. Any encoding not listed is reserved:
    b00001
       Alignment fault.
    b00100
       Instruction cache maintenance fault[a].
    b01100
       Synchronous external abort on translation table walk, 1st level.
    b01110
       Synchronous external abort on translation table walk, 2nd level.
    b11100
       Synchronous parity error on translation table walk, 1st level.
    b11110
       Synchronous parity error on translation table walk, 2nd level.
    b00101
       Translation fault, 1st level.
    b00111
       Translation fault, 2nd level.
    b00011
       Access flag fault, 1st level.
    b00110
       Access flag fault, 2nd level.
    b01001
       Domain fault, 1st level.
    b01011
       Domain fault, 2nd level.
    b01101
       Permission fault, 1st level.
    b01111
       Permission fault, 2nd level.
    b00010
       Debug event.
    b01000
       Synchronous external abort, non-translation.
    b11001
       Synchronous parity error on memory access.
    b10110
       Asynchronous external abort.
    b11000
       Asynchronous parity error on memory access.

...

免责声明:我不知道此信息是否仍然相关;该文档声明它适用于 ARM Cortex A15,并且该页面被标记为已取代。

还可以查看此页面: ARM926EJ-S Fault address and fault status registers

【讨论】:

  • 另外,仅供参考,FAR(故障地址寄存器)保存有故障的虚拟地址,相当于英特尔 MMU 上的 CR2。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-04-28
  • 1970-01-01
  • 2013-11-08
  • 1970-01-01
  • 2020-12-29
  • 1970-01-01
相关资源
最近更新 更多