lib: sbi: fwft: check feature value to be exactly 1 or 0
authorClément Léger <cleger@rivosinc.com>
Mon, 24 Jun 2024 10:29:08 +0000 (12:29 +0200)
committerAnup Patel <anup@brainfault.org>
Wed, 26 Jun 2024 12:43:54 +0000 (18:13 +0530)
commite8717d126401435896b0e96c18e187f0b2431d5e
tree4ed9906fc450a96bc58dde690166a2e1434a27aa
parentecef14d5732f837cbfa4a8cefa8fed7953e7abfb
lib: sbi: fwft: check feature value to be exactly 1 or 0

As stated by the spec and pointed out by Andrew Jones, the value passed
for MISALIGNED_EXC_DELEG and PTE_AD_HW_UPDATING should be either 0 or 1.
Add check for these values and return SBI_EINVAL if not.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_fwft.c