linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/msm: Protect the RPTR shadow
@ 2020-09-04  2:03 Jordan Crouse
  2020-09-04  2:03 ` [PATCH 1/4] drm/msm: Split the a5xx preemption record Jordan Crouse
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jordan Crouse @ 2020-09-04  2:03 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: Akhil P Oommen, AngeloGioacchino Del Regno, Ben Dooks,
	Bjorn Andersson, Brian Masney, Daniel Vetter, David Airlie,
	Emil Velikov, Eric Anholt, Greg Kroah-Hartman, Jonathan Marek,
	Rob Clark, Sam Ravnborg, Sean Paul, Sharat Masetty, Shawn Guo,
	Wambui Karuga, dri-devel, freedreno, linux-kernel

On Adreno GPUs there is an option to shadow the RPTR register in GPU accessible
memory. The shadow memory allows the kernel driver to query the value of the
RPTR for each ringbuffer even if it is preempted out or if the GPU is turned off
during aggressive power management.

There are risks to using the RPTR shadow. If it is in GPU accessible memory it
could be read or written by any GPU operation. All versions of the GPU hardware
except A650 requires the shadow to be in unprivileged memory which opens it
to risk.

This series does two things. First, it marks as many buffers as possible as
privileged. For a5xx these are some preemption buffers and on a650 this includes
all global buffers (such as the ringbuffer and memstore). I've sent these
patches before but they tie in well with this series so I've included them.

Then we disable the RPTR shadow across all targets. For all targets except for
a5xx the RPTR shadow isn't needed so there isn't a loss of functionality. a5xx
does need it for preemption so that has to be temporarily disabled.

Later changes will re-enable the shadow for those targets that can safely
mitigate the risks.

Jordan Crouse (4):
  drm/msm: Split the a5xx preemption record
  drm/msm: Enable expanded apriv support for a650
  drm/msm: Disable premption on all 5xx targets
  drm/msm: Disable the RPTR shadow

 drivers/gpu/drm/msm/adreno/a2xx_gpu.c     |  5 +++++
 drivers/gpu/drm/msm/adreno/a3xx_gpu.c     | 10 +++++++++
 drivers/gpu/drm/msm/adreno/a4xx_gpu.c     | 10 +++++++++
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c     | 14 +++++++++---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.h     |  1 +
 drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 25 ++++++++++++++++-----
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 13 ++++++++++-
 drivers/gpu/drm/msm/adreno/adreno_gpu.c   | 27 ++---------------------
 drivers/gpu/drm/msm/msm_gpu.c             |  2 +-
 drivers/gpu/drm/msm/msm_gpu.h             | 11 +++++++++
 drivers/gpu/drm/msm/msm_ringbuffer.c      |  4 ++--
 11 files changed, 85 insertions(+), 37 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-08 18:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-04  2:03 [PATCH 0/4] drm/msm: Protect the RPTR shadow Jordan Crouse
2020-09-04  2:03 ` [PATCH 1/4] drm/msm: Split the a5xx preemption record Jordan Crouse
2020-09-06  3:16   ` Sasha Levin
2020-09-08 18:13     ` Jordan Crouse
2020-09-04  2:03 ` [PATCH 2/4] drm/msm: Enable expanded apriv support for a650 Jordan Crouse
2020-09-04  2:03 ` [PATCH 3/4] drm/msm: Disable preemption on all 5xx targets Jordan Crouse
2020-09-04  2:03 ` [PATCH 4/4] drm/msm: Disable the RPTR shadow Jordan Crouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).