From patchwork Tue Aug 29 17:56:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 9927855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 98835603B4 for ; Tue, 29 Aug 2017 17:57:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E8AF289E6 for ; Tue, 29 Aug 2017 17:57:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83857289EB; Tue, 29 Aug 2017 17:57:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0AC3F289E8 for ; Tue, 29 Aug 2017 17:57:02 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A47FF21E47D6E; Tue, 29 Aug 2017 10:54:20 -0700 (PDT) X-Original-To: intel-sgx-kernel-dev@lists.01.org Delivered-To: intel-sgx-kernel-dev@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 640EE21E47D6F for ; Tue, 29 Aug 2017 10:54:19 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2017 10:56:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,445,1498546800"; d="scan'208";a="123739749" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.137]) by orsmga004.jf.intel.com with ESMTP; 29 Aug 2017 10:56:59 -0700 From: Sean Christopherson To: intel-sgx-kernel-dev@lists.01.org Date: Tue, 29 Aug 2017 10:56:35 -0700 Message-Id: <1504029396-3353-2-git-send-email-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504029396-3353-1-git-send-email-sean.j.christopherson@intel.com> References: <1504029396-3353-1-git-send-email-sean.j.christopherson@intel.com> Subject: [intel-sgx-kernel-dev] [PATCH 1/2] intel_sgx: move files to arch/x86/kernel/cpu X-BeenThere: intel-sgx-kernel-dev@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Project: Intel® Software Guard Extensions for Linux*: https://01.org/intel-software-guard-extensions" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-sgx-kernel-dev-bounces@lists.01.org Sender: "intel-sgx-kernel-dev" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Sean Christopherson --- arch/x86/Kconfig | 20 ++++++++++++++++++++ arch/x86/kernel/cpu/Makefile | 1 + .../x86 => arch/x86/kernel/cpu}/intel_sgx/Makefile | 0 .../x86 => arch/x86/kernel/cpu}/intel_sgx/sgx.h | 0 .../x86/kernel/cpu}/intel_sgx/sgx_ioctl.c | 0 .../x86 => arch/x86/kernel/cpu}/intel_sgx/sgx_main.c | 0 .../x86/kernel/cpu}/intel_sgx/sgx_page_cache.c | 0 .../x86 => arch/x86/kernel/cpu}/intel_sgx/sgx_util.c | 0 .../x86 => arch/x86/kernel/cpu}/intel_sgx/sgx_vma.c | 0 drivers/platform/x86/Kconfig | 2 -- drivers/platform/x86/Makefile | 1 - drivers/platform/x86/intel_sgx/Kconfig | 19 ------------------- 12 files changed, 21 insertions(+), 22 deletions(-) rename {drivers/platform/x86 => arch/x86/kernel/cpu}/intel_sgx/Makefile (100%) rename {drivers/platform/x86 => arch/x86/kernel/cpu}/intel_sgx/sgx.h (100%) rename {drivers/platform/x86 => arch/x86/kernel/cpu}/intel_sgx/sgx_ioctl.c (100%) rename {drivers/platform/x86 => arch/x86/kernel/cpu}/intel_sgx/sgx_main.c (100%) rename {drivers/platform/x86 => arch/x86/kernel/cpu}/intel_sgx/sgx_page_cache.c (100%) rename {drivers/platform/x86 => arch/x86/kernel/cpu}/intel_sgx/sgx_util.c (100%) rename {drivers/platform/x86 => arch/x86/kernel/cpu}/intel_sgx/sgx_vma.c (100%) delete mode 100644 drivers/platform/x86/intel_sgx/Kconfig diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 0efb4c9..fb8c91f 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1787,6 +1787,26 @@ config X86_INTEL_MEMORY_PROTECTION_KEYS If unsure, say y. +config INTEL_SGX + tristate "Intel(R) SGX Driver" + default n + depends on X86 + select MMU_NOTIFIER + ---help--- + Intel(R) SGX is a set of CPU instructions that can be used by + applications to set aside private regions of code and data. The + code outside the enclave is disallowed to access the memory inside + the enclave by the CPU access control. + + The firmware uses PRMRR registers to reserve an area of physical + memory called Enclave Page Cache (EPC). There is a hardware unit in + the processor called Memory Encryption Engine. The MEE encrypts and + decrypts the EPC pages as they enter and leave the processor package. + + For details, see Documentation/x86/intel_sgx.rst + + If unsure, say N. + config EFI bool "EFI runtime service support" depends on ACPI diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile index 5200001..490fd60 100644 --- a/arch/x86/kernel/cpu/Makefile +++ b/arch/x86/kernel/cpu/Makefile @@ -34,6 +34,7 @@ obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o obj-$(CONFIG_INTEL_RDT_A) += intel_rdt.o intel_rdt_rdtgroup.o intel_rdt_schemata.o +obj-$(CONFIG_INTEL_SGX) += intel_sgx/ obj-$(CONFIG_X86_MCE) += mcheck/ obj-$(CONFIG_MTRR) += mtrr/ obj-$(CONFIG_MICROCODE) += microcode/ diff --git a/drivers/platform/x86/intel_sgx/Makefile b/arch/x86/kernel/cpu/intel_sgx/Makefile similarity index 100% rename from drivers/platform/x86/intel_sgx/Makefile rename to arch/x86/kernel/cpu/intel_sgx/Makefile diff --git a/drivers/platform/x86/intel_sgx/sgx.h b/arch/x86/kernel/cpu/intel_sgx/sgx.h similarity index 100% rename from drivers/platform/x86/intel_sgx/sgx.h rename to arch/x86/kernel/cpu/intel_sgx/sgx.h diff --git a/drivers/platform/x86/intel_sgx/sgx_ioctl.c b/arch/x86/kernel/cpu/intel_sgx/sgx_ioctl.c similarity index 100% rename from drivers/platform/x86/intel_sgx/sgx_ioctl.c rename to arch/x86/kernel/cpu/intel_sgx/sgx_ioctl.c diff --git a/drivers/platform/x86/intel_sgx/sgx_main.c b/arch/x86/kernel/cpu/intel_sgx/sgx_main.c similarity index 100% rename from drivers/platform/x86/intel_sgx/sgx_main.c rename to arch/x86/kernel/cpu/intel_sgx/sgx_main.c diff --git a/drivers/platform/x86/intel_sgx/sgx_page_cache.c b/arch/x86/kernel/cpu/intel_sgx/sgx_page_cache.c similarity index 100% rename from drivers/platform/x86/intel_sgx/sgx_page_cache.c rename to arch/x86/kernel/cpu/intel_sgx/sgx_page_cache.c diff --git a/drivers/platform/x86/intel_sgx/sgx_util.c b/arch/x86/kernel/cpu/intel_sgx/sgx_util.c similarity index 100% rename from drivers/platform/x86/intel_sgx/sgx_util.c rename to arch/x86/kernel/cpu/intel_sgx/sgx_util.c diff --git a/drivers/platform/x86/intel_sgx/sgx_vma.c b/arch/x86/kernel/cpu/intel_sgx/sgx_vma.c similarity index 100% rename from drivers/platform/x86/intel_sgx/sgx_vma.c rename to arch/x86/kernel/cpu/intel_sgx/sgx_vma.c diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 6c217ac..8489020 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -1110,8 +1110,6 @@ config SILEAD_DMI with the OS-image for the device. This option supplies the missing information. Enable this for x86 tablets with Silead touchscreens. -source "drivers/platform/x86/intel_sgx/Kconfig" - endif # X86_PLATFORM_DEVICES config PMC_ATOM diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile index aec6e53..182a3ed 100644 --- a/drivers/platform/x86/Makefile +++ b/drivers/platform/x86/Makefile @@ -80,4 +80,3 @@ obj-$(CONFIG_PMC_ATOM) += pmc_atom.o obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o obj-$(CONFIG_MLX_CPLD_PLATFORM) += mlxcpld-hotplug.o obj-$(CONFIG_INTEL_TURBO_MAX_3) += intel_turbo_max_3.o -obj-$(CONFIG_INTEL_SGX) += intel_sgx/ diff --git a/drivers/platform/x86/intel_sgx/Kconfig b/drivers/platform/x86/intel_sgx/Kconfig deleted file mode 100644 index 9641728..0000000 --- a/drivers/platform/x86/intel_sgx/Kconfig +++ /dev/null @@ -1,19 +0,0 @@ -# -# Intel SGX -# - -config INTEL_SGX - tristate "Intel(R) SGX Driver" - default n - depends on X86 - select MMU_NOTIFIER - ---help--- - Intel(R) SGX is a set of CPU instructions that can be used by - applications to set aside private regions of code and data. The code - outside the enclave is disallowed to access the memory inside the - enclave by the CPU access control. - - The firmware uses PRMRR registers to reserve an area of physical memory - called Enclave Page Cache (EPC). There is a hardware unit in the - processor called Memory Encryption Engine. The MEE encrypts and decrypts - the EPC pages as they enter and leave the processor package.