1. 11 4月, 2013 3 次提交
    • S
      kvm/ppc/e500: eliminate tlb_refs · 4d2be6f7
      Scott Wood 提交于
      Commit 523f0e54 ("KVM: PPC: E500:
      Explicitly mark shadow maps invalid") began using E500_TLB_VALID
      for guest TLB1 entries, and skipping invalidations if it's not set.
      
      However, when E500_TLB_VALID was set for such entries, it was on a
      fake local ref, and so the invalidations never happen.  gtlb_privs
      is documented as being only for guest TLB0, though we already violate
      that with E500_TLB_BITMAP.
      
      Now that we have MMU notifiers, and thus don't need to actually
      retain a reference to the mapped pages, get rid of tlb_refs, and
      use gtlb_privs for E500_TLB_VALID in TLB1.
      
      Since we can have more than one host TLB entry for a given tlbe_ref,
      be careful not to clear existing flags that are relevant to other
      host TLB entries when preparing a new host TLB entry.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      4d2be6f7
    • S
      kvm/ppc/e500: g2h_tlb1_map: clear old bit before setting new bit · 66a5fecd
      Scott Wood 提交于
      It's possible that we're using the same host TLB1 slot to map (a
      presumably different portion of) the same guest TLB1 entry.  Clear
      the bit in the map before setting it, so that if the esels are the same
      the bit will remain set.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      66a5fecd
    • S
      kvm/ppc/e500: h2g_tlb1_rmap: esel 0 is valid · 6b2ba1a9
      Scott Wood 提交于
      Add one to esel values in h2g_tlb1_rmap, so that "no mapping" can be
      distinguished from "esel 0".  Note that we're not saved by the fact
      that host esel 0 is reserved for non-KVM use, because KVM host esel
      numbering is not the raw host numbering (see to_htlb1_esel).
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      6b2ba1a9
  2. 25 1月, 2013 3 次提交
    • A
      KVM: PPC: E500: Make clear_tlb_refs and clear_tlb1_bitmap static · 483ba97c
      Alexander Graf 提交于
      Host shadow TLB flushing is logic that the guest TLB code should have
      no insight about. Declare the internal clear_tlb_refs and clear_tlb1_bitmap
      functions static to the host TLB handling file.
      
      Instead of these, we can use the already exported kvmppc_core_flush_tlb().
      This gives us a common API across the board to say "please flush any
      pending host shadow translation".
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      483ba97c
    • A
      KVM: PPC: e500: Implement TLB1-in-TLB0 mapping · c015c62b
      Alexander Graf 提交于
      When a host mapping fault happens in a guest TLB1 entry today, we
      map the translated guest entry into the host's TLB1.
      
      This isn't particularly clever when the guest is mapped by normal 4k
      pages, since these would be a lot better to put into TLB0 instead.
      
      This patch adds the required logic to map 4k TLB1 shadow maps into
      the host's TLB0.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      c015c62b
    • A
      KVM: PPC: E500: Split host and guest MMU parts · b71c9e2f
      Alexander Graf 提交于
      This patch splits the file e500_tlb.c into e500_mmu.c (guest TLB handling)
      and e500_mmu_host.c (host TLB handling).
      
      The main benefit of this split is readability and maintainability. It's
      just a lot harder to write dirty code :).
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b71c9e2f