]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Add list of potentially locally cached vcpus
authorAvi Kivity <avi@qumranet.com>
Tue, 13 May 2008 13:22:47 +0000 (16:22 +0300)
committerAvi Kivity <avi@qumranet.com>
Sun, 20 Jul 2008 09:42:24 +0000 (12:42 +0300)
commit60ec5afd4253dec72001fbd5f50ec8aa7deed03e
tree0347cb99587feedb4dfd4520bde416a0bf8ceca9
parent55818be1cd25e8aeb3bb34a43b6e5fcd8f360fe5
KVM: VMX: Add list of potentially locally cached vcpus

VMX hardware can cache the contents of a vcpu's vmcs.  This cache needs
to be flushed when migrating a vcpu to another cpu, or (which is the case
that interests us here) when disabling hardware virtualization on a cpu.

The current implementation of decaching iterates over the list of all vcpus,
picks the ones that are potentially cached on the cpu that is being offlined,
and flushes the cache.  The problem is that it uses mutex_trylock() to gain
exclusive access to the vcpu, which fires off a (benign) warning about using
the mutex in an interrupt context.

To avoid this, and to make things generally nicer, add a new per-cpu list
of potentially cached vcus.  This makes the decaching code much simpler.  The
list is vmx-specific since other hardware doesn't have this issue.

[andrea: fix crash on suspend/resume]

Signed-off-by: Andrea Arcangeli <andrea@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c