From ed02ac4f668ec41063cd51cbbd451baba9e9a6e7 Mon Sep 17 00:00:00 2001 From: Adin Scannell Date: Mon, 14 May 2018 21:39:31 -0700 Subject: [PATCH] Disable INVPCID check; it's not used. PiperOrigin-RevId: 196615029 Change-Id: Idfa383a9aee6a9397167a4231ce99d0b0e5b9912 --- pkg/sentry/platform/kvm/kvm_amd64_unsafe.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pkg/sentry/platform/kvm/kvm_amd64_unsafe.go b/pkg/sentry/platform/kvm/kvm_amd64_unsafe.go index 389412d87..834e6b96d 100644 --- a/pkg/sentry/platform/kvm/kvm_amd64_unsafe.go +++ b/pkg/sentry/platform/kvm/kvm_amd64_unsafe.go @@ -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