Commit 8b37bbc7 authored by Per Larsen's avatar Per Larsen Committed by Per Larsen (xWF)
Browse files

BACKPORT: FROMGIT: KVM: arm64: Use SMCCC 1.2 for FF-A initialization and in host handler



SMCCC 1.1 and prior allows four registers to be sent back as a result
of an FF-A interface. SMCCC 1.2 increases the number of results that can
be sent back to 8 and 16 for 32-bit and 64-bit SMC/HVCs respectively.

FF-A 1.0 references SMCCC 1.2 (reference [4] on page xi) and FF-A 1.2
explicitly requires SMCCC 1.2 so it should be safe to use this version
unconditionally. Moreover, it is simpler to implement FF-A features
without having to worry about compatibility with SMCCC 1.1 and older.

SMCCC 1.2 requires that SMC32/HVC32 from aarch64 mode preserves x8-x30
but given that there is no reliable way to distinguish 32-bit/64-bit
calls, we assume SMC64 unconditionally. This has the benefit of being
consistent with the handling of calls that are passed through, i.e., not
proxied. (A cleaner solution will become available in FF-A 1.3.)

Update the FF-A initialization and host handler code to use SMCCC 1.2.

Signed-off-by: default avatarPer Larsen <perlarsen@google.com>
Acked-by: default avatarWill Deacon <will@kernel.org>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>

Bug: 280886201
(cherry picked from commit 6f4c348b
    https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git

 next)
[perlarsen@: Extended the SMCCC 1.2 update to Android-only code
(including kvm_guest_ffa_handler, do_ffa_direct_msg, and
kvm_host_ffa_signal_availability) to use struct arm_smccc_1_2_regs,
mirroring the changes in the upstream patch.]
Change-Id: Id5a0d77657d521c6275b01f25e0d299dd191cd30
Signed-off-by: default avatarPer Larsen <perlarsen@google.com>
parent 4408d5c6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment