From patchwork Wed Apr 12 16:24:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 9677767 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 3338260382 for ; Wed, 12 Apr 2017 16:24:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 262A3205FB for ; Wed, 12 Apr 2017 16:24:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AEA728553; Wed, 12 Apr 2017 16:24:32 +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 C0573205FB for ; Wed, 12 Apr 2017 16:24:31 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 34C9C21A0483A; Wed, 12 Apr 2017 09:24:31 -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 8D54F21A0483A for ; Wed, 12 Apr 2017 09:24:29 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2017 09:24:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.37,191,1488873600"; d="scan'208"; a="1118664440" Received: from sjchrist-ts.jf.intel.com ([10.54.74.20]) by orsmga001.jf.intel.com with ESMTP; 12 Apr 2017 09:24:28 -0700 From: Sean Christopherson To: intel-sgx-kernel-dev@lists.01.org Date: Wed, 12 Apr 2017 09:24:18 -0700 Message-Id: <1492014258-19043-1-git-send-email-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [intel-sgx-kernel-dev] [PATCH] intel_sgx: compress sgx_encl_page flags and va_offset 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 Compress struct sgx_encl_page's flags and va_offset into a single 32-bit variable by assigning 20 bits of an unsigned int for flags and the remaining 12 bits for the VA offset. Signed-off-by: Sean Christopherson --- drivers/platform/x86/intel_sgx/sgx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/intel_sgx/sgx.h b/drivers/platform/x86/intel_sgx/sgx.h index 82355bb..2b7a7f2 100644 --- a/drivers/platform/x86/intel_sgx/sgx.h +++ b/drivers/platform/x86/intel_sgx/sgx.h @@ -105,11 +105,11 @@ enum sgx_encl_page_flags { struct sgx_encl_page { unsigned long addr; - unsigned int flags; + unsigned int flags : 20, + va_offset : 12; struct sgx_epc_page *epc_page; struct list_head load_list; struct sgx_va_page *va_page; - unsigned int va_offset; }; struct sgx_tgid_ctx {