From patchwork Wed Jun 5 19:48:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 10977709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EB1A36C5 for ; Wed, 5 Jun 2019 19:49:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D578728892 for ; Wed, 5 Jun 2019 19:49:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9CC428904; Wed, 5 Jun 2019 19:49:29 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FB35288FC for ; Wed, 5 Jun 2019 19:49:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726515AbfFETt2 (ORCPT ); Wed, 5 Jun 2019 15:49:28 -0400 Received: from mga01.intel.com ([192.55.52.88]:2918 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726501AbfFETt2 (ORCPT ); Wed, 5 Jun 2019 15:49:28 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2019 12:49:27 -0700 X-ExtLoop1: 1 Received: from sjchrist-coffee.jf.intel.com ([10.54.74.36]) by orsmga008.jf.intel.com with ESMTP; 05 Jun 2019 12:49:27 -0700 From: Sean Christopherson To: Jarkko Sakkinen Cc: linux-sgx@vger.kernel.org, Dave Hansen , Cedric Xing , Andy Lutomirski , Jethro Beekman , "Dr . Greg Wettstein" Subject: [PATCH 0/7] x86/sgx: Clean up and enhance add pages ioctl Date: Wed, 5 Jun 2019 12:48:38 -0700 Message-Id: <20190605194845.926-1-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-sgx-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This series is intended to be included in v21 of Jarkko's SGX series and applies on Jarkko's current master: dfc89a83b5bc ("docs: x86/sgx: Document the enclave API") The primary goal of the series is to tweak the ioctl for adding pages to an enclave so that it is somewhat extensible, e.g. add a flags field that can be reused for access control integration and SGX2/EAUG, and add a size field so that multiple pages can be added in a single call (batching EADD has been mentioned at various times in the past). The secondary goal is to improve the performance of building enclaves. Handling multiple pages in a single call helps somewhat, but the real win (for some enclaves) is using the kernel's zero page as the source for EADD when possible. Sean Christopherson (7): x86/sgx: Remove dead code to handle non-existent IOR ioctl x86/sgx: Remove unnecessary @cmd parameter from ioctl helpers x86/sgx: Let ioctl helpers do copy to/from user x86/sgx: Allow userspace to add multiple pages in single ioctl() x86/sgx: Add flag to zero added region instead of copying from source x86/sgx: Use the actual zero page as the source when adding zero pages x86/sgx: Add a reserved field to sgx_enclave_add_region to drop 'packed' Documentation/x86/sgx/3.API.rst | 2 +- arch/x86/include/uapi/asm/sgx.h | 30 +-- arch/x86/kernel/cpu/sgx/driver/ioctl.c | 252 +++++++++++++++---------- 3 files changed, 171 insertions(+), 113 deletions(-)