From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: linux-sgx@vger.kernel.org
Cc: sean.j.christopherson@intel.com, serge.ayoun@intel.com,
shay.katz-zamir@intel.com,
Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Subject: [PATCH RESEND 02/11] x86/sgx: Clean up internal includes
Date: Thu, 12 Sep 2019 20:47:11 +0100 [thread overview]
Message-ID: <20190912194720.7107-3-jarkko.sakkinen@linux.intel.com> (raw)
In-Reply-To: <20190912194720.7107-1-jarkko.sakkinen@linux.intel.com>
Include arch.h from sgx.h and include sgx.h from other headers. This
makes a sane include order. Any new header should only need to include
sgx.h. The .c files must just include the modules that they use.
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Shay Katz-zamir <shay.katz-zamir@intel.com>
Cc: Serge Ayoun <serge.ayoun@intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
arch/x86/kernel/cpu/sgx/driver.c | 2 ++
arch/x86/kernel/cpu/sgx/driver.h | 3 ---
arch/x86/kernel/cpu/sgx/encl.c | 2 --
arch/x86/kernel/cpu/sgx/encl.h | 1 +
arch/x86/kernel/cpu/sgx/encls.h | 2 +-
arch/x86/kernel/cpu/sgx/ioctl.c | 2 ++
arch/x86/kernel/cpu/sgx/main.c | 3 +--
arch/x86/kernel/cpu/sgx/reclaim.c | 3 ++-
arch/x86/kernel/cpu/sgx/sgx.h | 1 +
9 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kernel/cpu/sgx/driver.c b/arch/x86/kernel/cpu/sgx/driver.c
index a1da479ffd3a..1ceeb742c1da 100644
--- a/arch/x86/kernel/cpu/sgx/driver.c
+++ b/arch/x86/kernel/cpu/sgx/driver.c
@@ -9,6 +9,8 @@
#include <linux/suspend.h>
#include <asm/traps.h>
#include "driver.h"
+#include "encl.h"
+#include "encls.h"
MODULE_DESCRIPTION("Intel SGX Enclave Driver");
MODULE_AUTHOR("Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>");
diff --git a/arch/x86/kernel/cpu/sgx/driver.h b/arch/x86/kernel/cpu/sgx/driver.h
index 1e35933cf8a4..2f13886522a8 100644
--- a/arch/x86/kernel/cpu/sgx/driver.h
+++ b/arch/x86/kernel/cpu/sgx/driver.h
@@ -10,9 +10,6 @@
#include <linux/sched.h>
#include <linux/workqueue.h>
#include <uapi/asm/sgx.h>
-#include "arch.h"
-#include "encl.h"
-#include "encls.h"
#include "sgx.h"
#define SGX_DRV_NR_DEVICES 2
diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c
index 9bf49e30a568..1c1fbc95be33 100644
--- a/arch/x86/kernel/cpu/sgx/encl.c
+++ b/arch/x86/kernel/cpu/sgx/encl.c
@@ -7,10 +7,8 @@
#include <linux/shmem_fs.h>
#include <linux/suspend.h>
#include <linux/sched/mm.h>
-#include "arch.h"
#include "encl.h"
#include "encls.h"
-#include "sgx.h"
static int __sgx_encl_eldu(struct sgx_encl_page *encl_page,
struct sgx_epc_page *epc_page,
diff --git a/arch/x86/kernel/cpu/sgx/encl.h b/arch/x86/kernel/cpu/sgx/encl.h
index c7608964d69e..95e5713a50ad 100644
--- a/arch/x86/kernel/cpu/sgx/encl.h
+++ b/arch/x86/kernel/cpu/sgx/encl.h
@@ -15,6 +15,7 @@
#include <linux/radix-tree.h>
#include <linux/srcu.h>
#include <linux/workqueue.h>
+#include "sgx.h"
/**
* enum sgx_encl_page_desc - defines bits for an enclave page's descriptor
diff --git a/arch/x86/kernel/cpu/sgx/encls.h b/arch/x86/kernel/cpu/sgx/encls.h
index aea3b9d09936..6631afbf2f64 100644
--- a/arch/x86/kernel/cpu/sgx/encls.h
+++ b/arch/x86/kernel/cpu/sgx/encls.h
@@ -8,7 +8,7 @@
#include <linux/rwsem.h>
#include <linux/types.h>
#include <asm/asm.h>
-#include "arch.h"
+#include "sgx.h"
/**
* ENCLS_FAULT_FLAG - flag signifying an ENCLS return code is a trapnr
diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
index e2205a433b87..e57dda38513b 100644
--- a/arch/x86/kernel/cpu/sgx/ioctl.c
+++ b/arch/x86/kernel/cpu/sgx/ioctl.c
@@ -13,6 +13,8 @@
#include <linux/slab.h>
#include <linux/suspend.h>
#include "driver.h"
+#include "encl.h"
+#include "encls.h"
static struct sgx_va_page *sgx_encl_grow(struct sgx_encl *encl)
{
diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
index e4f751651a65..c58ab5f28669 100644
--- a/arch/x86/kernel/cpu/sgx/main.c
+++ b/arch/x86/kernel/cpu/sgx/main.c
@@ -9,9 +9,8 @@
#include <linux/sched/signal.h>
#include <linux/slab.h>
#include "driver.h"
-#include "arch.h"
+#include "encl.h"
#include "encls.h"
-#include "sgx.h"
struct sgx_epc_section sgx_epc_sections[SGX_MAX_EPC_SECTIONS];
int sgx_nr_epc_sections;
diff --git a/arch/x86/kernel/cpu/sgx/reclaim.c b/arch/x86/kernel/cpu/sgx/reclaim.c
index bd8ac11a4278..d82ce1eaa60e 100644
--- a/arch/x86/kernel/cpu/sgx/reclaim.c
+++ b/arch/x86/kernel/cpu/sgx/reclaim.c
@@ -10,7 +10,8 @@
#include <linux/sched/mm.h>
#include <linux/sched/signal.h>
#include "driver.h"
-#include "sgx.h"
+#include "encl.h"
+#include "encls.h"
struct task_struct *ksgxswapd_tsk;
DECLARE_WAIT_QUEUE_HEAD(ksgxswapd_waitq);
diff --git a/arch/x86/kernel/cpu/sgx/sgx.h b/arch/x86/kernel/cpu/sgx/sgx.h
index f0ff7bd3d18e..bc6a644af2b5 100644
--- a/arch/x86/kernel/cpu/sgx/sgx.h
+++ b/arch/x86/kernel/cpu/sgx/sgx.h
@@ -9,6 +9,7 @@
#include <linux/types.h>
#include <asm/asm.h>
#include <uapi/asm/sgx_errno.h>
+#include "arch.h"
struct sgx_epc_page {
unsigned long desc;
--
2.20.1
next prev parent reply other threads:[~2019-09-12 19:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-12 19:47 [PATCH RESEND 00/11] v23 updates Jarkko Sakkinen
2019-09-12 19:47 ` [PATCH RESEND 01/11] selftest/x86/sgx: Remove encl_piggy.h Jarkko Sakkinen
2019-09-12 19:47 ` Jarkko Sakkinen [this message]
2019-09-12 19:47 ` [PATCH RESEND 03/11] x86/sgx: Write backing storage only if EWB is successful Jarkko Sakkinen
2019-09-12 19:47 ` [PATCH RESEND 04/11] x86/sgx: Rename 'j' as 'cnt' in sgx_reclaim_pages() Jarkko Sakkinen
2019-09-12 19:47 ` [PATCH RESEND 05/11] x86/sgx: Turn encls_failed() as inline function Jarkko Sakkinen
2019-09-12 19:47 ` [PATCH RESEND 06/11] x86/sgx: Move sgx_einit() to encls.c Jarkko Sakkinen
2019-09-12 19:47 ` [PATCH RESEND 07/11] x86/sgx: Remove pages in sgx_reclaimer_write() Jarkko Sakkinen
2019-09-12 19:47 ` [PATCH RESEND 08/11] x86/sgx: Calculate page index " Jarkko Sakkinen
2019-09-12 19:47 ` [PATCH RESEND 09/11] x86/sgx: Move SGX_ENCL_DEAD check to sgx_reclaimer_write() Jarkko Sakkinen
2019-09-12 19:47 ` [PATCH RESEND 10/11] x86/sgx: Free VA slot when the EWB flow fails Jarkko Sakkinen
2019-09-12 19:47 ` [PATCH RESEND 11/11] x86/sgx: Call sgx_encl_destroy() " Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190912194720.7107-3-jarkko.sakkinen@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=linux-sgx@vger.kernel.org \
--cc=sean.j.christopherson@intel.com \
--cc=serge.ayoun@intel.com \
--cc=shay.katz-zamir@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).