linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH 0/6] Enable CAAM on i.MX7s fix TrustZone issues
@ 2018-01-24 14:50 Bryan O'Donoghue
  2018-01-24 14:50 ` [RESEND PATCH 1/6] crypto: caam: Fix null dereference at error path Bryan O'Donoghue
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Bryan O'Donoghue @ 2018-01-24 14:50 UTC (permalink / raw)
  To: horia.geanta, aymen.sghaier, linux-crypto, linux-kernel
  Cc: fabio.estevam, peng.fan, herbert, davem, lukas.auer, rui.silva,
	ryan.harkin, Bryan O'Donoghue

This patch-set enables CAAM on the i.MX7s and fixes a number of issues
identified with the CAAM driver and hardware when TrustZone mode is
enabled.

The first block of patches are simple bug-fixes, followed by a second block
of patches which are simple enabling patches for the i.MX7Solo - note we
aren't enabling for the i.MX7Dual since we don't have hardware to test that
out but it should be a 1:1 mapping for others to enable when appropriate.

The final block in this series implements a fix for using the CAAM when
OPTEE/TrustZone is enabled. The various details are logged in these
threads.

Link: https://github.com/OP-TEE/optee_os/issues/1408
Link: https://tinyurl.com/yam5gv9a
Link: https://patchwork.ozlabs.org/cover/865042

In simple terms, when TrustZone is active the first page of the CAAM
becomes inaccessible to Linux as it has a special 'TZ bit' associated with
it that software cannot toggle or even view AFAIK.

The patches here then

1. Detect when TrustZone is active
2. Detect if u-boot (or OPTEE) has already initialized the RNG

and loads the CAAM driver in a different way - skipping over the RNG
initialization that Linux now no-longer has permissions to carry out.

Should #1 be true but #2 not be true, driver loading stops (and Rui's patch
for the NULL pointer dereference fixes a cash on this path). If #2 is true
but #1 is not then it's a NOP as Linux has full permission to rewrite the
deco registers in the first page of CAAM registers.

Finally then if #1 and #2 are true, the fixes here allow the CAAM to come
up and for the RNG to be useable again.

Bryan O'Donoghue (3):
  crypto: caam: Fix endless loop when RNG is already initialized
  crypto: caam: add logic to detect when running under TrustZone
  crypto: caam: detect RNG init when TrustZone is active

Rui Miguel Silva (3):
  crypto: caam: Fix null dereference at error path
  ARM: dts: imx7s: add CAAM device node
  imx7d: add CAAM clocks

 arch/arm/boot/dts/imx7s.dtsi            | 26 +++++++++++++++++++
 drivers/clk/imx/clk-imx7d.c             |  3 +++
 drivers/crypto/caam/ctrl.c              | 45 ++++++++++++++++++++++++++++++---
 drivers/crypto/caam/intern.h            |  1 +
 include/dt-bindings/clock/imx7d-clock.h |  5 +++-
 5 files changed, 76 insertions(+), 4 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2018-01-28 15:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-24 14:50 [RESEND PATCH 0/6] Enable CAAM on i.MX7s fix TrustZone issues Bryan O'Donoghue
2018-01-24 14:50 ` [RESEND PATCH 1/6] crypto: caam: Fix null dereference at error path Bryan O'Donoghue
2018-01-25 17:09   ` Horia Geantă
2018-01-24 14:50 ` [RESEND PATCH 2/6] crypto: caam: Fix endless loop when RNG is already initialized Bryan O'Donoghue
2018-01-24 14:50 ` [RESEND PATCH 3/6] ARM: dts: imx7s: add CAAM device node Bryan O'Donoghue
2018-01-24 18:12   ` Auer, Lukas
2018-01-24 22:48     ` Bryan O'Donoghue
2018-01-24 22:56       ` Bryan O'Donoghue
2018-01-27 15:49   ` kbuild test robot
2018-01-28 15:42     ` Rui Miguel Silva
2018-01-24 14:50 ` [RESEND PATCH 4/6] imx7d: add CAAM clocks Bryan O'Donoghue
2018-01-24 14:50 ` [RESEND PATCH 5/6] crypto: caam: add logic to detect when running under TrustZone Bryan O'Donoghue
2018-01-24 14:50 ` [RESEND PATCH 6/6] crypto: caam: detect RNG init when TrustZone is active Bryan O'Donoghue
2018-01-25 13:20   ` Auer, Lukas
2018-01-25 17:54     ` Bryan O'Donoghue
2018-01-25 17:50 ` [RESEND PATCH 0/6] Enable CAAM on i.MX7s fix TrustZone issues Horia Geantă
2018-01-26  1:06   ` Bryan O'Donoghue

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).