[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcjKkJR4_H-acbVm3BwA4tVR8gUtkg9STqOK2UG20Tvgg@mail.gmail.com>
Date: Mon, 3 Sep 2018 17:41:53 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
Cc: "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
Platform Driver <platform-driver-x86@...r.kernel.org>,
Dave Hansen <dave.hansen@...el.com>,
sean.j.christopherson@...el.com, nhorman@...hat.com,
npmccallum@...hat.com, linux-sgx@...r.kernel.org,
serge.ayoun@...el.com, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, suresh.b.siddha@...el.com,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v13 07/13] x86/sgx: Add data structures for tracking the
EPC pages
On Mon, Aug 27, 2018 at 9:58 PM Jarkko Sakkinen
<jarkko.sakkinen@...ux.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?
> + 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.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists