1. 24 Oct, 2022 28 commits
  2. 21 Oct, 2022 3 commits
  3. 18 Oct, 2022 5 commits
  4. 17 Oct, 2022 4 commits
    • Hamza Mahfooz's avatar
      drm/amd/display: add an ASSERT() to irq service functions · b3372fa7
      Hamza Mahfooz authored
      Currently, if we encounter unimplemented functions, it is difficult to
      tell what caused them just by looking at dmesg and that is compounded by
      the fact that it is often hard to reproduce said issues, for instance we
      have had reports of this condition being triggered when removing a
      secondary display that is setup in mirror mode and is connected using
      usb-c. So, to have access to more detailed debugging information, add an
      ASSERT() to dal_irq_service_ack() and dal_irq_service_set() that only
      triggers when we encounter an unimplemented function.
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      b3372fa7
    • Nathan Chancellor's avatar
      drm/amdkfd: Fix type of reset_type parameter in hqd_destroy() callback · e299b00a
      Nathan Chancellor authored
      When booting a kernel compiled with CONFIG_CFI_CLANG on a machine with
      an RX 6700 XT, there is a CFI failure in kfd_destroy_mqd_cp():
      
        [   12.894543] CFI failure at kfd_destroy_mqd_cp+0x2a/0x40 [amdgpu] (target: hqd_destroy_v10_3+0x0/0x260 [amdgpu]; expected type: 0x8594d794)
      
      Clang's kernel Control Flow Integrity (kCFI) makes sure that all
      indirect call targets have a type that exactly matches the function
      pointer prototype. In this case, hqd_destroy()'s third parameter,
      reset_type, should have a type of 'uint32_t' but every implementation of
      this callback has a third parameter type of 'enum kfd_preempt_type'.
      
      Update the function pointer prototype to match reality so that there is
      no more CFI violation.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/1738Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      e299b00a
    • Fabio M. De Francesco's avatar
      drm/amd/amdgpu: Replace kmap() with kmap_local_page() · a2c55426
      Fabio M. De Francesco authored
      kmap() is being deprecated in favor of kmap_local_page().
      
      There are two main problems with kmap(): (1) It comes with an overhead as
      mapping space is restricted and protected by a global lock for
      synchronization and (2) it also requires global TLB invalidation when the
      kmap’s pool wraps and it might block when the mapping space is fully
      utilized until a slot becomes available.
      
      With kmap_local_page() the mappings are per thread, CPU local, can take
      page faults, and can be called from any context (including interrupts).
      It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore,
      the tasks can be preempted and, when they are scheduled to run again, the
      kernel virtual addresses are restored and are still valid.
      
      Since its use in amdgpu/amdgpu_ttm.c is safe, it should be preferred.
      
      Therefore, replace kmap() with kmap_local_page() in amdgpu/amdgpu_ttm.c.
      Suggested-by: default avatarIra Weiny <ira.weiny@intel.com>
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarFabio M. De Francesco <fmdefrancesco@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      a2c55426
    • Fabio M. De Francesco's avatar
      drm/radeon: Replace kmap() with kmap_local_page() · cdabbde1
      Fabio M. De Francesco authored
      The use of kmap() is being deprecated in favor of kmap_local_page().
      
      There are two main problems with kmap(): (1) It comes with an overhead as
      the mapping space is restricted and protected by a global lock for
      synchronization and (2) it also requires global TLB invalidation when the
      kmap’s pool wraps and it might block when the mapping space is fully
      utilized until a slot becomes available.
      
      With kmap_local_page() the mappings are per thread, CPU local, can take
      page faults, and can be called from any context (including interrupts).
      It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore,
      the tasks can be preempted and, when they are scheduled to run again, the
      kernel virtual addresses are restored and still valid.
      
      Therefore, replace kmap() with kmap_local_page() in radeon_ttm_gtt_read().
      
      Cc: "Venkataramanan, Anirudh" <anirudh.venkataramanan@intel.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Suggested-by: default avatarIra Weiny <ira.weiny@intel.com>
      Signed-off-by: default avatarFabio M. De Francesco <fmdefrancesco@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      cdabbde1