summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform/kvm/context.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-10-13 17:47:03 +0000
committergVisor bot <gvisor-bot@google.com>2020-10-13 17:47:03 +0000
commit5846738e7bdaf2d9638d51a330d9306f856af6d7 (patch)
tree2f1954f35b4570fe0e15ab24184d0fbb5c5a0745 /pkg/sentry/platform/kvm/context.go
parent8694dbd042715b995a21594c364171b7988d7e94 (diff)
parentd9b32efb306444440daa89a79e4d85516ff8f340 (diff)
Merge release-20200928.0-101-gd9b32efb3 (automated)
Diffstat (limited to 'pkg/sentry/platform/kvm/context.go')
-rw-r--r--pkg/sentry/platform/kvm/context.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/platform/kvm/context.go b/pkg/sentry/platform/kvm/context.go
index 6e6b76416..17268d127 100644
--- a/pkg/sentry/platform/kvm/context.go
+++ b/pkg/sentry/platform/kvm/context.go
@@ -15,6 +15,8 @@
package kvm
import (
+ "sync/atomic"
+
pkgcontext "gvisor.dev/gvisor/pkg/context"
"gvisor.dev/gvisor/pkg/sentry/arch"
"gvisor.dev/gvisor/pkg/sentry/platform"
@@ -75,6 +77,9 @@ func (c *context) Switch(ctx pkgcontext.Context, mm platform.MemoryManager, ac a
// Clear the address space.
cpu.active.set(nil)
+ // Increment the number of user exits.
+ atomic.AddUint64(&cpu.userExits, 1)
+
// Release resources.
c.machine.Put(cpu)