HomeFreeBSD

amd64: only set PCB_FULL_IRET pcb flag when #gp or similar exception comes

Description

amd64: only set PCB_FULL_IRET pcb flag when #gp or similar exception comes
from usermode.

If CPU supports RDFSBASE, the flag also means that userspace fsbase
and gsbase are already written into pcb, which might be not true when
we handle #gp from kernel.

The offender is rdmsr_safe(), and the visible result is corrupted
userspace TLS base.

Reported by: pstef
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Details

Provenance
kibAuthored on
Parents
rS354695: MFC r354420:
Branches
Unknown
Tags
Unknown