Skip to content

Commit a2ceca7

Browse files
rivos-eblotloiclefort
authored andcommitted
[ot] hw/opentitan: ot_csrng: fix handling of flag0 multibitbool value
Non-multibitbool values should not be considered as an error. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
1 parent 6f91842 commit a2ceca7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

hw/opentitan/ot_csrng.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,7 @@ ot_csrng_handle_instantiate(OtCSRNGState *s, unsigned slot)
10291029
uint32_t command = ot_fifo32_peek(&inst->cmd_fifo);
10301030
uint32_t clen = FIELD_EX32(command, OT_CSNRG_CMD, CLEN);
10311031
bool flag0 =
1032-
ot_csrng_check_multibitboot(s, FIELD_EX32(command, OT_CSNRG_CMD, FLAG0),
1033-
ALERT_STATUS_BIT(FLAG0));
1032+
FIELD_EX32(command, OT_CSNRG_CMD, FLAG0) == OT_MULTIBITBOOL4_TRUE;
10341033

10351034
uint32_t num;
10361035
const uint32_t *buffer =
@@ -1124,8 +1123,7 @@ static OtCSRNDCmdResult ot_csrng_handle_reseed(OtCSRNGState *s, unsigned slot)
11241123

11251124
uint32_t command = ot_fifo32_peek(&inst->cmd_fifo);
11261125
bool flag0 =
1127-
ot_csrng_check_multibitboot(s, FIELD_EX32(command, OT_CSNRG_CMD, FLAG0),
1128-
ALERT_STATUS_BIT(FLAG0));
1126+
FIELD_EX32(command, OT_CSNRG_CMD, FLAG0) == OT_MULTIBITBOOL4_TRUE;
11291127

11301128
xtrace_ot_csrng_info("reseed", flag0);
11311129

0 commit comments

Comments
 (0)