Linux-Sgx Archive on lore.kernel.org
 help / color / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: linux-sgx@vger.kernel.org
Subject: Re: [PATCH] x86/sgx: Return 0 when !CONFIG_INTEL_SGX_DRIVER
Date: Fri, 16 Aug 2019 00:56:00 +0300
Message-ID: <20190815215600.u3cz27y27nrldq3i@linux.intel.com> (raw)
In-Reply-To: <20190813012227.GJ4996@linux.intel.com>

On Mon, Aug 12, 2019 at 06:22:27PM -0700, Sean Christopherson wrote:
> Nope, KVM does not have any dependencies on the native driver.  But if
> sgx_drv_init() returns 0 when CONFIG_INTEL_SGX_DRIVER=n, then sgx_init()
> won't handle KVM failure correctly since it will think the native driver
> initialized cleanly.  E.g. with both KVM and driver in play, I was
> thinking of something like this in sgx_init():
> 
>         /* Success if the native *or* virtual driver initialized cleanly. */
>         ret = sgx_drv_init();
>         ret = sgx_virt_epc_init() ? ret : 0;
>         if (ret)
> 		goto err;
> 
> 	return 0;
> 
> If sgx_drv_init() returns 0 when CONFIG_INTEL_SGX_DRIVER=n, then failure
> in sgx_virt_epc_init() is ignored and we end up with the SGX subsystem
> wasting resources again.

I get what you are saying but what exist now does not align with this
and on the other hand nothing prevents the reconsider the flow once we
get to this point.

/Jarkko

  reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-14 14:32 Jarkko Sakkinen
2019-07-15  9:29 ` Jarkko Sakkinen
2019-07-15 13:59 ` Sean Christopherson
2019-08-01 16:22   ` Jarkko Sakkinen
2019-08-01 16:29     ` Sean Christopherson
2019-08-02 19:33       ` Jarkko Sakkinen
2019-08-13  1:22         ` Sean Christopherson
2019-08-15 21:56           ` Jarkko Sakkinen [this message]
2019-08-21 17:24             ` Sean Christopherson
2019-08-22  0:29               ` Jarkko Sakkinen
2019-08-22  0:31                 ` Sean Christopherson
2019-08-22 14:42                   ` Jarkko Sakkinen
2019-08-22  1:26                 ` Jarkko Sakkinen

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190815215600.u3cz27y27nrldq3i@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=linux-sgx@vger.kernel.org \
    --cc=sean.j.christopherson@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Sgx Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-sgx/0 linux-sgx/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-sgx linux-sgx/ https://lore.kernel.org/linux-sgx \
		linux-sgx@vger.kernel.org linux-sgx@archiver.kernel.org
	public-inbox-index linux-sgx


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-sgx


AGPL code for this site: git clone https://public-inbox.org/ public-inbox