From: Jordan Crouse <jcrouse@codeaurora.org>
To: linux-arm-msm@vger.kernel.org
Cc: Akhil P Oommen <akhilpo@codeaurora.org>,
AngeloGioacchino Del Regno <kholk11@gmail.com>,
Ben Dooks <ben.dooks@codethink.co.uk>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Brian Masney <masneyb@onstation.org>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
Emil Velikov <emil.velikov@collabora.com>,
Eric Anholt <eric@anholt.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jonathan Marek <jonathan@marek.ca>,
Rob Clark <robdclark@gmail.com>, Sam Ravnborg <sam@ravnborg.org>,
Sean Paul <sean@poorly.run>,
Sharat Masetty <smasetty@codeaurora.org>,
Shawn Guo <shawn.guo@linaro.org>,
Wambui Karuga <wambui.karugax@gmail.com>,
dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 0/4] drm/msm: Protect the RPTR shadow
Date: Thu, 3 Sep 2020 20:03:09 -0600 [thread overview]
Message-ID: <20200904020313.1810988-1-jcrouse@codeaurora.org> (raw)
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
next reply other threads:[~2020-09-04 2:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 2:03 Jordan Crouse [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200904020313.1810988-1-jcrouse@codeaurora.org \
--to=jcrouse@codeaurora.org \
--cc=airlied@linux.ie \
--cc=akhilpo@codeaurora.org \
--cc=ben.dooks@codethink.co.uk \
--cc=bjorn.andersson@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.velikov@collabora.com \
--cc=eric@anholt.net \
--cc=freedreno@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=jonathan@marek.ca \
--cc=kholk11@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masneyb@onstation.org \
--cc=robdclark@gmail.com \
--cc=sam@ravnborg.org \
--cc=sean@poorly.run \
--cc=shawn.guo@linaro.org \
--cc=smasetty@codeaurora.org \
--cc=wambui.karugax@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).