Skip to contentSkip to conversation

docs: AM62x: Remove SW_PRNG Flag for OPTEE

PATCH In review Dhruva Gole 3 participants 9 messages Dec 1, 2023 – Dec 5, 2023

lore
Share & tools
lore
#0 lore raw

cover docs: AM62x: Remove SW_PRNG Flag for OPTEE

The CFG_WITH_SOFTWARE_PRNG option was needed once when there were some issues with system crashes/ hangs after a suspend-resume cycle. However this seems to no longer be the case with newer firmwares, and this config is not needed for basic boot support of the SoC either, hence remove it from the docs.

Cc Kamlesh <[email protected]>
Cc Vibhore Vardhan <[email protected]>
Cc Wadim Egorov <[email protected]>

Dhruva Gole (2):
doc: board: beagle: am62x_beagleplay: Delete SW_PRNG flag for OPTEE
doc: board: ti: am62x_sk: Remove SW_PRNG Flag for OPTEE

 doc/board/beagle/am62x_beagleplay.rst | 1 -
 doc/board/ti/am62x_sk.rst             | 1 -
 2 files changed, 2 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 doc: board: beagle: am62x_beagleplay: Delete SW_PRNG flag for OPTEE

Delete the flag CFG_WITH_SOFTWARE_PRNG as it's not necessary/ boot requirement for this SoC

---
 doc/board/beagle/am62x_beagleplay.rst | 1 -
 1 file changed, 1 deletion(-)
doc/board/beagle/am62x_beagleplay.rst +0 -1
index 7784e62b0b71..50d7d3c620d7 100644
@@ -63,7 +63,6 @@ Set the variables corresponding to this platform:
   # we dont use any extra TFA parameters
   unset TFA_EXTRA_ARGS
   export OPTEE_PLATFORM=k3-am62x
-  export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y"
 
 .. include::  ../ti/am62x_sk.rst
     :start-after: .. am62x_evm_rst_include_start_build_steps
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 1/2] doc: board: beagle: am62x_beagleplay: Delete SW_PRNG flag for OPTEE

Quoted 23 lines · Dhruva Gole

Delete the flag CFG_WITH_SOFTWARE_PRNG as it's not necessary/ boot requirement for this SoC

---
 doc/board/beagle/am62x_beagleplay.rst | 1 -
 1 file changed, 1 deletion(-)
doc/board/beagle/am62x_beagleplay.rst +0 -1
index 7784e62b0b71..50d7d3c620d7 100644
@@ -63,7 +63,6 @@ Set the variables corresponding to this platform:
   # we dont use any extra TFA parameters
   unset TFA_EXTRA_ARGS
   export OPTEE_PLATFORM=k3-am62x
-  export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y"
 
 .. include::  ../ti/am62x_sk.rst
     :start-after: .. am62x_evm_rst_include_start_build_steps
Signature · 1 line
2.34.1

NAK. RNG is needed to seed standard distros.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#3 lore raw

Re: [PATCH 1/2] doc: board: beagle: am62x_beagleplay: Delete SW_PRNG flag for OPTEE

Quoted 19 lines · Nishanth Menon
Quoted 18 lines · Dhruva Gole

Delete the flag CFG_WITH_SOFTWARE_PRNG as it's not necessary/ boot requirement for this SoC

---
  doc/board/beagle/am62x_beagleplay.rst | 1 -
  1 file changed, 1 deletion(-)
doc/board/beagle/am62x_beagleplay.rst +0 -1
index 7784e62b0b71..50d7d3c620d7 100644
@@ -63,7 +63,6 @@ Set the variables corresponding to this platform:
    # we dont use any extra TFA parameters
    unset TFA_EXTRA_ARGS
    export OPTEE_PLATFORM=k3-am62x
-  export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y"
 
Quoted 6 lines
Quoted 5 lines
doc/board/beagle/am62x_beagleplay.rst +0 -0
  .. include::  ../ti/am62x_sk.rst
      :start-after: .. am62x_evm_rst_include_start_build_steps
Signature · 1 line
2.34.1

NAK. RNG is needed to seed standard distros.

You have this backwards, setting WITH_SOFTWARE_PRNG=y forces the SW RNG, disabling the HW RNG. Without this line the HW RNG is the default.

Andrew

#4 lore raw

Re: [PATCH 1/2] doc: board: beagle: am62x_beagleplay: Delete SW_PRNG flag for OPTEE

Quoted 26 lines · Andrew Davis
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Dhruva Gole

Delete the flag CFG_WITH_SOFTWARE_PRNG as it's not necessary/ boot requirement for this SoC

---
  doc/board/beagle/am62x_beagleplay.rst | 1 -
  1 file changed, 1 deletion(-)
Quoted 15 lines
Quoted 14 lines
doc/board/beagle/am62x_beagleplay.rst +0 -1
index 7784e62b0b71..50d7d3c620d7 100644
@@ -63,7 +63,6 @@ Set the variables corresponding to this platform:
    # we dont use any extra TFA parameters
    unset TFA_EXTRA_ARGS
    export OPTEE_PLATFORM=k3-am62x
-  export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y"
  .. include::  ../ti/am62x_sk.rst
      :start-after: .. am62x_evm_rst_include_start_build_steps
Signature · 1 line
2.34.1

NAK. RNG is needed to seed standard distros.

Quoted 2 lines

You have this backwards, setting WITH_SOFTWARE_PRNG=y forces the SW RNG, disabling the HW RNG. Without this line the HW RNG is the default.

That is not the rationale with which the series was posted. I would prefer we use HW RNG by default. but as I understand there are a bunch of f/w bugs preventing us from doing so. if they are resolved, then the commit message argument should be that the bugs are fixed, so we can easily use then with f/w version x.y.z onwards.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#5 lore raw

Re: [PATCH 1/2] doc: board: beagle: am62x_beagleplay: Delete SW_PRNG flag for OPTEE

Quoted 31 lines · Nishanth Menon
Quoted 26 lines · Andrew Davis
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Dhruva Gole

Delete the flag CFG_WITH_SOFTWARE_PRNG as it's not necessary/ boot requirement for this SoC

---
   doc/board/beagle/am62x_beagleplay.rst | 1 -
   1 file changed, 1 deletion(-)
Quoted 15 lines
Quoted 14 lines
doc/board/beagle/am62x_beagleplay.rst +0 -1
index 7784e62b0b71..50d7d3c620d7 100644
@@ -63,7 +63,6 @@ Set the variables corresponding to this platform:
     # we dont use any extra TFA parameters
     unset TFA_EXTRA_ARGS
     export OPTEE_PLATFORM=k3-am62x
-  export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y"
   .. include::  ../ti/am62x_sk.rst
       :start-after: .. am62x_evm_rst_include_start_build_steps
Signature · 1 line
2.34.1

NAK. RNG is needed to seed standard distros.

Quoted 2 lines

You have this backwards, setting WITH_SOFTWARE_PRNG=y forces the SW RNG, disabling the HW RNG. Without this line the HW RNG is the default.

Quoted 5 lines

That is not the rationale with which the series was posted. I would prefer we use HW RNG by default. but as I understand there are a bunch of f/w bugs preventing us from doing so. if they are resolved, then the commit message argument should be that the bugs are fixed, so we can easily use then with f/w version x.y.z onwards.

There was a single FW bug that caused suspend/resume to fail when OP-TEE was using the HW RNG. The HW RNG always worked, disabling it was a hack that allowed us to still demo suspend/resume, not sure how that ended up in this documentation.

The fact we disabled a security feature to workaround a non-security bug shows a lack of good judgement on our part IMHO. Product security is our top priority.

Andrew

#6 lore raw

PATCH 2/2 doc: board: ti: am62x_sk: Remove SW_PRNG Flag for OPTEE

In reply to Dhruva Gole

This SoC does not require the CFG_WITH_SOFTWARE_PRNG option to be set for base boot support, hence remove it from the U-Boot documentation.

---
 doc/board/ti/am62x_sk.rst | 1 -
 1 file changed, 1 deletion(-)
doc/board/ti/am62x_sk.rst +0 -1
index b12dc85f06b5..35d759e806c0 100644
@@ -84,7 +84,6 @@ Set the variables corresponding to this platform:
   # we dont use any extra TFA parameters
   unset TFA_EXTRA_ARGS
   export OPTEE_PLATFORM=k3-am62x
-  export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y"
 
 .. am62x_evm_rst_include_start_build_steps
 
Signature · 1 line
2.34.1
#7 lore raw
In reply to Dhruva Gole
Quoted 10 lines · Dhruva Gole

The CFG_WITH_SOFTWARE_PRNG option was needed once when there were some issues with system crashes/ hangs after a suspend-resume cycle. However this seems to no longer be the case with newer firmwares, and this config is not needed for basic boot support of the SoC either, hence remove it from the docs.

Cc Kamlesh <[email protected]>
Cc Vibhore Vardhan <[email protected]>
Cc Wadim Egorov <[email protected]>
Quoted 8 lines

Dhruva Gole (2):
doc: board: beagle: am62x_beagleplay: Delete SW_PRNG flag for OPTEE
doc: board: ti: am62x_sk: Remove SW_PRNG Flag for OPTEE

 doc/board/beagle/am62x_beagleplay.rst | 1 -
 doc/board/ti/am62x_sk.rst             | 1 -
 2 files changed, 2 deletions(-)

NAK to the series. RNG seed is needed for KASLR. either enable h/w RNG or at least enable S/W RNG in OPTEE.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#8 lore raw

Hi Nishanth,

Quoted 14 lines · Nishanth Menon
Quoted 13 lines · Dhruva Gole

The CFG_WITH_SOFTWARE_PRNG option was needed once when there were some issues with system crashes/ hangs after a suspend-resume cycle. However this seems to no longer be the case with newer firmwares, and this config is not needed for basic boot support of the SoC either, hence remove it from the docs.

Cc: Kamlesh <[email protected]>
Cc: Vibhore Vardhan <[email protected]>
Cc: Wadim Egorov <[email protected] >>
Dhruva Gole (2):
doc: board: beagle: am62x_beagleplay: Delete SW_PRNG flag for OPTEE
doc: board: ti: am62x_sk: Remove SW_PRNG Flag for OPTEE

Quoted 6 lines
Quoted 4 lines
  doc/board/beagle/am62x_beagleplay.rst | 1 -
  doc/board/ti/am62x_sk.rst             | 1 -
  2 files changed, 2 deletions(-)

NAK to the series. RNG seed is needed for KASLR. either enable h/w RNG

@Wadim: Please take note and ignore my previous suggestion to you to remove this line, keep this line as is.

Quoted 2 lines

or at least enable S/W RNG in OPTEE.

Agreed, I will send a patch to use HWRNG later on then. For now let's just keep the PRNG enabled in these docs.

Signature · 2 lines
Thanks and Regards,
Dhruva Gole