4

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 中找到任何信息。

谢谢顺蒂

4

2 回答 2

2

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

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

以下是您的Oops: 17 [#1] PREEMPT SMP arch/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根本与页面错误无关。(作为奖励,我的疯狂猜测是它是关于调度/只是听起来我很熟悉。)

于 2012-11-09T07:09:02.607 回答
1

看起来您在询问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 故障地址和故障状态寄存器

于 2016-05-24T05:28:22.227 回答