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 <[email protected]> Reported-by: Jagdish Gediya <[email protected]> Reviewed-by: Steven Price <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Reviewed-by: Suzuki K Poulose <[email protected]> Reviewed-by: Yeoreum Yun <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
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)