From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 569C03E0C59 for ; Fri, 10 Apr 2026 17:29:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775842189; cv=none; b=WQyg8Z4XTwtR2QXRuDl+kewO3wkQ3HwYKWJ1tlgJcB6yqhmj8PjX/zcvg3i7wHkSdF1yB7jU8SL7sh8pKhDb47dwFD1yuiTouUuCQ9ozj44ysqCxuuCYs4gr6XEAZPmZ/Ow3EStXjWZS7UhHmakMn72eZGCXYhq8n8mPShy6D50= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775842189; c=relaxed/simple; bh=68EttHSuBTvmLxeXriQ+RP7Xq9ZoI6ZUP6P0w0joG+g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TS36MnwrN/bFrrhBrn9XzZvJopDgWo9ZbROfbxGd3mKYnc13llMR/d1RG2HDk9mqO16qSAiuNUh6DJERG2VTYI+7WNm8lIaknehNbwBiRExYPV0DAtdvYGiyil0aBnCzTUgGt/ZWjkoonC1P0q1oqG41gOt6LHefHiupV1jsHWg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=VjlCxRJK; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="VjlCxRJK" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0E9E447E0; Fri, 10 Apr 2026 10:29:42 -0700 (PDT) Received: from [10.57.33.82] (unknown [10.57.33.82]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 607A53FAA1; Fri, 10 Apr 2026 10:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1775842187; bh=68EttHSuBTvmLxeXriQ+RP7Xq9ZoI6ZUP6P0w0joG+g=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=VjlCxRJKY7aIjY3zhGWk8kHsu8Z7Am58i/GeTPqDfNRaTOVzTjpboaeM0VK1SXJwj lPqv2uoe8dfTYCwVZJh9gfaWRMlM4v+qcgjwPrNLiJiZYvZhQdT56u7+YrUVbQJFfY stGX1hwafN4UUTVVYohJ0X2/jHoPBVMmBgZBAmBg= Message-ID: <57cb54cf-c5b2-4735-a104-a4821096eb0a@arm.com> Date: Fri, 10 Apr 2026 18:29:44 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] virt: arm-cca-guest: fix error check for RSI_INCOMPLETE To: Sami Mujawar , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, steven.price@arm.com, gshan@redhat.com, YeoReum.Yun@arm.com, Jagdish Gediya References: <20260410163636.259443-1-sami.mujawar@arm.com> Content-Language: en-GB From: Suzuki K Poulose In-Reply-To: <20260410163636.259443-1-sami.mujawar@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > Reported-by: Jagdish Gediya Reviewed-by: Suzuki K Poulose > --- > 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;