cvs commit: src/sys/amd64/amd64 db_trace.c exception.S genassym.c trap.c

Joseph Koshy jkoshy at
Sat Sep 3 04:57:29 PDT 2005

jkoshy      2005-09-03 11:57:28 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_6)
    sys/amd64/amd64      db_trace.c exception.S genassym.c trap.c 
  MFC: { db_trace.c:1.69, exception.S:1.127, genassym.c:1.156, trap.c:1.290 }
  - Special-case NMI handling on the AMD64.
    On entry or exit from the kernel the 'alltraps' and 'doreti' the code
    used by normal traps disables interrupts to protect the critical sections
    where it is setting up %gs.
    This protection is insufficient in the presence of NMIs since NMIs
    can be taken even when the processor has disabled normal interrupts.
    Thus the NMI handler needs to actually read MSR_GBASE on entry to
    the kernel to determine whether a swap of %gs using 'swapgs' is
    needed.  However, reads of MSRs are expensive and integrating this
    check into the 'alltraps'/'doreti' path would penalize normal
  - Teach DDB about the 'nmi_calltrap' symbol.
  Reviewed by:    bde, peter (an older version) and ups
  Approved by:    re (scottl)
  Revision   Changes    Path   +2 -1      src/sys/amd64/amd64/db_trace.c  +76 -2     src/sys/amd64/amd64/exception.S  +2 -0      src/sys/amd64/amd64/genassym.c  +2 -1      src/sys/amd64/amd64/trap.c

More information about the cvs-src mailing list