From patchwork Wed Aug 2 13:42:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Sakkinen X-Patchwork-Id: 9876803 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 AE33560390 for ; Wed, 2 Aug 2017 13:43:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E408287AE for ; Wed, 2 Aug 2017 13:43:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 921992877F; Wed, 2 Aug 2017 13:43:11 +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 51A952877F for ; Wed, 2 Aug 2017 13:43:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id AE07121DF9661; Wed, 2 Aug 2017 06:41:00 -0700 (PDT) X-Original-To: intel-sgx-kernel-dev@lists.01.org Delivered-To: intel-sgx-kernel-dev@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 72CF621D491B6 for ; Wed, 2 Aug 2017 06:40:59 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 02 Aug 2017 06:43:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,311,1498546800"; d="scan'208";a="132535071" Received: from jsakkine-mobl1.tm.intel.com (HELO localhost) ([10.237.50.92]) by orsmga005.jf.intel.com with ESMTP; 02 Aug 2017 06:43:08 -0700 From: Jarkko Sakkinen To: intel-sgx-kernel-dev@lists.01.org Date: Wed, 2 Aug 2017 16:42:54 +0300 Message-Id: <20170802134254.4682-3-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170802134254.4682-1-jarkko.sakkinen@linux.intel.com> References: <20170802134254.4682-1-jarkko.sakkinen@linux.intel.com> Subject: [intel-sgx-kernel-dev] [PATCH 2/2] intel_sgx: require X86_64 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 Update the driver require 64-bit compilation for two reasons: - We cannot sanely enable PAT for IO range in 32-bit because PAT helpers are not exported. - The first version of in-kernel launch enclave is 64-bit only. There is long term path to do 32-bit support by extending existing io-mapping framework to support WB (at the moment it supports WC only) that can be used post upstreaming. Signed-off-by: Jarkko Sakkinen --- drivers/platform/x86/intel_sgx/Kconfig | 2 +- drivers/platform/x86/intel_sgx/sgx_page_cache.c | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/platform/x86/intel_sgx/Kconfig b/drivers/platform/x86/intel_sgx/Kconfig index 96417280bbf7..c13f8efd26bc 100644 --- a/drivers/platform/x86/intel_sgx/Kconfig +++ b/drivers/platform/x86/intel_sgx/Kconfig @@ -5,7 +5,7 @@ config INTEL_SGX tristate "Intel(R) SGX Driver" default n - depends on X86 + depends on CPU_SUP_INTEL && X86_64 select MMU_NOTIFIER ---help--- Intel(R) SGX is a set of CPU instructions that can be used by diff --git a/drivers/platform/x86/intel_sgx/sgx_page_cache.c b/drivers/platform/x86/intel_sgx/sgx_page_cache.c index 09fe3244fcee..124a37e28555 100644 --- a/drivers/platform/x86/intel_sgx/sgx_page_cache.c +++ b/drivers/platform/x86/intel_sgx/sgx_page_cache.c @@ -554,9 +554,6 @@ EXPORT_SYMBOL(sgx_free_page); void *sgx_get_page(struct sgx_epc_page *entry) { -#ifdef CONFIG_X86_32 - return kmap_atomic_pfn(PFN_DOWN(entry->pa)); -#else unsigned long offset; int i; @@ -571,15 +568,11 @@ void *sgx_get_page(struct sgx_epc_page *entry) } return NULL; -#endif } EXPORT_SYMBOL(sgx_get_page); void sgx_put_page(void *epc_page_vaddr) { -#ifdef CONFIG_X86_32 kunmap_atomic(epc_page_vaddr); -#else -#endif } EXPORT_SYMBOL(sgx_put_page);