Skip to content

Commit e534e9d

Browse files
samimujawarctmarinas
authored andcommitted
virt: arm-cca-guest: fix error check for RSI_INCOMPLETE
The RSI interface can return RSI_INCOMPLETE when a report spans multiple granules. This is an expected condition and should not be treated as a fatal error. Currently, arm_cca_report_new() checks for `info.result != RSI_SUCCESS` and bails out, which incorrectly flags RSI_INCOMPLETE as a failure. Fix the check to only break out on results other than RSI_SUCCESS or RSI_INCOMPLETE. This ensures partial reports are handled correctly and avoids spurious -ENXIO errors when generating attestation reports. Fixes: 7999edc ("virt: arm-cca-guest: TSM_REPORT support for realms") Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reported-by: Jagdish Gediya <Jagdish.Gediya@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Gavin Shan <gshan@redhat.com> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 680b961 commit e534e9d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/virt/coco/arm-cca-guest/arm-cca-guest.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ static int arm_cca_report_new(struct tsm_report *report, void *data)
157157
} while (info.result == RSI_INCOMPLETE &&
158158
info.offset < RSI_GRANULE_SIZE);
159159

160-
if (info.result != RSI_SUCCESS) {
160+
/* Break out in case of failure */
161+
if (info.result != RSI_SUCCESS && info.result != RSI_INCOMPLETE) {
161162
ret = -ENXIO;
162163
token_size = 0;
163164
goto exit_free_granule_page;

0 commit comments

Comments
 (0)