1. 24 Jun, 2021 10 commits
  2. 23 Jun, 2021 3 commits
  3. 22 Jun, 2021 14 commits
  4. 21 Jun, 2021 7 commits
    • Yifan Zhang's avatar
      Revert "drm/amdgpu/gfx9: fix the doorbell missing when in CGPG issue." · ee5468b9
      Yifan Zhang authored
      This reverts commit 4cbbe348.
      
      Reason for revert: side effect of enlarging CP_MEC_DOORBELL_RANGE may
      cause some APUs fail to enter gfxoff in certain user cases.
      Signed-off-by: default avatarYifan Zhang <yifan1.zhang@amd.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      ee5468b9
    • Yifan Zhang's avatar
      Revert "drm/amdgpu/gfx10: enlarge CP_MEC_DOORBELL_RANGE_UPPER to cover full doorbell." · baacf52a
      Yifan Zhang authored
      This reverts commit 1c0b0efd.
      
      Reason for revert: Side effect of enlarging CP_MEC_DOORBELL_RANGE may
      cause some APUs fail to enter gfxoff in certain user cases.
      Signed-off-by: default avatarYifan Zhang <yifan1.zhang@amd.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      baacf52a
    • Michel Dänzer's avatar
      drm/amdgpu: Call drm_framebuffer_init last for framebuffer init · 4c6a2318
      Michel Dänzer authored
      Once drm_framebuffer_init has returned 0, the framebuffer is hooked up
      to the reference counting machinery and can no longer be destroyed with
      a simple kfree. Therefore, it must be called last.
      
      If drm_framebuffer_init returns 0 but its caller then returns non-0,
      there will likely be memory corruption fireworks down the road.
      The following lead me to this fix:
      
      [   12.891228] kernel BUG at lib/list_debug.c:25!
      [...]
      [   12.891263] RIP: 0010:__list_add_valid+0x4b/0x70
      [...]
      [   12.891324] Call Trace:
      [   12.891330]  drm_framebuffer_init+0xb5/0x100 [drm]
      [   12.891378]  amdgpu_display_gem_fb_verify_and_init+0x47/0x120 [amdgpu]
      [   12.891592]  ? amdgpu_display_user_framebuffer_create+0x10d/0x1f0 [amdgpu]
      [   12.891794]  amdgpu_display_user_framebuffer_create+0x126/0x1f0 [amdgpu]
      [   12.891995]  drm_internal_framebuffer_create+0x378/0x3f0 [drm]
      [   12.892036]  ? drm_internal_framebuffer_create+0x3f0/0x3f0 [drm]
      [   12.892075]  drm_mode_addfb2+0x34/0xd0 [drm]
      [   12.892115]  ? drm_internal_framebuffer_create+0x3f0/0x3f0 [drm]
      [   12.892153]  drm_ioctl_kernel+0xe2/0x150 [drm]
      [   12.892193]  drm_ioctl+0x3da/0x460 [drm]
      [   12.892232]  ? drm_internal_framebuffer_create+0x3f0/0x3f0 [drm]
      [   12.892274]  amdgpu_drm_ioctl+0x43/0x80 [amdgpu]
      [   12.892475]  __se_sys_ioctl+0x72/0xc0
      [   12.892483]  do_syscall_64+0x33/0x40
      [   12.892491]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Fixes: f258907f "drm/amdgpu: Verify bo size can fit framebuffer size on init."
      Signed-off-by: default avatarMichel Dänzer <mdaenzer@redhat.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      4c6a2318
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm · a96bfed6
      Linus Torvalds authored
      Pull ARM fix from Russell King:
      
       - fix gcc 10 compiler regression with cpu_init()
      
      * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 9081/1: fix gcc-10 thumb2-kernel regression
      a96bfed6
    • Desmond Cheong Zhi Xi's avatar
      drm: add a locked version of drm_is_current_master · 1815d9c8
      Desmond Cheong Zhi Xi authored
      While checking the master status of the DRM file in
      drm_is_current_master(), the device's master mutex should be
      held. Without the mutex, the pointer fpriv->master may be freed
      concurrently by another process calling drm_setmaster_ioctl(). This
      could lead to use-after-free errors when the pointer is subsequently
      dereferenced in drm_lease_owner().
      
      The callers of drm_is_current_master() from drm_auth.c hold the
      device's master mutex, but external callers do not. Hence, we implement
      drm_is_current_master_locked() to be used within drm_auth.c, and
      modify drm_is_current_master() to grab the device's master mutex
      before checking the master status.
      Reported-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDesmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
      Reviewed-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210620110327.4964-2-desmondcheongzx@gmail.com
      1815d9c8
    • Peter Zijlstra's avatar
      objtool/x86: Ignore __x86_indirect_alt_* symbols · 31197d3a
      Peter Zijlstra authored
      Because the __x86_indirect_alt* symbols are just that, objtool will
      try and validate them as regular symbols, instead of the alternative
      replacements that they are.
      
      This goes sideways for FRAME_POINTER=y builds; which generate a fair
      amount of warnings.
      
      Fixes: 9bc0bb50 ("objtool/x86: Rewrite retpoline thunk calls")
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/YNCgxwLBiK9wclYJ@hirez.programming.kicks-ass.net
      31197d3a
    • Bumyong Lee's avatar
      swiotlb: manipulate orig_addr when tlb_addr has offset · 5f89468e
      Bumyong Lee authored
      in case of driver wants to sync part of ranges with offset,
      swiotlb_tbl_sync_single() copies from orig_addr base to tlb_addr with
      offset and ends up with data mismatch.
      
      It was removed from
      "swiotlb: don't modify orig_addr in swiotlb_tbl_sync_single",
      but said logic has to be added back in.
      
      From Linus's email:
      "That commit which the removed the offset calculation entirely, because the old
      
              (unsigned long)tlb_addr & (IO_TLB_SIZE - 1)
      
      was wrong, but instead of removing it, I think it should have just
      fixed it to be
      
              (tlb_addr - mem->start) & (IO_TLB_SIZE - 1);
      
      instead. That way the slot offset always matches the slot index calculation."
      
      (Unfortunatly that broke NVMe).
      
      The use-case that drivers are hitting is as follow:
      
      1. Get dma_addr_t from dma_map_single()
      
      dma_addr_t tlb_addr = dma_map_single(dev, vaddr, vsize, DMA_TO_DEVICE);
      
          |<---------------vsize------------->|
          +-----------------------------------+
          |                                   | original buffer
          +-----------------------------------+
        vaddr
      
       swiotlb_align_offset
           |<----->|<---------------vsize------------->|
           +-------+-----------------------------------+
           |       |                                   | swiotlb buffer
           +-------+-----------------------------------+
                tlb_addr
      
      2. Do something
      3. Sync dma_addr_t through dma_sync_single_for_device(..)
      
      dma_sync_single_for_device(dev, tlb_addr + offset, size, DMA_TO_DEVICE);
      
        Error case.
          Copy data to original buffer but it is from base addr (instead of
        base addr + offset) in original buffer:
      
       swiotlb_align_offset
           |<----->|<- offset ->|<- size ->|
           +-------+-----------------------------------+
           |       |            |##########|           | swiotlb buffer
           +-------+-----------------------------------+
                tlb_addr
      
          |<- size ->|
          +-----------------------------------+
          |##########|                        | original buffer
          +-----------------------------------+
        vaddr
      
      The fix is to copy the data to the original buffer and take into
      account the offset, like so:
      
       swiotlb_align_offset
           |<----->|<- offset ->|<- size ->|
           +-------+-----------------------------------+
           |       |            |##########|           | swiotlb buffer
           +-------+-----------------------------------+
                tlb_addr
      
          |<- offset ->|<- size ->|
          +-----------------------------------+
          |            |##########|           | original buffer
          +-----------------------------------+
        vaddr
      
      [One fix which was Linus's that made more sense to as it created a
      symmetry would break NVMe. The reason for that is the:
       unsigned int offset = (tlb_addr - mem->start) & (IO_TLB_SIZE - 1);
      
      would come up with the proper offset, but it would lose the
      alignment (which this patch contains).]
      
      Fixes: 16fc3cef ("swiotlb: don't modify orig_addr in swiotlb_tbl_sync_single")
      Signed-off-by: default avatarBumyong Lee <bumyong.lee@samsung.com>
      Signed-off-by: default avatarChanho Park <chanho61.park@samsung.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reported-by: default avatarDominique MARTINET <dominique.martinet@atmark-techno.com>
      Reported-by: default avatarHoria Geantă <horia.geanta@nxp.com>
      Tested-by: default avatarHoria Geantă <horia.geanta@nxp.com>
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      5f89468e
  5. 20 Jun, 2021 4 commits
  6. 19 Jun, 2021 2 commits
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.13-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · b84a7c28
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Fix initrd corruption caused by our recent change to use relative jump
        labels.
      
        Fix a crash using perf record on systems without a hardware PMU
        backend.
      
        Rework our 64-bit signal handling slighty to make it more closely
        match the old behaviour, after the recent change to use unsafe user
        accessors.
      
        Thanks to Anastasia Kovaleva, Athira Rajeev, Christophe Leroy, Daniel
        Axtens, Greg Kurz, and Roman Bolshakov"
      
      * tag 'powerpc-5.13-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/perf: Fix crash in perf_instruction_pointer() when ppmu is not set
        powerpc: Fix initrd corruption with relative jump labels
        powerpc/signal64: Copy siginfo before changing regs->nip
        powerpc/mem: Add back missing header to fix 'no previous prototype' error
      b84a7c28
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.13-2021-06-19' of... · 913ec3c2
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.13-2021-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix refcount usage when processing PERF_RECORD_KSYMBOL.
      
       - 'perf stat' metric group fixes.
      
       - Fix 'perf test' non-bash issue with stat bpf counters.
      
       - Update unistd, in.h and socket.h with the kernel sources, silencing
         perf build warnings.
      
      * tag 'perf-tools-fixes-for-v5.13-2021-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        tools headers UAPI: Sync linux/in.h copy with the kernel sources
        tools headers UAPI: Sync asm-generic/unistd.h with the kernel original
        perf beauty: Update copy of linux/socket.h with the kernel sources
        perf test: Fix non-bash issue with stat bpf counters
        perf machine: Fix refcount usage when processing PERF_RECORD_KSYMBOL
        perf metricgroup: Return error code from metricgroup__add_metric_sys_event_iter()
        perf metricgroup: Fix find_evsel_group() event selector
      913ec3c2