lkml.org 
[lkml]   [2018]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v13 07/13] x86/sgx: Add data structures for tracking the EPC pages
On Mon, Sep 03, 2018 at 05:41:53PM +0300, Andy Shevchenko wrote:
> On Mon, Aug 27, 2018 at 9:58 PM Jarkko Sakkinen
> <jarkko.sakkinen@linux.intel.com> wrote:
> >
> > Add data structures to track Enclave Page Cache (EPC) pages. EPC is
> > divided into multiple banks (1-N) of which addresses and sizes can be
> > enumerated with CPUID by the OS.
> >
> > On NUMA systems a node can have at most bank. A bank can be at most part of
> > two nodes. SGX supports both nodes with a single memory controller and also
> > sub-cluster nodes with severals memory controllers on a single die.
>
> > -#include <asm/sgx.h>
> > -#include <asm/sgx_pr.h>
> > #include <linux/freezer.h>
> > #include <linux/highmem.h>
> > #include <linux/kthread.h>
> > +#include <linux/pagemap.h>
> > #include <linux/ratelimit.h>
> > #include <linux/sched/signal.h>
> > +#include <linux/shmem_fs.h>
> > #include <linux/slab.h>
> > +#include <asm/sgx.h>
> > +#include <asm/sgx_pr.h>
>
> Squash issues?

Yes :-/

> > + va = ioremap_cache(addr, size);
> > + if (!va)
> > + return -ENOMEM;
>
> I'm not sure this is a right API. Do we operate with memory? Does it
> have I/O side effects?
> If no, memremap() would be better to use.

Had this idea a long time ago but had forgotten it. EPC is from caching
perspective like regular memory.

> --
> With Best Regards,
> Andy Shevchenko
>

/Jarkko

\
 
 \ /
  Last update: 2018-09-04 12:00    [W:0.134 / U:8.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site