Commit a3ef4dee authored by Vincent Donnefort's avatar Vincent Donnefort Committed by Will Deacon
Browse files

FROMGIT: KVM: arm64: FFA: Release hyp rx buffer

According to the FF-A spec (Buffer states and ownership), after a
producer has written into a buffer, it is "full" and now owned by the
consumer. The producer won't be able to use that buffer, until the
consumer hands it over with an invocation such as RX_RELEASE.

It is clear in the following paragraph (Transfer of buffer ownership),
that MEM_RETRIEVE_RESP is transferring the ownership from producer (in
our case SPM) to consumer (hypervisor). RX_RELEASE is therefore
mandatory here.

It is less clear though what is happening with MEM_FRAG_TX. But this
invocation, as a response to MEM_FRAG_RX writes into the same hypervisor
RX buffer (see paragraph "Transmission of transaction descriptor in
fragments"). Also this is matching the TF-A implementation where the RX
buffer is marked "full" during a MEM_FRAG_RX.

Release the RX hypervisor buffer in those two cases. This will unblock
later invocations using this buffer which would otherwise fail.
(RETRIEVE_REQ, MEM_FRAG_RX and PARTITION_INFO_GET).

Bug: 338340229
Bug: 278749606
(cherry picked from commit d66e50be
 https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git

 )
Change-Id: I6dd3a9f48d0426f4425bafc4f633289461e8347c
Signed-off-by: default avatarVincent Donnefort <vdonnefort@google.com>
Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20240611175317.1220842-1-vdonnefort@google.com


Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarSebastian Ene <sebastianene@google.com>
Cc: stable@vger.kernel.org
parent 84a1dab4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment