Re: [PATCH v13 07/13] x86/sgx: Add data structures for tracking the EPC pages

From: Jarkko Sakkinen
Date: Fri Aug 31 2018 - 07:10:46 EST


On Tue, Aug 28, 2018 at 09:53:11AM -0700, Dave Hansen wrote:
> >>> extern bool sgx_enabled;
> >>> extern bool sgx_lc_enabled;
> >>> +extern struct sgx_epc_bank sgx_epc_banks[SGX_MAX_EPC_BANKS];
> >>> +
> >>> +/*
> >>> + * enum sgx_epc_page_desc - defines bits and masks for an EPC page's desc
> >>
> >> Why are you bothering packing these bits? This seems a rather
> >> convoluted way to store two integers.
> >
> > To keep struct sgx_epc_page 64 bytes.
>
> It's a list_head and a ulong now. That doesn't add up to 64.

Ah, there used to be one more variable in it.

> If you properly describe the bounds and limits of banks we can possibly
> help you find a nice solution. As it stands, they are totally opaque
> and we have no idea what is going on.

Great, I see what I can do. I understand now better what you are looking
for. Thanks Dave.

/Jarkko