[PATCH v2 3/3] firmware: arm_ffa: Share FF-A version negotiation

Sudeep Holla sudeep.holla at kernel.org
Fri Nov 13 01:38:30 PST 2026


On Thu, Nov 12, 2026 at 08:30:47AM -0800, Jamie Nguyen wrote:
> On Thu, Nov 12, 2026 at 11:14:08AM +0000, Sudeep Holla wrote:
> [...]
> > +	guard(mutex)(&ffa_version_lock);
> > +	if (!ffa_version) {
> > +		invoke(&args, &res);
> 
> Can this scenario happen?
> 
> 1) pKVM is enabled but not yet initialised, and offset-2 AML runs
>    (e.g. during the initial ACPI scan), so ffh.c gets here first and
>    negotiates directly with EL3.
> 2) The result is cached.
> 3) Once pKVM is up, ffa_version_check() gets the cached version and
>    never sends FFA_VERSION through the proxy.
> 
> If so, then I think kvm_host_ffa_handler() would reject the transport's
> calls, since has_version_negotiated is never set.
> 
> Should we decline here instead, without caching, while
> is_protected_kvm_enabled() && !is_pkvm_initialized(), like ffa_probe()
> already does?

Yes, I had already considered this, which is why I kept it separate.
That way, we can easily drop this part if we want core ACPI FFH Offset2
OpRegion support without the extra complexity. Even with this added
logic, we are still constrained by the requirement that the bootloader
(such as UEFI) negotiates the exact same version. Given that this
doesn't provide a complete or reliable fix, I'm inclined to drop it
rather than introduce complexity that only gives the appearance of
solving the problem.

-- 
Regards,
Sudeep



More information about the linux-arm-kernel mailing list