HomeFreeBSD

amd64: in double fault handler, do not rely on sane gsbase value.

Description

amd64: in double fault handler, do not rely on sane gsbase value.

Typical reasons for doublefault faults are either kernel stack
overflow or bugs in the code that manipulates protection CPU state.
The later code is the code which often has to set up gsbase for
kernel. Switching to explicit load of GSBASE MSR in the fault handler
makes it more probable to output a useful information.

Now all IST handlers have nmi_pcpu structure on top of their stacks.

It would be even more useful to save gsbase value at the moment of the
fault. I did not this because I do not want to modify PCB layout now.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Details

Provenance
kibAuthored on Nov 20 2019, 11:12 AM
Parents
rGa4619d84614d: zpool.8: remove a paragraph about quorum disks
Branches
Unknown
Tags
Unknown

Event Timeline