lkml.org 
[lkml]   [2011]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 9/9] KVM, VMX: Check for automatic switch msr table overflow.
    Date

    Signed-off-by: Gleb Natapov <gleb@redhat.com>
    ---
    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 fef7bd9..afa9aa3 100644
    --- a/arch/x86/kvm/vmx.c
    +++ b/arch/x86/kvm/vmx.c
    @@ -1281,7 +1281,11 @@ static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr,
    if (m->guest[i].index == msr)
    break;

    - if (i == m->nr) {
    + if (i == NR_AUTOLOAD_MSRS) {
    + printk_once(KERN_WARNING"Not enough mst switch entries. "
    + "Can't add msr %x\n", msr);
    + return;
    + } else if (i == m->nr) {
    ++m->nr;
    vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, m->nr);
    vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, m->nr);
    --
    1.7.5.3


    \
     
     \ /
      Last update: 2011-10-03 15:53    [W:0.027 / U:30.032 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site