summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform/kvm/machine.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-10-12 12:34:43 -0700
committergVisor bot <gvisor-bot@google.com>2020-10-12 12:34:43 -0700
commit93bc0777be45994c4fcd7611a743f99fe73b36fa (patch)
treef0a942f921171abc1696d5fa329d915648486a90 /pkg/sentry/platform/kvm/machine.go
parentd861cd5f14bc42b32eeac20c444a685f1d9748f7 (diff)
parentbc14050ebf408539a150b73ad98d488d2c3bd45d (diff)
Merge pull request #4072 from adamliyi:droppt_fix
PiperOrigin-RevId: 336719900
Diffstat (limited to 'pkg/sentry/platform/kvm/machine.go')
-rw-r--r--pkg/sentry/platform/kvm/machine.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/sentry/platform/kvm/machine.go b/pkg/sentry/platform/kvm/machine.go
index 75da253c5..455e2bd20 100644
--- a/pkg/sentry/platform/kvm/machine.go
+++ b/pkg/sentry/platform/kvm/machine.go
@@ -468,6 +468,19 @@ func (m *machine) newDirtySet() *dirtySet {
}
}
+// dropPageTables drops cached page table entries.
+func (m *machine) dropPageTables(pt *pagetables.PageTables) {
+ m.mu.Lock()
+ defer m.mu.Unlock()
+
+ // Clear from all PCIDs.
+ for _, c := range m.vCPUsByID {
+ if c != nil && c.PCIDs != nil {
+ c.PCIDs.Drop(pt)
+ }
+ }
+}
+
// lock marks the vCPU as in user mode.
//
// This should only be called directly when known to be safe, i.e. when