Re: [PATCH v3 0/8] arm64: Unmap FF-A lent memory from direct map

From: Vincent Donnefort

Date: Wed Dec 02 2026 - 04:59:40 EST


On Fri, Nov 27, 2026 at 05:44:23PM +0530, Sumit Garg wrote:
> > This series is a follow-up to the discussion that has started here [1].
> >
> > When memory is lent to the Secure world via FF-A, CPU speculative
> > accesses from NS to the lent pages can still occur as long as it retains
> > a cacheable mapping to it.
>
> One thing I forgot to ask during last review, in case of hypervisor
> support like pKVM how are going to handle unmap from stage-2? As I can
> see from code pKVM doesn't support FF-A lend calls to unmap pages from
> stage-2.
>
> I think overall it is important to unmap memory from both stage-1 and
> stage-2 to avoid CPU speculative accesses from NS when memory is lent to
> the secure world. Is there plan to support stage-2 unmapping like in
> case of pKVM?

Unmapping from the stage-1 is enough to protect against speculative accesses.

Android's pKVM has an option to unmap from the stage-2 and getting rid of it was
the original intent for this series. The hypervisor really isn't the place to do
the unmapping. The platform should be able to work without the need for a
hypervisor.

--
Vincent

>
> -Sumit
>
> --
> Sumit Garg <sumit.garg@xxxxxxxxxx>