Re: [RFC PATCH v3 04/27] x86/sgx: Wipe out EREMOVE from sgx_free_epc_page()

Dave Hansen
2021-02-02T19:06:04Z

On 1/26/21 5:25 PM, Kai Huang wrote:
>>
>>> + * responsibility to make sure that the page is in uninitialized state In other
>> Period after "state", please.
>>
>>> + * words, do EREMOVE, EWB or whatever operation is necessary before calling
>>> + * this function.
>>> */
>> OK, so if you're going to say "the caller must put the page in
>> uninitialized state", let's also add a comment to the place that *DO*
>> that, like the shiny new sgx_reset_epc_page().
> Hi Dave,
>
> Sorry I am a little bit confused here. Do you mean we should add a comment in
> sgx_reset_epc_page() to say, for instance: sgx_free_epc_page() requires the EPC
> page already been EREMOVE'd?

Yes. You need to place a comment in sgx_reset_epc_page() which says
something like:

/* Place the page in uninitialized state: */