Re: [intel-sgx-kernel-dev] [PATCH v7 4/8] intel_sgx: driver for Intel Software Guard Extensions

From: Jarkko Sakkinen
Date: Thu Dec 14 2017 - 07:43:07 EST


On Fri, Dec 08, 2017 at 03:31:38PM +0000, Christopherson, Sean J wrote:
> Three VA pages in the enclave: A, B and C. Evict all pages in the
> enclave, i.e. consume all slots in A, B and C. The list can be in
> any order at this point, but for the sake of argument let's say the
> order is C->A->B, i.e. C was originally the last VA page in the list.
> Fault in page X, whose VA is in B. Evict X. This code looks at C
> and A, and finds no available slot, but continues with VA page A and
> a va_offset of PAGE_SIZE.


#PF handler moves B to the beginning of list when X if faulted so the
list would be at that point

B->C->A

And thus C would get VA slot from B.

/Jarkko