History log of /freebsd-10-stable/sys/powerpc/aim/trap.c
Revision Date Author Comments
# 333205 03-May-2018 avg

MFC r332752: set kdb_why to "trap" when calling kdb_trap from trap_fatal

This will allow to hook a ddb script to "kdb.enter.trap" event.
Previously there was no specific name for this event, so it could only
be handled by either "kdb.enter.unknown" or "kdb.enter.default" hooks.
Both are very unspecific.

Having a specific event is useful because the fatal trap condition is
very similar to panic but it has an additional property that the current
stack frame is the frame where the trap occurred. So, both a register
dump and a stack bottom dump have additional information that can help
analyze the problem.

I have added the event only on architectures that have trap_fatal()
function defined. I haven't looked at other architectures. Their
maintainers can add support for the event later.

Sample script:
kdb.enter.trap=bt; show reg; x/aS $rsp,20; x/agx $rsp,20

Note: changes to powerpc/aim/trap.c and powerpc/booke/trap.c are direct
changes.

Sponsored by: Panzura


# 333202 03-May-2018 avg

follow-up to r333201 for powerpc, no kdb_active check in trap_fatal

This is a direct commit as there are two copies of trap_fatal for
powerpc in this branch.

Sponsored by: Panzura


# 275794 15-Dec-2014 kib

MFC r275616:
Thread waiting for the vfork(2)-ed child to exec or exit, must allow
for the suspension.

MFC r275683 (by andreast):
Fix build for powerpc(32|64) kernels.

MFC r275686 (by andreast):
Fix kernel build for booke.

r275639 (by andrew) is not merged, since arm/arm/syscall.c is not
present on the stable/10 branch, and arm/arm/trap.c already includes
sys/kernel.h.


# 271212 06-Sep-2014 jhibbits

MFC r269701:

Set the si_code appropriately for exception-caused signals.

LLDB checks the si_code, and aborts if a code isn't known.

Approved by: re (gjb)
Relnotes: yes


# 271113 04-Sep-2014 nwhitehorn

MFC r268880:
Allow mappings of memory not previously direct-mapped by the kernel when
calling mmap on /dev/mem and add a handler for the possible userland
machine checks that may result. Remove some pointless and wrong copy/paste
that has been in here for a decade as well.

This results in a /dev/mem with identical semantics to the x86 version.


# 269752 09-Aug-2014 markj

MFC r266826, r266827
Move some duplicated hook definitions from machine-dependent files to
kern_dtrace.c.


# 266019 14-May-2014 ian

MFC r258268, r258271, r258272, r258274, r258275, r258427, r258694, r258696,
r258697, r258757

Do not assume a value for #address-cells when parsing the OF translations
map. This allows the kernel to get farther with OpenBIOS on 64-bit CPUs.

Actually look up #address-cells instead of assuming it is correlated with
the Uninorth version number.

#interrupt-cells belongs to the iparent, not the device parent.

Add a sysctl to allow disabling resetting the OF syscons.

For PCI<->PCI bridges, #address-cells may be 3.

Make RTAS calls, which call setfault() to recover from machine checks,
preserve any existing fault buffer.

badaddr() is used only in the grackle PCI driver, so move its definition
there. Clean up a spurious setfault() declaration as well.

This [phyp_console] driver doesn't need the /options node, so don't check
for it.

Use the Open Firmware-based CPU frequency determination as a generic
fallback if we can't measure CPU frequency. This is also useful on a
variety of embedded systems using FDT.


# 266005 14-May-2014 ian

MFC r258259, r258798, r259010

Unify handling of illegal instruction faults between AIM and Book-E.

Make uart_cpu_powerpc work on both FDT and OFW systems.

Fix debug printfs in FPU_EMU to compile on powerpc64 and enable it for
powerpc64.


# 262042 17-Feb-2014 avg

MFC r257417: Remove references to an unused fasttrap probe hook


# 260670 15-Jan-2014 jhibbits

MFC r256543,r259245,r259421,r259668,r259674

r256543:

Add fasttrap for PowerPC. This is the last piece of the DTrace/ppc puzzle.
It's incomplete, it doesn't contain full instruction emulation, but it should be
sufficient for most cases.

r259245,r259421: (FBT)

FBT now does work fully on PowerPC.

Save r3 before using it for the trap check, else we end up saving the new r3,
containing the trap instruction encoding (0x7c810808), and restoring it back
with the frame on return. This caused it to panic on my ppc32 machine.

r259668,r259674:
Fix a typo in the FBT code.


# 260667 15-Jan-2014 jhibbits

MFC r256542,r256581

Move the PMC handling to the first level interrupt handler where it belongs.
Also add the pmc_hook use, to handle callchain tracing.


# 275794 15-Dec-2014 kib

MFC r275616:
Thread waiting for the vfork(2)-ed child to exec or exit, must allow
for the suspension.

MFC r275683 (by andreast):
Fix build for powerpc(32|64) kernels.

MFC r275686 (by andreast):
Fix kernel build for booke.

r275639 (by andrew) is not merged, since arm/arm/syscall.c is not
present on the stable/10 branch, and arm/arm/trap.c already includes
sys/kernel.h.


# 271212 06-Sep-2014 jhibbits

MFC r269701:

Set the si_code appropriately for exception-caused signals.

LLDB checks the si_code, and aborts if a code isn't known.

Approved by: re (gjb)
Relnotes: yes


# 271113 04-Sep-2014 nwhitehorn

MFC r268880:
Allow mappings of memory not previously direct-mapped by the kernel when
calling mmap on /dev/mem and add a handler for the possible userland
machine checks that may result. Remove some pointless and wrong copy/paste
that has been in here for a decade as well.

This results in a /dev/mem with identical semantics to the x86 version.


# 269752 09-Aug-2014 markj

MFC r266826, r266827
Move some duplicated hook definitions from machine-dependent files to
kern_dtrace.c.


# 266019 14-May-2014 ian

MFC r258268, r258271, r258272, r258274, r258275, r258427, r258694, r258696,
r258697, r258757

Do not assume a value for #address-cells when parsing the OF translations
map. This allows the kernel to get farther with OpenBIOS on 64-bit CPUs.

Actually look up #address-cells instead of assuming it is correlated with
the Uninorth version number.

#interrupt-cells belongs to the iparent, not the device parent.

Add a sysctl to allow disabling resetting the OF syscons.

For PCI<->PCI bridges, #address-cells may be 3.

Make RTAS calls, which call setfault() to recover from machine checks,
preserve any existing fault buffer.

badaddr() is used only in the grackle PCI driver, so move its definition
there. Clean up a spurious setfault() declaration as well.

This [phyp_console] driver doesn't need the /options node, so don't check
for it.

Use the Open Firmware-based CPU frequency determination as a generic
fallback if we can't measure CPU frequency. This is also useful on a
variety of embedded systems using FDT.


# 266005 14-May-2014 ian

MFC r258259, r258798, r259010

Unify handling of illegal instruction faults between AIM and Book-E.

Make uart_cpu_powerpc work on both FDT and OFW systems.

Fix debug printfs in FPU_EMU to compile on powerpc64 and enable it for
powerpc64.


# 262042 17-Feb-2014 avg

MFC r257417: Remove references to an unused fasttrap probe hook


# 260670 15-Jan-2014 jhibbits

MFC r256543,r259245,r259421,r259668,r259674

r256543:

Add fasttrap for PowerPC. This is the last piece of the DTrace/ppc puzzle.
It's incomplete, it doesn't contain full instruction emulation, but it should be
sufficient for most cases.

r259245,r259421: (FBT)

FBT now does work fully on PowerPC.

Save r3 before using it for the trap check, else we end up saving the new r3,
containing the trap instruction encoding (0x7c810808), and restoring it back
with the frame on return. This caused it to panic on my ppc32 machine.

r259668,r259674:
Fix a typo in the FBT code.


# 260667 15-Jan-2014 jhibbits

MFC r256542,r256581

Move the PMC handling to the first level interrupt handler where it belongs.
Also add the pmc_hook use, to handle callchain tracing.