KVM: arm64: Support FFA_MEM_RECLAIM2 in host handler
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 0 repliesNew
- v2 RFC2 patches 1 replySuperseded
- v12 patches 5 repliesSuperseded
Changes in v3 from the cover letter
- Drop RFC tag now that FF-A v1.3 BET0 (DEN0140 rev K) is released
- Update specification references and links to DEN0140 rev K (1.3 BET0)
- Add benchmark numbers to the cover letter and Patch 2 commit message
- Collect Vincent's Reviewed-by on Patch 2
- Rebase on v7.4-rc1
- Link to v2: https://lore.kernel.org/r/[email protected]
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | firmware: arm_ffa: Add FFA_MEM_RECLAIM2 function IDinclude/ | +1 | 0 replies | |
| 2/2 | KVM: arm64: Support FFA_MEM_RECLAIM2 in host handlerarch/ | +126 | 0 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Vincent Donnefort |
|---|---|
| 1/2 | |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/2] KVM: arm64: Support FFA_MEM_RECLAIM2 in host handler
The Arm Firmware Framework for Arm A-profile (FF-A) v1.3 BET0 specification (DEN0140 rev K) [1] introduces the optional FFA_MEM_RECLAIM2 (0xC4000091) ABI.
Reclaiming large memory regions with the existing FFA_MEM_RECLAIM ABI can take significant time, or relies on a stateful time-slicing mechanism in the Relayer. FFA_MEM_RECLAIM2 allows an Owner to reclaim exclusive access to a subset of pages from a shared or lent memory region by passing an array of constituent memory region descriptors in its TX buffer along with a starting descriptor byte offset and initial page index. The Relayer returns the number of 4K pages reclaimed in that invocation without maintaining intermediate transaction state.
On a Pixel board (pKVM, 16K pages, EL3 SPMC), reclaiming a single 16K range drops from 1.3us to 0.7us (~45% faster) by avoiding FFA_MEM_RETRIEVE_REQ/RX_RELEASE (~0.6us), and single-call FFA_MEM_RECLAIM2 stays faster across small range counts (1.3us vs 1.9us at 16 ranges; 2 calls break even). Up to 64MiB (4096 ranges), batching 256 descriptors/call adds 15 preemption points, capping each EL2/EL3 call at ~11us while keeping total SMC time within 5%.
This series adds the FFA_MEM_RECLAIM2 function ID definition and implements host proxy support in the pKVM nVHE FF-A handler, unsharing the reclaimed pages in the host stage-2 page tables upon a successful reclaim response from EL3/SPMD.
With the FF-A v1.3 specification now at BETA (1.3 BET0), drop the RFC tag so the series can be considered for merging.
This series is based on v7.4-rc1.
Changes in v3:
- Drop RFC tag now that FF-A v1.3 BET0 (DEN0140 rev K) is released
- Update specification references and links to DEN0140 rev K (1.3 BET0)
- Add benchmark numbers to the cover letter and Patch 2 commit message
- Collect Vincent's Reviewed-by on Patch 2
- Rebase on v7.4-rc1
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Mark as RFC until the FF-A v1.3 specification reaches BETA (Sudeep)
- Rename FFA_FN64_MEM_RECLAIM2 to FFA_MEM_RECLAIM2 (sashiko)
- Check total_pages against the sum of constituent pg_cnt (Vincent)
- Simplify the flags and offset alignment checks (Vincent)
- Rebase on latest kvmarm/next
- Link to v1: https://lore.kernel.org/r/[email protected]
[1] https://support.arm.com/documentation/den0140/k
Snehal Koukuntla (2):
firmware: arm_ffa: Add FFA_MEM_RECLAIM2 function ID
KVM: arm64: Support FFA_MEM_RECLAIM2 in host handler
arch/arm64/kvm/hyp/nvhe/ffa.c | 126 ++++++++++++++++++++++++++++++++++ include/linux/arm_ffa.h | 1 + 2 files changed, 127 insertions(+)
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
Signature · 1 line
2.56.0.317.g454f8302e1-goog