linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Borislav Petkov <bp@alien8.de>, Sean Christopherson <seanjc@google.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org,
	Du Cheng <ducheng2@gmail.com>
Subject: Re: [PATCH] x86/sgx: Suppress WARN on inability to sanitize EPC if ksgxd is stopped
Date: Fri, 18 Jun 2021 08:41:23 -0700	[thread overview]
Message-ID: <3b7b7c4e-968b-530e-90f7-e13470f8b116@intel.com> (raw)
In-Reply-To: <YMt8Orz6KdF3GqZv@zn.tnic>

On 6/17/21 9:45 AM, Borislav Petkov wrote:
> Hmm, this looks weird. Why aren't we starting ksgxd only after
> *everything* has initialized successfully? I.e., after both kvm and
> native drivers' init functions have succeeded?

ksgxd has two roles.  I think that's why it looks weird.

The obvious role is its use as the kswapd equivalent for SGX.

But, it's also used to speed up SGX initialization.  It "sanitizes" the
EPC asynchronously because it can take quite a while.  That's why it
gets launched off early.  If it gets interrupted, that's when this
warning can trigger.

I think you're suggesting that we just defer starting ksgxd until we
*know* it won't be interrupted, basically moving
sgx_page_reclaimer_init() down below sgx_drv_init() and sgx_vepc_init().

While I can see why it's best to get it going as early as possible, I
don't see much going on in those init functions that would justify
needing to fork off ksgx earlier.  Am I missing anything?

  reply	other threads:[~2021-06-18 15:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  0:44 [PATCH] x86/sgx: Suppress WARN on inability to sanitize EPC if ksgxd is stopped Sean Christopherson
2021-06-16  6:03 ` Du Cheng
2021-06-23 13:32   ` Jarkko Sakkinen
2021-06-25  0:47     ` Du Cheng
2021-06-17 16:45 ` Borislav Petkov
2021-06-18 15:41   ` Dave Hansen [this message]
2021-06-23 13:31 ` Jarkko Sakkinen

Reply instructions:

You may reply publicly 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=3b7b7c4e-968b-530e-90f7-e13470f8b116@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=ducheng2@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jarkko@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).