mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE
@ 2026-04-10 16:36 Sami Mujawar
  2026-04-10 16:51 ` Yeoreum Yun
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sami Mujawar @ 2026-04-10 16:36 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: catalin.marinas, will, steven.price, suzuki.poulose,
	sami.mujawar, gshan, YeoReum.Yun, Jagdish Gediya

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>
---
 drivers/virt/coco/arm-cca-guest/arm-cca-guest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c b/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
index 0c9ea24a200c..66d00b6ceb78 100644
--- a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
+++ b/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
@@ -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;
-- 
SAMI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE
  2026-04-10 16:36 [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE Sami Mujawar
@ 2026-04-10 16:51 ` Yeoreum Yun
  2026-04-10 17:29 ` Suzuki K Poulose
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Yeoreum Yun @ 2026-04-10 16:51 UTC (permalink / raw)
  To: Sami Mujawar
  Cc: linux-arm-kernel, linux-kernel, catalin.marinas, will,
	steven.price, suzuki.poulose, gshan, Jagdish Gediya

Look good to me.

Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>

On Fri, Apr 10, 2026 at 05:36:36PM +0100, Sami Mujawar wrote:
> 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>
> ---
>  drivers/virt/coco/arm-cca-guest/arm-cca-guest.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c b/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
> index 0c9ea24a200c..66d00b6ceb78 100644
> --- a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
> +++ b/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
> @@ -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;
> --
> SAMI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}
>

--
Sincerely,
Yeoreum Yun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE
  2026-04-10 16:36 [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE Sami Mujawar
  2026-04-10 16:51 ` Yeoreum Yun
@ 2026-04-10 17:29 ` Suzuki K Poulose
  2026-04-10 20:50 ` Gavin Shan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Suzuki K Poulose @ 2026-04-10 17:29 UTC (permalink / raw)
  To: Sami Mujawar, linux-arm-kernel, linux-kernel
  Cc: catalin.marinas, will, steven.price, gshan, YeoReum.Yun, Jagdish Gediya

On 10/04/2026 17:36, Sami Mujawar wrote:
> 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: Suzuki K Poulose <suzuki.poulose@arm.com>


> ---
>   drivers/virt/coco/arm-cca-guest/arm-cca-guest.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c b/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
> index 0c9ea24a200c..66d00b6ceb78 100644
> --- a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
> +++ b/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
> @@ -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;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE
  2026-04-10 16:36 [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE Sami Mujawar
  2026-04-10 16:51 ` Yeoreum Yun
  2026-04-10 17:29 ` Suzuki K Poulose
@ 2026-04-10 20:50 ` Gavin Shan
  2026-04-13  8:30 ` Steven Price
  2026-04-14 19:22 ` Catalin Marinas
  4 siblings, 0 replies; 6+ messages in thread
From: Gavin Shan @ 2026-04-10 20:50 UTC (permalink / raw)
  To: Sami Mujawar, linux-arm-kernel, linux-kernel
  Cc: catalin.marinas, will, steven.price, suzuki.poulose, YeoReum.Yun,
	Jagdish Gediya

On 4/11/26 2:36 AM, Sami Mujawar wrote:
> 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>
> ---
>   drivers/virt/coco/arm-cca-guest/arm-cca-guest.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 

Reviewed-by: Gavin Shan <gshan@redhat.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE
  2026-04-10 16:36 [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE Sami Mujawar
                   ` (2 preceding siblings ...)
  2026-04-10 20:50 ` Gavin Shan
@ 2026-04-13  8:30 ` Steven Price
  2026-04-14 19:22 ` Catalin Marinas
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Price @ 2026-04-13  8:30 UTC (permalink / raw)
  To: Sami Mujawar, linux-arm-kernel, linux-kernel
  Cc: catalin.marinas, will, suzuki.poulose, gshan, YeoReum.Yun,
	Jagdish Gediya

On 10/04/2026 17:36, Sami Mujawar wrote:
> 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>

> ---
>  drivers/virt/coco/arm-cca-guest/arm-cca-guest.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c b/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
> index 0c9ea24a200c..66d00b6ceb78 100644
> --- a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
> +++ b/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
> @@ -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;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE
  2026-04-10 16:36 [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE Sami Mujawar
                   ` (3 preceding siblings ...)
  2026-04-13  8:30 ` Steven Price
@ 2026-04-14 19:22 ` Catalin Marinas
  4 siblings, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2026-04-14 19:22 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, Sami Mujawar
  Cc: Will Deacon, steven.price, suzuki.poulose, gshan, YeoReum.Yun,
	Jagdish Gediya

On Fri, 10 Apr 2026 17:36:36 +0100, Sami Mujawar wrote:
> 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.
> 
> [...]

Applied to arm64 (for-next/misc), thanks!

[1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE
      https://git.kernel.org/arm64/c/e534e9d13d0b

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-14 19:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-10 16:36 [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE Sami Mujawar
2026-04-10 16:51 ` Yeoreum Yun
2026-04-10 17:29 ` Suzuki K Poulose
2026-04-10 20:50 ` Gavin Shan
2026-04-13  8:30 ` Steven Price
2026-04-14 19:22 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®