lkml.org 
[lkml]   [2007]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 17/55] KVM: MMU: Topup the mmu memory preallocation caches before emulating an insn
    Date
    Emulation may cause a shadow pte to be instantiated, which requires
    memory resources. Make sure the caches are filled to avoid an oops.

    Signed-off-by: Avi Kivity <avi@qumranet.com>
    ---
    drivers/kvm/mmu.c | 4 ++++
    1 files changed, 4 insertions(+), 0 deletions(-)

    diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
    index ace3cb8..9be54a5 100644
    --- a/drivers/kvm/mmu.c
    +++ b/drivers/kvm/mmu.c
    @@ -1362,6 +1362,10 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code)
    goto out;
    }

    + r = mmu_topup_memory_caches(vcpu);
    + if (r)
    + goto out;
    +
    er = emulate_instruction(vcpu, vcpu->run, cr2, error_code, 0);
    mutex_unlock(&vcpu->kvm->lock);

    --
    1.5.3.7


    \
     
     \ /
      Last update: 2007-12-26 12:13    [W:0.019 / U:33.328 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site