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=-6.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 0C067C433DB for ; Tue, 9 Feb 2021 23:36:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D731064DF5 for ; Tue, 9 Feb 2021 23:36:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234307AbhBIXfT (ORCPT ); Tue, 9 Feb 2021 18:35:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:32884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233749AbhBIWl6 (ORCPT ); Tue, 9 Feb 2021 17:41:58 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A6B3664E85; Tue, 9 Feb 2021 21:20:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612905603; bh=EqtcTDWQuWQ17YBpCKfbqrpwrSVDDZRYyET0mFRkOI4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JLMm4CdzEZ6cgjPlJrlIpT5HdxQ011fsVg0uYewq+/wguYgMIwCrYPm85NZE4pS+i r49YCdAXiCBhFdBcGx7VPAAbsUZMEyRJ/RSHaAiMmgwfBEnHAO0BkRbQod6bn3pzfu hOnhhl8Of3bxStPekz3xgT1ISGlHVG6HvVYPzxO4dvIzIXJAJTJD2j3QbJMTm8pKPD wLACY2lAPDbkGyGYODsgDf87zsK7OWxK2IH5HEvtrj2w1sohfjdiIHDLm5MbPnEAKb mCW/08cGO0vJpbSR4b8+sGl2KSZWIAkpjUU6uMDALN9I72+Dv7m+GyiMmlwvb0RSNX sXQh2uejJi4ww== Date: Tue, 9 Feb 2021 23:19:52 +0200 From: Jarkko Sakkinen To: Kai Huang Cc: linux-sgx@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org, seanjc@google.com, luto@kernel.org, dave.hansen@intel.com, rick.p.edgecombe@intel.com, haitao.huang@intel.com, pbonzini@redhat.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com Subject: Re: [RFC PATCH v4 05/26] x86/sgx: Introduce virtual EPC for use by KVM guests Message-ID: References: <11a923a314accf36a82aac4b676310a4802f5c75.1612777752.git.kai.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org On Tue, Feb 09, 2021 at 11:18:13PM +0200, Jarkko Sakkinen wrote: > On Mon, Feb 08, 2021 at 11:54:09PM +1300, Kai Huang wrote: > > From: Sean Christopherson > > > > Add a misc device /dev/sgx_vepc to allow userspace to allocate "raw" EPC > > without an associated enclave. The intended and only known use case for > > raw EPC allocation is to expose EPC to a KVM guest, hence the 'vepc' > > moniker, virt.{c,h} files and X86_SGX_KVM Kconfig. > > This commit message does give existential background for having vEPC. > I.e. everything below this paragraph is "good enough" to make the case > for SGX subsystem controlled vEPC. > > However, it does not give any existential background for /dev/sgx_vpec. > Even with differing internals you could just as well make the whole > thing as subfunction of /dev/sgx_enclave. It's perfectly doable. It > does not really matter how much the same internals are used (e.g. > sgx_encl). > > Without that clearly documented, it would be unwise to merge this. E.g. - Have ioctl() to turn opened fd as vEPC. - If FLC is disabled, you could only use the fd for creating vEPC. Quite easy stuff to implement. /Jarkko