Disable INVPCID check; it's not used.

PiperOrigin-RevId: 196615029
Change-Id: Idfa383a9aee6a9397167a4231ce99d0b0e5b9912
This commit is contained in:
Adin Scannell 2018-05-14 21:39:31 -07:00 committed by Shentubot
parent 2ab754cff7
commit ed02ac4f66
1 changed files with 4 additions and 14 deletions

View File

@ -25,11 +25,10 @@ import (
)
var (
runDataSize int
hasGuestPCID bool
hasGuestINVPCID bool
pagetablesOpts pagetables.Opts
cpuidSupported = cpuidEntries{nr: _KVM_NR_CPUID_ENTRIES}
runDataSize int
hasGuestPCID bool
pagetablesOpts pagetables.Opts
cpuidSupported = cpuidEntries{nr: _KVM_NR_CPUID_ENTRIES}
)
func updateSystemValues(fd int) error {
@ -74,17 +73,8 @@ func updateSystemValues(fd int) error {
if entry.function == 1 && entry.index == 0 && entry.ecx&(1<<17) != 0 {
hasGuestPCID = true // Found matching PCID in guest feature set.
}
if entry.function == 7 && entry.index == 0 && entry.ebx&(1<<10) != 0 {
hasGuestINVPCID = true // Found matching INVPCID in guest feature set.
}
}
// A basic sanity check: ensure that we don't attempt to
// invpcid if guest PCIDs are not supported; it's not clear
// what the semantics of this would be (or why some CPU or
// hypervisor would export this particular combination).
hasGuestINVPCID = hasGuestPCID && hasGuestINVPCID
// Set the pagetables to use PCID if it's available.
pagetablesOpts.EnablePCID = hasGuestPCID