1. 15 10月, 2008 11 次提交
  2. 11 9月, 2008 1 次提交
  3. 29 7月, 2008 1 次提交
  4. 27 7月, 2008 2 次提交
  5. 20 7月, 2008 9 次提交
  6. 24 6月, 2008 3 次提交
    • A
      KVM: MMU: Fix oops on guest userspace access to guest pagetable · 6bf6a953
      Avi Kivity 提交于
      KVM has a heuristic to unshadow guest pagetables when userspace accesses
      them, on the assumption that most guests do not allow userspace to access
      pagetables directly. Unfortunately, in addition to unshadowing the pagetables,
      it also oopses.
      
      This never triggers on ordinary guests since sane OSes will clear the
      pagetables before assigning them to userspace, which will trigger the flood
      heuristic, unshadowing the pagetables before the first userspace access. One
      particular guest, though (Xenner) will run the kernel in userspace, triggering
      the oops.  Since the heuristic is incorrect in this case, we can simply
      remove it.
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      6bf6a953
    • M
      KVM: MMU: large page update_pte issue with non-PAE 32-bit guests (resend) · 30945387
      Marcelo Tosatti 提交于
      kvm_mmu_pte_write() does not handle 32-bit non-PAE large page backed
      guests properly. It will instantiate two 2MB sptes pointing to the same
      physical 2MB page when a guest large pte update is trapped.
      
      Instead of duplicating code to handle this, disallow directory level
      updates to happen through kvm_mmu_pte_write(), so the two 2MB sptes
      emulating one guest 4MB pte can be correctly created by the page fault
      handling path.
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      30945387
    • M
      KVM: MMU: Fix rmap_write_protect() hugepage iteration bug · 6597ca09
      Marcelo Tosatti 提交于
      rmap_next() does not work correctly after rmap_remove(), as it expects
      the rmap chains not to change during iteration.  Fix (for now) by restarting
      iteration from the beginning.
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      6597ca09
  7. 07 6月, 2008 2 次提交
  8. 23 5月, 2008 1 次提交
  9. 04 5月, 2008 6 次提交
  10. 27 4月, 2008 4 次提交
    • M
      KVM: MMU: kvm_pv_mmu_op should not take mmap_sem · 960b3991
      Marcelo Tosatti 提交于
      kvm_pv_mmu_op should not take mmap_sem. All gfn_to_page() callers down
      in the MMU processing will take it if necessary, so as it is it can
      deadlock.
      
      Apparently a leftover from the days before slots_lock.
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      960b3991
    • A
      KVM: MMU: Don't assume struct page for x86 · 35149e21
      Anthony Liguori 提交于
      This patch introduces a gfn_to_pfn() function and corresponding functions like
      kvm_release_pfn_dirty().  Using these new functions, we can modify the x86
      MMU to no longer assume that it can always get a struct page for any given gfn.
      
      We don't want to eliminate gfn_to_page() entirely because a number of places
      assume they can do gfn_to_page() and then kmap() the results.  When we support
      IO memory, gfn_to_page() will fail for IO pages although gfn_to_pfn() will
      succeed.
      
      This does not implement support for avoiding reference counting for reserved
      RAM or for IO memory.  However, it should make those things pretty straight
      forward.
      
      Since we're only introducing new common symbols, I don't think it will break
      the non-x86 architectures but I haven't tested those.  I've tested Intel,
      AMD, NPT, and hugetlbfs with Windows and Linux guests.
      
      [avi: fix overflow when shifting left pfns by adding casts]
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      35149e21
    • M
      KVM: MMU: prepopulate guest pages after write-protecting · bed1d1df
      Marcelo Tosatti 提交于
      Zdenek reported a bug where a looping "dmsetup status" eventually hangs
      on SMP guests.
      
      The problem is that kvm_mmu_get_page() prepopulates the shadow MMU
      before write protecting the guest page tables. By doing so, it leaves a
      window open where the guest can mark a pte as present while the host has
      shadow cached such pte as "notrap". Accesses to such address will fault
      in the guest without the host having a chance to fix the situation.
      
      Fix by moving the write protection before the pte prefetch.
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      bed1d1df
    • A
      KVM: MMU: Only mark_page_accessed() if the page was accessed by the guest · fcd6dbac
      Avi Kivity 提交于
      If the accessed bit is not set, the guest has never accessed this page
      (at least through this spte), so there's no need to mark the page
      accessed.  This provides more accurate data for the eviction algortithm.
      
      Noted by Andrea Arcangeli.
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      fcd6dbac