[Bug 224350] [PATCH] powerpc64: Add handler for Facility Unavailable

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Dec 14 22:29:28 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224350

            Bug ID: 224350
           Summary: [PATCH] powerpc64: Add handler for Facility
                    Unavailable
           Product: Base System
           Version: CURRENT
          Hardware: powerpc
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: gromero at br.ibm.com
          Keywords: patch

Created attachment 188843
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=188843&action=edit
Patch for this bug

Currently Facility Unavailable is absent and once an application
tries to use or access a register from a feature disabled in the
CPU it causes a kernel panic. 

A simple test-case is:

#include <stdio.h>

int main() { asm volatile ("tbegin.;"); }

which will use TM (Hardware Transactional Memory) feature
which is not supported by the kernel and so I'll trigger
the following panic:

fatal user trap:

   exception       = 0xf60 (unknown)
   srr0            = 0x10000890
   srr1            = 0x800000000000f032
   lr              = 0x100004e4
   curthread       = 0x5f93000
          pid = 1021, comm = htm

panic: unknown trap
cpuid = 40
KDB: stack backtrace:
#0 0x59d1c8 at ??+0
#1 0x59d264 at ??+0
#2 0x959490 at ??+0
#3 0x95a94c at ??+0
#4 0x94ea4c at ??+0
Uptime: 3m18s
Dumping 10 MB (3 chunks)
  chunk 0: 11MB (2648 pages) ... ok
  chunk 1: 1MB (24 pages) ... ok
  chunk 2: 1MB (2 pages)panic: IOMMU mapping error: -4

cpuid = 40
Uptime: 3m18s

This commit fixes that state by adding a handler for
Facility Unavailable exception (0xF60), treating
the instruction that trigged the exception as an
illegal instruction.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list