android_kernel_samsung_msm8976/arch/x86/kvm
Andy Lutomirski 747a43ad69 x86,kvm,vmx: Preserve CR4 across VM entry
commit d974baa398f34393db76be45f7d4d04fbdbb4a0a upstream.

CR4 isn't constant; at least the TSD and PCE bits can vary.

TBH, treating CR0 and CR3 as constant scares me a bit, too, but it looks
like it's correct.

This adds a branch and a read from cr4 to each vm entry.  Because it is
extremely likely that consecutive entries into the same vcpu will have
the same host cr4 value, this fixes up the vmcs instead of restoring cr4
after the fact.  A subsequent patch will add a kernel-wide cr4 shadow,
reducing the overhead in the common case to just two memory reads and a
branch.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Petr Matousek <pmatouse@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[wangkai: Backport to 3.10: adjust context]
Signed-off-by: Wang Kai <morgan.wang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-11 14:48:18 +08:00
..
cpuid.c
cpuid.h Merge tag 'kvm-3.8-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2012-12-13 15:31:08 -08:00
emulate.c KVM: x86: Emulator fixes for eip canonical checks on near branches 2014-11-14 08:47:57 -08:00
i8254.c KVM: x86: Improve thread safety in pit 2014-11-14 08:47:56 -08:00
i8254.h
i8259.c KVM: inject ExtINT interrupt before APIC interrupts 2012-12-13 23:05:21 -02:00
irq.c KVM: nVMX: fix "acknowledge interrupt on exit" when APICv is in use 2014-09-05 16:28:35 -07:00
irq.h
Kconfig kvm: Allow build-time configuration of KVM device assignment 2013-04-28 12:58:56 +03:00
kvm_cache_regs.h
lapic.c KVM: nVMX: fix "acknowledge interrupt on exit" when APICv is in use 2014-09-05 16:28:35 -07:00
lapic.h KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368) 2013-12-20 07:45:07 -08:00
Makefile kvm: Allow build-time configuration of KVM device assignment 2013-04-28 12:58:56 +03:00
mmu.c kvm: x86: fix stale mmio cache bug 2014-10-30 09:35:09 -07:00
mmu.h KVM: MMU: Rename kvm_mmu_free_some_pages() to make_mmu_pages_available() 2013-03-21 19:45:01 -03:00
mmu_audit.c
mmutrace.h KVM: mmu: remove unused trace event 2013-01-07 19:54:50 -02:00
paging_tmpl.h KVM: x86: handle invalid root_hpa everywhere 2014-03-31 09:58:14 -07:00
pmu.c pmu: prepare for migration support 2013-04-02 17:42:44 +03:00
svm.c kvm: x86: don't kill guest on unknown exit reason 2014-11-14 08:47:56 -08:00
trace.h
tss.h
vmx.c x86,kvm,vmx: Preserve CR4 across VM entry 2015-02-11 14:48:18 +08:00
x86.c KVM: x86: Don't report guest userspace emulation error to userspace 2014-11-21 09:22:55 -08:00
x86.h kvm: x86: fix stale mmio cache bug 2014-10-30 09:35:09 -07:00