1. 21 Jul, 2022 3 commits
    • Dan Williams's avatar
      cxl/core: Define a 'struct cxl_root_decoder' · 0f157c7f
      Dan Williams authored
      Previously the target routing specifics of switch decoders were factored
      out of 'struct cxl_decoder' into 'struct cxl_switch_decoder'.
      
      This patch, 2 of 3, adds a 'struct cxl_root_decoder' as a superset of a
      switch decoder that also track the associated CXL window platform
      resource.
      
      Note that the reason the resource for a given root decoder needs to be
      looked up after the fact (i.e. after cxl_parse_cfmws() and
      add_cxl_resource()) is because add_cxl_resource() may have merged CXL
      windows in order to keep them at the top of the resource tree / decode
      hierarchy.
      Co-developed-by: default avatarBen Widawsky <bwidawsk@kernel.org>
      Signed-off-by: default avatarBen Widawsky <bwidawsk@kernel.org>
      Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      Link: https://lore.kernel.org/r/165784326541.1758207.9915663937394448341.stgit@dwillia2-xfh.jf.intel.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      0f157c7f
    • Dan Williams's avatar
      cxl/acpi: Track CXL resources in iomem_resource · 974854ab
      Dan Williams authored
      Recall that CXL capable address ranges, on ACPI platforms, are published
      in the CEDT.CFMWS (CXL Early Discovery Table: CXL Fixed Memory Window
      Structures). These windows represent both the actively mapped capacity
      and the potential address space that can be dynamically assigned to a
      new CXL decode configuration (region / interleave-set).
      
      CXL endpoints like DDR DIMMs can be mapped at any physical address
      including 0 and legacy ranges.
      
      There is an expectation and requirement that the /proc/iomem interface
      and the iomem_resource tree in the kernel reflect the full set of
      platform address ranges. I.e. that every address range that platform
      firmware and bus drivers enumerate be reflected as an iomem_resource
      entry. The hard requirement to do this for CXL arises from the fact that
      facilities like CONFIG_DEVICE_PRIVATE expect to be able to treat empty
      iomem_resource ranges as free for software to use as proxy address
      space. Without CXL publishing its potential address ranges in
      iomem_resource, the CONFIG_DEVICE_PRIVATE mechanism may inadvertently
      steal capacity reserved for runtime provisioning of new CXL regions.
      
      So, iomem_resource needs to know about both active and potential CXL
      resource ranges. The active CXL resources might already be reflected in
      iomem_resource as "System RAM". insert_resource_expand_to_fit() handles
      re-parenting "System RAM" underneath a CXL window.
      
      The "_expand_to_fit()" behavior handles cases where a CXL window is not
      a strict superset of an existing entry in the iomem_resource tree. The
      "_expand_to_fit()" behavior is acceptable from the perspective of
      resource allocation. The expansion happens because a conflicting
      resource range is already populated, which means the resource boundary
      expansion does not result in any additional free CXL address space being
      made available. CXL address space allocation is always bounded by the
      orginal unexpanded address range.
      
      However, the potential for expansion does mean that something like
      walk_iomem_res_desc(IORES_DESC_CXL...) can only return fuzzy answers on
      corner case platforms that cause the resource tree to expand a CXL
      window resource over a range that is not decoded by CXL. This would be
      an odd platform configuration, but if it becomes a problem in practice
      the CXL subsytem could just publish an API that returns definitive
      answers.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Jason Gunthorpe <jgg@nvidia.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Link: https://lore.kernel.org/r/165784325943.1758207.5310344844375305118.stgit@dwillia2-xfh.jf.intel.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      974854ab
    • Dan Williams's avatar
      cxl/core: Define a 'struct cxl_switch_decoder' · e636479e
      Dan Williams authored
      Currently 'struct cxl_decoder' contains the superset of attributes
      needed for all decoder types. Before more type-specific attributes are
      added to the common definition, reorganize 'struct cxl_decoder' into type
      specific objects.
      
      This patch, the first of three, factors out a cxl_switch_decoder type.
      See the new kdoc for what a 'struct cxl_switch_decoder' represents in a
      CXL topology.
      Co-developed-by: default avatarBen Widawsky <bwidawsk@kernel.org>
      Signed-off-by: default avatarBen Widawsky <bwidawsk@kernel.org>
      Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Link: https://lore.kernel.org/r/165784325340.1758207.5064717153608954960.stgit@dwillia2-xfh.jf.intel.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      e636479e
  2. 19 Jul, 2022 7 commits
  3. 11 Jul, 2022 1 commit
  4. 10 Jul, 2022 11 commits
  5. 09 Jul, 2022 6 commits
  6. 29 Jun, 2022 2 commits
  7. 24 Jun, 2022 1 commit
  8. 21 Jun, 2022 4 commits
  9. 19 Jun, 2022 5 commits