aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev_api.c
diff options
context:
space:
mode:
authorWill Deacon <[email protected]>2025-04-07 15:27:55 +0000
committerOliver Upton <[email protected]>2025-04-07 22:03:34 +0000
commita344e258acb0a7f0e7ed10a795c52d1baf705164 (patch)
tree0bca97123700c546ea2ebbf066d2979b0f9b8a01 /net/core/dev_api.c
parentKVM: arm64: selftests: Explicitly set the page attrs to Inner-Shareable (diff)
downloadkernel-a344e258acb0a7f0e7ed10a795c52d1baf705164.tar.gz
kernel-a344e258acb0a7f0e7ed10a795c52d1baf705164.zip
KVM: arm64: Use acquire/release to communicate FF-A version negotiation
The pKVM FF-A proxy rejects FF-A requests other than FFA_VERSION until version negotiation is complete, which is signalled by setting the global 'has_version_negotiated' variable. To avoid excessive locking, this variable is checked directly from kvm_host_ffa_handler() in response to an FF-A call, but this can race against another CPU performing the negotiation and potentially lead to reading a torn value (incredibly unlikely for a 'bool') or problematic re-ordering of the accesses to 'has_version_negotiated' and 'hyp_ffa_version' whereby a stale version number could be read by __do_ffa_mem_xfer(). Use acquire/release primitives when writing 'has_version_negotiated' with the version lock held and when reading without the lock held. Cc: Sebastian Ene <[email protected]> Cc: Sudeep Holla <[email protected]> Cc: Quentin Perret <[email protected]> Cc: Oliver Upton <[email protected]> Cc: Marc Zyngier <[email protected]> Fixes: c9c012625e12 ("KVM: arm64: Trap FFA_VERSION host call in pKVM") Signed-off-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
Diffstat (limited to 'net/core/dev_api.c')
0 files changed, 0 insertions, 0 deletions