Mark enableCpuidFault nosplit

This is called after fork, so it must be nosplit.

Updates #1408

PiperOrigin-RevId: 286053054
This commit is contained in:
Michael Pratt
2019-12-17 14:18:54 -08:00
committed by gVisor bot
parent 3ab90ecf25
commit 91f1ac7319
2 changed files with 10 additions and 2 deletions
@@ -167,8 +167,14 @@ func patchSignalInfo(regs *syscall.PtraceRegs, signalInfo *arch.SignalInfo) {
}
}
// enableCpuidFault enable cpuid-faulting; this may fail on older kernels or hardware,
// so we just disregard the result. Host CPUID will be enabled.
// enableCpuidFault enables cpuid-faulting.
//
// This may fail on older kernels or hardware, so we just disregard the result.
// Host CPUID will be enabled.
//
// This is safe to call in an afterFork context.
//
//go:nosplit
func enableCpuidFault() {
syscall.RawSyscall6(syscall.SYS_ARCH_PRCTL, linux.ARCH_SET_CPUID, 0, 0, 0, 0, 0)
}
@@ -151,6 +151,8 @@ func patchSignalInfo(regs *syscall.PtraceRegs, signalInfo *arch.SignalInfo) {
}
// Noop on arm64.
//
//go:nosplit
func enableCpuidFault() {
}