diff options
author | Gleb Natapov <gleb@redhat.com> | 2011-10-05 08:01:24 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-11-17 09:28:09 -0500 |
commit | e7fc6f93b4242b2b566f0070709e27257d6da8a2 (patch) | |
tree | e247492b58735178c1c82eb8c23e86b0472077c0 /arch/x86 | |
parent | d7cd97964ba6d70c558348bd2c87290dce885583 (diff) |
KVM: VMX: Check for automatic switch msr table overflow
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/vmx.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 98f4b0bcc660..579a0b51696a 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -1280,7 +1280,11 @@ static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr, | |||
1280 | if (m->guest[i].index == msr) | 1280 | if (m->guest[i].index == msr) |
1281 | break; | 1281 | break; |
1282 | 1282 | ||
1283 | if (i == m->nr) { | 1283 | if (i == NR_AUTOLOAD_MSRS) { |
1284 | printk_once(KERN_WARNING"Not enough mst switch entries. " | ||
1285 | "Can't add msr %x\n", msr); | ||
1286 | return; | ||
1287 | } else if (i == m->nr) { | ||
1284 | ++m->nr; | 1288 | ++m->nr; |
1285 | vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, m->nr); | 1289 | vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, m->nr); |
1286 | vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, m->nr); | 1290 | vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, m->nr); |