lkml.org 
[lkml]   [2017]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 06/11] intel_sgx: driver for Intel Software Guard Extensions
On Sun, Nov 26, 2017 at 07:33:56PM +0200, Jarkko Sakkinen wrote:
> > +struct sgx_encl_page {
> > + unsigned long addr;
> > + unsigned int flags;
> > + void *epc_page;
> > + struct sgx_va_page *va_page;
> > + unsigned int va_offset;
> > + struct list_head list;
> > +};
>
> This can be without major streches hoops packed way more. There are 12
> bits free for use in the addr field. I can use low three bits for flags
> and upper nine bits for va_offset.
>
> I think I can also quite easily union epc_page and va_page fields.
>
> With these changes the struct would shrink to:
>
> struct sgx_encl_page {
> unsigned long addr;
> union {
> void *epc_page;
> struct sgx_va_page *va_page;
> };
> struct list_head list;
> };

Once I started to thinking more about this I realized that this can be
shrunk even further. I can drop the list field and use a tag for loaded
pages in the radix tree where these are stored. The end result would be

struct sgx_encl_page {
unsigned long addr;
union {
void *epc_page;
struct sgx_va_page *va_page;
};
};

/Jarkko

\
 
 \ /
  Last update: 2017-11-26 19:47    [W:0.130 / U:1.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site