From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1596EC433E0 for ; Tue, 16 Feb 2021 10:30:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C86B464DAF for ; Tue, 16 Feb 2021 10:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbhBPKa4 convert rfc822-to-8bit (ORCPT ); Tue, 16 Feb 2021 05:30:56 -0500 Received: from mga03.intel.com ([134.134.136.65]:39030 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbhBPKas (ORCPT ); Tue, 16 Feb 2021 05:30:48 -0500 IronPort-SDR: e3KDvlqNvzO0Ig5IT1UGkeUSontjC/5Q2qszCuAtEzldboQtuKqAyRc10HNVgDzREBBdtdBpuc tnja4QLhMASA== X-IronPort-AV: E=McAfee;i="6000,8403,9896"; a="182926106" X-IronPort-AV: E=Sophos;i="5.81,183,1610438400"; d="scan'208";a="182926106" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2021 02:30:04 -0800 IronPort-SDR: kAShZ2WkP/t9TGbmpMrm/P8VWLVO39JYhDhBXlmH9gvEbDNZJhC7ePVZnv+dNPhDcwzQrSoVNm ZZmWaI2UWMQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,183,1610438400"; d="scan'208";a="580433288" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga005.jf.intel.com with ESMTP; 16 Feb 2021 02:30:04 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 16 Feb 2021 02:30:04 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 16 Feb 2021 02:30:03 -0800 Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by ORSMSX602.amr.corp.intel.com ([10.22.229.15]) with mapi id 15.01.2106.002; Tue, 16 Feb 2021 02:30:03 -0800 From: "Huang, Kai" To: Jarkko Sakkinen CC: "linux-sgx@vger.kernel.org" , "kvm@vger.kernel.org" , "x86@kernel.org" , "seanjc@google.com" , "luto@kernel.org" , "Hansen, Dave" , "Edgecombe, Rick P" , "Huang, Haitao" , "pbonzini@redhat.com" , "bp@alien8.de" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" Subject: RE: [RFC PATCH v5 08/26] x86/sgx: Expose SGX architectural definitions to the kernel Thread-Topic: [RFC PATCH v5 08/26] x86/sgx: Expose SGX architectural definitions to the kernel Thread-Index: AQHXAgqNtwlxthmplU6cFSX1Hb3mCqpalcMAgAACzaA= Date: Tue, 16 Feb 2021 10:30:03 +0000 Message-ID: References: <1d6fe6bd392b604091b57842c15cc5460aa92593.1613221549.git.kai.huang@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action x-originating-ip: [10.1.200.100] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org > > On Sun, Feb 14, 2021 at 02:29:10AM +1300, Kai Huang wrote: > > From: Sean Christopherson > > > > Expose SGX architectural structures, as KVM will use many of the > > architectural constants and structs to virtualize SGX. > > > > Signed-off-by: Sean Christopherson > > Acked-by: Dave Hansen > > Acked-by: Jarkko Sakkinen > > Signed-off-by: Kai Huang > > --- > > arch/x86/{kernel/cpu/sgx/arch.h => include/asm/sgx_arch.h} | 0 > > arch/x86/kernel/cpu/sgx/encl.c | 2 +- > > arch/x86/kernel/cpu/sgx/sgx.h | 2 +- > > tools/testing/selftests/sgx/defines.h | 2 +- > > 4 files changed, 3 insertions(+), 3 deletions(-) rename > > arch/x86/{kernel/cpu/sgx/arch.h => include/asm/sgx_arch.h} (100%) > > > > diff --git a/arch/x86/kernel/cpu/sgx/arch.h > > b/arch/x86/include/asm/sgx_arch.h similarity index 100% rename from > > arch/x86/kernel/cpu/sgx/arch.h rename to > > arch/x86/include/asm/sgx_arch.h > > Why not just sgx.h? The postfix is useless. Because those contents are *architectural*. They are defined in SDM. And patch 13 (x86/sgx: Add helpers to expose ECREATE and EINIT to KVM) will introduce arch/x86/include/asm/sgx.h, where non-architectural functions will be declared.