1. 31 3月, 2017 3 次提交
  2. 21 3月, 2017 4 次提交
  3. 06 3月, 2017 1 次提交
    • S
      powerpc: Update to new option-vector-5 format for CAS · 014d02cb
      Suraj Jitindar Singh 提交于
      On POWER9 the ibm,client-architecture-support (CAS) negotiation process
      has been updated to change how the host to guest negotiation is done for
      the new hash/radix mmu as well as the nest mmu, process tables and guest
      translation shootdown (GTSE).
      
      This is documented in the unreleased PAPR ACR "CAS option vector
      additions for P9".
      
      The host tells the guest which options it supports in
      ibm,arch-vec-5-platform-support. The guest then chooses a subset of these
      to request in the CAS call and these are agreed to in the
      ibm,architecture-vec-5 property of the chosen node.
      
      Thus we read ibm,arch-vec-5-platform-support and make our selection before
      calling CAS. We then parse the ibm,architecture-vec-5 property of the
      chosen node to check whether we should run as hash or radix.
      
      ibm,arch-vec-5-platform-support format:
      
      index value pairs: <index, val> ... <index, val>
      
      index: Option vector 5 byte number
      val:   Some representation of supported values
      Signed-off-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Acked-by: NPaul Mackerras <paulus@ozlabs.org>
      [mpe: Don't print about unknown options, be consistent with OV5_FEAT]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      014d02cb
  4. 03 3月, 2017 1 次提交
  5. 02 3月, 2017 4 次提交
  6. 17 2月, 2017 3 次提交
  7. 16 2月, 2017 1 次提交
    • P
      powerpc/64: Disable use of radix under a hypervisor · 3f91a89d
      Paul Mackerras 提交于
      Currently, if the kernel is running on a POWER9 processor under a
      hypervisor, it may try to use the radix MMU even though it doesn't have
      the necessary code to do so (it doesn't negotiate use of radix, and it
      doesn't do the H_REGISTER_PROC_TBL hcall).  If the hypervisor supports
      both radix and HPT, then it will set up the guest to use HPT (since the
      guest doesn't request radix in the CAS call), but if the radix feature
      bit is set in the ibm,pa-features property (which is valid, since
      ibm,pa-features is defined to represent the capabilities of the
      processor) the guest will try to use radix, resulting in a crash when
      it turns the MMU on.
      
      This makes the minimal fix for the current code, which is to disable
      radix unless we are running in hypervisor mode.
      
      Fixes: 2bfd65e4 ("powerpc/mm/radix: Add radix callbacks for early init routines")
      Cc: stable@vger.kernel.org # v4.7+
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      3f91a89d
  8. 15 2月, 2017 1 次提交
    • A
      powerpc/mm: Update PROTFAULT handling in the page fault path · 18061c17
      Aneesh Kumar K.V 提交于
      With radix, we can get page fault with DSISR_PROTFAULT value set in case of
      PROT_NONE or autonuma mapping. The PROT_NONE case in handled by the vma check
      where we consider the access bad. For autonuma we should fall through and fixup
      the access mask correctly.
      
      Without this patch we trigger the WARN_ON() on radix. This code moves that
      WARN_ON() within a radix_enabled() check. I also moved the WARN_ON() outside
      the if condition making it apply for all type of faults (exec/write/read). It
      is also conditionalized for book3s, because BOOK3E can also get a PROTFAULT to
      handle the D/I cache sync.
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      18061c17
  9. 14 2月, 2017 1 次提交
    • M
      powerpc/mm: Fix build break when CMA=n && SPAPR_TCE_IOMMU=y · a05ef161
      Michael Ellerman 提交于
      Currently the build breaks if CMA=n and SPAPR_TCE_IOMMU=y:
      
        arch/powerpc/mm/mmu_context_iommu.c: In function ‘mm_iommu_get’:
        arch/powerpc/mm/mmu_context_iommu.c:193:42: error: ‘MIGRATE_CMA’ undeclared (first use in this function)
        if (get_pageblock_migratetype(page) == MIGRATE_CMA) {
        ^~~~~~~~~~~
      
      Fix it by using the existing is_migrate_cma_page(), which evaulates to
      false when CMA=n.
      
      Fixes: 2e5bbb54 ("KVM: PPC: Book3S HV: Migrate pinned pages out of CMA")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      a05ef161
  10. 10 2月, 2017 3 次提交
  11. 09 2月, 2017 1 次提交
  12. 08 2月, 2017 1 次提交
  13. 31 1月, 2017 8 次提交
    • P
      powerpc/64: Make type of partition table flush depend on partition type · 16ed1416
      Paul Mackerras 提交于
      When changing a partition table entry on POWER9, we do a particular
      form of the tlbie instruction which flushes all TLBs and caches of
      the partition table for a given logical partition ID (LPID).
      This instruction has a field in the instruction word, labelled R
      (radix), which should be 1 if the partition was previously a radix
      partition and 0 if it was a HPT partition.  This implements that
      logic.
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      16ed1416
    • P
      powerpc/64: Export pgtable_cache and pgtable_cache_add for KVM · ba9b399a
      Paul Mackerras 提交于
      This exports the pgtable_cache array and the pgtable_cache_add
      function so that HV KVM can use them for allocating radix page
      tables for guests.
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      ba9b399a
    • P
      powerpc/64: Enable use of radix MMU under hypervisor on POWER9 · cc3d2940
      Paul Mackerras 提交于
      To use radix as a guest, we first need to tell the hypervisor via
      the ibm,client-architecture call first that we support POWER9 and
      architecture v3.00, and that we can do either radix or hash and
      that we would like to choose later using an hcall (the
      H_REGISTER_PROC_TBL hcall).
      
      Then we need to check whether the hypervisor agreed to us using
      radix.  We need to do this very early on in the kernel boot process
      before any of the MMU initialization is done.  If the hypervisor
      doesn't agree, we can't use radix and therefore clear the radix
      MMU feature bit.
      
      Later, when we have set up our process table, which points to the
      radix tree for each process, we need to install that using the
      H_REGISTER_PROC_TBL hcall.
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      cc3d2940
    • P
      powerpc/64: Don't try to use radix MMU under a hypervisor · 18569c1f
      Paul Mackerras 提交于
      Currently, if the kernel is running on a POWER9 processor under a
      hypervisor, it will try to use the radix MMU even though it doesn't have
      the necessary code to use radix under a hypervisor (it doesn't negotiate
      use of radix, and it doesn't do the H_REGISTER_PROC_TBL hcall). The
      result is that the guest kernel will crash when it tries to turn on the
      MMU.
      
      This fixes it by looking for the /chosen/ibm,architecture-vec-5
      property, and if it exists, clears the radix MMU feature bit, before we
      decide whether to initialize for radix or HPT. This property is created
      by the hypervisor as a result of the guest calling the
      ibm,client-architecture-support method to indicate its capabilities, so
      it will indicate whether the hypervisor agreed to us using radix.
      
      Systems without a hypervisor may have this property also (for example,
      skiboot creates it), so we check the HV bit in the MSR to see whether we
      are running as a guest or not. If we are in hypervisor mode, then we can
      do whatever we like including using the radix MMU.
      
      The reason for using this property is that in future, when we have
      support for using radix under a hypervisor, we will need to check this
      property to see whether the hypervisor agreed to us using radix.
      
      Fixes: 2bfd65e4 ("powerpc/mm/radix: Add radix callbacks for early init routines")
      Cc: stable@vger.kernel.org # v4.7+
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      18569c1f
    • R
      powerpc/mm: unstub radix__vmemmap_remove_mapping() · 0d0a4bc2
      Reza Arbab 提交于
      Use remove_pagetable() and friends for radix vmemmap removal.
      
      We do not require the special-case handling of vmemmap done in the x86
      versions of these functions. This is because vmemmap_free() has already
      freed the mapped pages, and calls us with an aligned address range.
      
      So, add a few failsafe WARNs, but otherwise the code to remove physical
      mappings is already sufficient for vmemmap.
      Signed-off-by: NReza Arbab <arbab@linux.vnet.ibm.com>
      Acked-by: NBalbir Singh <bsingharora@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      0d0a4bc2
    • R
      powerpc/mm: add radix__remove_section_mapping() · 4b5d62ca
      Reza Arbab 提交于
      Tear down and free the four-level page tables of physical mappings
      during memory hotremove.
      
      Borrow the basic structure of remove_pagetable() and friends from the
      identically-named x86 functions. Reduce the frequency of tlb flushes and
      page_table_lock spinlocks by only doing them in the outermost function.
      There was some question as to whether the locking is needed at all.
      Leave it for now, but we could consider dropping it.
      
      Memory must be offline to be removed, thus not in use. So there
      shouldn't be the sort of concurrent page walking activity here that
      might prompt us to use RCU.
      Signed-off-by: NReza Arbab <arbab@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      4b5d62ca
    • R
      powerpc/mm: add radix__create_section_mapping() · 6cc27341
      Reza Arbab 提交于
      Wire up memory hotplug page mapping for radix. Share the mapping
      function already used by radix_init_pgtable().
      Signed-off-by: NReza Arbab <arbab@linux.vnet.ibm.com>
      Acked-by: NBalbir Singh <bsingharora@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      6cc27341
    • R
      powerpc/mm: refactor radix physical page mapping · b5200ec9
      Reza Arbab 提交于
      Move the page mapping code in radix_init_pgtable() into a separate
      function that will also be used for memory hotplug.
      
      The current goto loop progressively decreases its mapping size as it
      covers the tail of a range whose end is unaligned. Change this to a for
      loop which can do the same for both ends of the range.
      Signed-off-by: NReza Arbab <arbab@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      b5200ec9
  14. 30 1月, 2017 4 次提交
  15. 25 1月, 2017 1 次提交
  16. 23 1月, 2017 1 次提交
  17. 18 1月, 2017 2 次提交