1. 18 5月, 2012 3 次提交
  2. 17 5月, 2012 4 次提交
    • A
      KVM: Fix mmu_reload() clash with nested vmx event injection · d8368af8
      Avi Kivity 提交于
      Currently the inject_pending_event() call during guest entry happens after
      kvm_mmu_reload().  This is for historical reasons - we used to
      inject_pending_event() in atomic context, while kvm_mmu_reload() needs task
      context.
      
      A problem is that nested vmx can cause the mmu context to be reset, if event
      injection is intercepted and causes a #VMEXIT instead (the #VMEXIT resets
      CR0/CR3/CR4).  If this happens, we end up with invalid root_hpa, and since
      kvm_mmu_reload() has already run, no one will fix it and we end up entering
      the guest this way.
      
      Fix by reordering event injection to be before kvm_mmu_reload().  Use
      ->cancel_injection() to undo if kvm_mmu_reload() fails.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=42980Reported-by: NLuke-Jr <luke-jr+linuxbugs@utopios.org>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      d8368af8
    • A
      KVM: MMU: Don't use RCU for lockless shadow walking · c142786c
      Avi Kivity 提交于
      Using RCU for lockless shadow walking can increase the amount of memory
      in use by the system, since RCU grace periods are unpredictable.  We also
      have an unconditional write to a shared variable (reader_counter), which
      isn't good for scaling.
      
      Replace that with a scheme similar to x86's get_user_pages_fast(): disable
      interrupts during lockless shadow walk to force the freer
      (kvm_mmu_commit_zap_page()) to wait for the TLB flush IPI to find the
      processor with interrupts enabled.
      
      We also add a new vcpu->mode, READING_SHADOW_PAGE_TABLES, to prevent
      kvm_flush_remote_tlbs() from avoiding the IPI.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      c142786c
    • A
      KVM: VMX: Optimize %ds, %es reload · b2da15ac
      Avi Kivity 提交于
      On x86_64, we can defer %ds and %es reload to the heavyweight context switch,
      since nothing in the lightweight paths uses the host %ds or %es (they are
      ignored by the processor).  Furthermore we can avoid the load if the segments
      are null, by letting the hardware load the null segments for us.  This is the
      expected case.
      
      On i386, we could avoid the reload entirely, since the entry.S paths take care
      of reload, except for the SYSEXIT path which leaves %ds and %es set to __USER_DS.
      So we set them to the same values as well.
      
      Saves about 70 cycles out of 1600 (around 4%; noisy measurements).
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      b2da15ac
    • A
      KVM: VMX: Fix %ds/%es clobber · 512d5649
      Avi Kivity 提交于
      The vmx exit code unconditionally restores %ds and %es to __USER_DS.  This
      can override the user's values, since %ds and %es are not saved and restored
      in x86_64 syscalls.  In practice, this isn't dangerous since nobody uses
      segment registers in long mode, least of all programs that use KVM.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      512d5649
  3. 14 5月, 2012 2 次提交
  4. 08 5月, 2012 1 次提交
    • A
      Merge branch 'for-upstream' of git://github.com/agraf/linux-2.6 into next · f2569053
      Avi Kivity 提交于
      PPC updates from Alex.
      
      * 'for-upstream' of git://github.com/agraf/linux-2.6:
        KVM: PPC: Emulator: clean up SPR reads and writes
        KVM: PPC: Emulator: clean up instruction parsing
        kvm/powerpc: Add new ioctl to retreive server MMU infos
        kvm/book3s: Make kernel emulated H_PUT_TCE available for "PR" KVM
        KVM: PPC: bookehv: Fix r8/r13 storing in level exception handler
        KVM: PPC: Book3S: Enable IRQs during exit handling
        KVM: PPC: Fix PR KVM on POWER7 bare metal
        KVM: PPC: Fix stbux emulation
        KVM: PPC: bookehv: Use lwz/stw instead of PPC_LL/PPC_STL for 32-bit fields
        KVM: PPC: Book3S: PR: No isync in slbie path
        KVM: PPC: Book3S: PR: Optimize entry path
        KVM: PPC: booke(hv): Fix save/restore of guest accessible SPRGs.
        KVM: PPC: Restrict PPC_[L|ST]D macro to asm code
        KVM: PPC: bookehv: Use a Macro for saving/restoring guest registers to/from their 64 bit copies.
        KVM: PPC: Use clockevent multiplier and shifter for decrementer
        KVM: Use minimum and maximum address mapped by TLB1
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      f2569053
  5. 06 5月, 2012 20 次提交
  6. 03 5月, 2012 1 次提交
  7. 01 5月, 2012 3 次提交
  8. 28 4月, 2012 3 次提交
  9. 24 4月, 2012 3 次提交