Commit e534e9d1 authored by Sami Mujawar's avatar Sami Mujawar Committed by Catalin Marinas
Browse files

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: 7999edc4 ("virt: arm-cca-guest: TSM_REPORT support for realms")
Signed-off-by: default avatarSami Mujawar <sami.mujawar@arm.com>
Reported-by: default avatarJagdish Gediya <Jagdish.Gediya@arm.com>
Reviewed-by: default avatarSteven Price <steven.price@arm.com>
Reviewed-by: default avatarGavin Shan <gshan@redhat.com>
Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: default avatarYeoreum Yun <yeoreum.yun@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 680b961e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -157,7 +157,8 @@ static int arm_cca_report_new(struct tsm_report *report, void *data)
		} while (info.result == RSI_INCOMPLETE &&
			 info.offset < RSI_GRANULE_SIZE);

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