diff options
author | Andrei Vagin <avagin@google.com> | 2021-10-26 13:02:29 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-26 13:04:40 -0700 |
commit | 722d7ca744db6aab442bc71bb50b64599c8fa522 (patch) | |
tree | 7d4384600fe5d69981329711e944586f31771ae5 /pkg/cpuid | |
parent | 07b22740a11632c0641657cc4dd145bd0d1e5afb (diff) |
platform/kvm: map vdso and vvar into a guest address space
Right now, each vdso call triggers vmexit. VDSO and VVAR pages are
mapped with VM_IO and get_user_pages fails for such vma-s. KVM was not
able to handle this case up to the v4.8 kernel. This problem was fixed by
add6a0cd1c5ba ("KVM: MMU: try to fix up page faults before giving up").
For some unknown reasons, it still doesn't work in case of nested
virtualization.
Before:
BenchmarkKernelVDSO-6 252519 4598 ns/op
After:
BenchmarkKernelVDSO-6 34431957 34.91 ns/op
PiperOrigin-RevId: 405715941
Diffstat (limited to 'pkg/cpuid')
-rw-r--r-- | pkg/cpuid/cpuid_x86.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/cpuid/cpuid_x86.go b/pkg/cpuid/cpuid_x86.go index 8cbcc9f61..c236b942d 100644 --- a/pkg/cpuid/cpuid_x86.go +++ b/pkg/cpuid/cpuid_x86.go @@ -81,7 +81,7 @@ const ( X86FeatureAVX X86FeatureF16C X86FeatureRDRAND - _ // ecx bit 31 is reserved. + X86FeatureHypervisor ) // Block 1 constants are all of the "basic" feature bits returned by a cpuid in |