summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform/ptrace
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-12-17 22:31:25 +0000
committergVisor bot <gvisor-bot@google.com>2019-12-17 22:31:25 +0000
commit10ff034b94702f317135ce51a52b3d19236f2594 (patch)
tree529a1a982fac83041c8a7d1c1d285e9ddcf3388c /pkg/sentry/platform/ptrace
parent36e9af687a610967440986bea6f3512ceb974b03 (diff)
parent91f1ac731933ac1fe0f9ef30f4c9d06fa4031021 (diff)
Merge release-20191210.0-42-g91f1ac7 (automated)
Diffstat (limited to 'pkg/sentry/platform/ptrace')
-rw-r--r--pkg/sentry/platform/ptrace/subprocess_amd64.go10
-rw-r--r--pkg/sentry/platform/ptrace/subprocess_arm64.go2
2 files changed, 10 insertions, 2 deletions
diff --git a/pkg/sentry/platform/ptrace/subprocess_amd64.go b/pkg/sentry/platform/ptrace/subprocess_amd64.go
index a55cff507..606dc2b1d 100644
--- a/pkg/sentry/platform/ptrace/subprocess_amd64.go
+++ b/pkg/sentry/platform/ptrace/subprocess_amd64.go
@@ -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)
}
diff --git a/pkg/sentry/platform/ptrace/subprocess_arm64.go b/pkg/sentry/platform/ptrace/subprocess_arm64.go
index aed34e7ee..62a686ee7 100644
--- a/pkg/sentry/platform/ptrace/subprocess_arm64.go
+++ b/pkg/sentry/platform/ptrace/subprocess_arm64.go
@@ -151,6 +151,8 @@ func patchSignalInfo(regs *syscall.PtraceRegs, signalInfo *arch.SignalInfo) {
}
// Noop on arm64.
+//
+//go:nosplit
func enableCpuidFault() {
}