Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Mark enableCpuidFault nosplit
Browse files Browse the repository at this point in the history
This is called after fork, so it must be nosplit.

Updates google#1408

PiperOrigin-RevId: 286053054
  • Loading branch information
prattmic authored and gvisor-bot committed Dec 17, 2019
1 parent 3ab90ec commit 91f1ac7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/sentry/platform/ptrace/subprocess_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/sentry/platform/ptrace/subprocess_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ func patchSignalInfo(regs *syscall.PtraceRegs, signalInfo *arch.SignalInfo) {
}

// Noop on arm64.
//
//go:nosplit
func enableCpuidFault() {
}

Expand Down

0 comments on commit 91f1ac7

Please sign in to comment.