Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 7999edc484ca ("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>

authored by

Sami Mujawar and committed by
Catalin Marinas
e534e9d1 680b961e

+2 -1
+2 -1
drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
··· 157 157 } while (info.result == RSI_INCOMPLETE && 158 158 info.offset < RSI_GRANULE_SIZE); 159 159 160 - if (info.result != RSI_SUCCESS) { 160 + /* Break out in case of failure */ 161 + if (info.result != RSI_SUCCESS && info.result != RSI_INCOMPLETE) { 161 162 ret = -ENXIO; 162 163 token_size = 0; 163 164 goto exit_free_granule_page;