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
This commit is contained in:
ShiruRen
2018-08-06 10:11:56 -07:00
committed by Shentubot
parent 56fa562dda
commit 3ec074897f
@@ -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.