Re: [RFC PATCH 1/4] x86/sgx: Track phase and type of SGX EPC pages

From: Sakkinen, Jarkko
Date: Mon Jul 26 2021 - 21:48:46 EST


On Tue, 2021-07-13 at 16:56 +0000, Sean Christopherson wrote:
> On Tue, Jun 08, 2021, Tony Luck wrote:
> > Add a type field to struct epc_page for how an in-use page has been
> > allocated. Re-use "enum sgx_page_type" for this type, with a couple
> > of additions for s/w types.
>
> IMO, taking different actions based on the page type is flawed. Ditto for adding
> a flag to track so called "dirty" pages.

I agree with this. Let's keep microarchitecture related
structures/enums separate from "software defined" things.

If such things add up (i.e. similar additions to something
else in future), it will be both hard to maintain, and also
the subsystem will be harder to understand for potential future
contributers.

/Jarkko