summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform
diff options
context:
space:
mode:
authorShiruRen <renshiru2000@gmail.com>2018-08-06 10:10:25 -0700
committerShentubot <shentubot@google.com>2018-08-06 10:11:56 -0700
commit3ec074897f9d0aba21bc9f41be18f52bfbeb599e (patch)
tree70ed3af086a393a38752ac293730b060c55fde00 /pkg/sentry/platform
parent56fa562dda18260440726a37ea467f6eb6aa6c12 (diff)
Fix a bug in PCIDs.Assign
Store the new assigned pcid in p.cache[pt]. Signed-off-by: ShiruRen <renshiru2000@gmail.com> Change-Id: I4aee4e06559e429fb5e90cb9fe28b36139e3b4b6 PiperOrigin-RevId: 207563833
Diffstat (limited to 'pkg/sentry/platform')
-rw-r--r--pkg/sentry/platform/ring0/pagetables/pcids_x86.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/sentry/platform/ring0/pagetables/pcids_x86.go b/pkg/sentry/platform/ring0/pagetables/pcids_x86.go
index 4296371e8..227cf7aad 100644
--- a/pkg/sentry/platform/ring0/pagetables/pcids_x86.go
+++ b/pkg/sentry/platform/ring0/pagetables/pcids_x86.go
@@ -64,6 +64,7 @@ func (p *PCIDs) Assign(pt *PageTables) (uint16, bool) {
if len(p.avail) > 0 {
pcid := p.avail[len(p.avail)-1]
p.avail = p.avail[:len(p.avail)-1]
+ p.cache[pt] = pcid
// We need to flush because while this is in the available
// pool, it may have been used previously.