• Andre Przywara's avatar
    plat/arm: juno: Refactor juno_getentropy() · 543f0d8b
    Andre Przywara authored
    
    
    Currently we use the Juno's TRNG hardware entropy source to initialise
    the stack canary. The current function allows to fill a buffer of any
    size, but we will actually only ever request 16 bytes, as this is what
    the hardware implements. Out of this, we only need at most 64 bits for
    the canary.
    
    In preparation for the introduction of the SMCCC TRNG interface, we
    can simplify this Juno specific interface by making it compatible with
    the generic one: We just deliver 64 bits of entropy on each call.
    This reduces the complexity of the code. As the raw entropy register
    readouts seem to be biased, it makes sense to do some conditioning
    inside the juno_getentropy() function already.
    Also initialise the TRNG hardware, if not already done.
    
    Change-Id: I11b977ddc5417d52ac38709a9a7b61499eee481f
    Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
    543f0d8b
juno_stack_protector.c 560 Bytes