mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: intel-sgx-kernel-dev@ml01.01.org,
	Darren Hart <dvhart@infradead.org>,
	"open list:X86 PLATFORM DRIVERS" 
	<platform-driver-x86@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] intel_sgx: do not use BUG() in sgx_free_page()
Date: Sun, 29 Jan 2017 17:11:08 +0200	[thread overview]
Message-ID: <20170129151108.kpyyf3oksfrxqqhs@intel.com> (raw)
In-Reply-To: <CAHp75Vf6ptzeEKXJdvBvE-3LFxRcmb6UL8r-9-XRsJE5UcM0fA@mail.gmail.com>

On Fri, Jan 27, 2017 at 05:45:03PM +0200, Andy Shevchenko wrote:
> On Thu, Jan 26, 2017 at 11:20 PM, Jarkko Sakkinen
> <jarkko.sakkinen@linux.intel.com> wrote:
> > EREMOVE fails on non-EPC page or when a SECS page with children is to be
> > removed. These do not happen if the driver is working correctly. Log the
> > error but do not crash the driver.
> >
> > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > ---
> >  drivers/platform/x86/intel_sgx_page_cache.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/platform/x86/intel_sgx_page_cache.c b/drivers/platform/x86/intel_sgx_page_cache.c
> > index d073057..7f73ac7 100644
> > --- a/drivers/platform/x86/intel_sgx_page_cache.c
> > +++ b/drivers/platform/x86/intel_sgx_page_cache.c
> > @@ -551,10 +551,8 @@ void sgx_free_page(struct sgx_epc_page *entry,
> >                 ret = __eremove(epc);
> >                 sgx_put_epc_page(epc);
> >
> > -               if (ret) {
> > -                       pr_err("EREMOVE returned %d\n", ret);
> > -                       BUG();
> > -               }
> > +               if (ret)
> > +                       sgx_err(encl, "EREMOVE returned %d\n", ret);
> 
> Do you have something like critical level? For me seems reasonable to
> increase the level of message if BUG() was somehow related to actual
> situation.

Hmm... I think that would make sense. This could only happen when
the driver implementation is working incorrectly.

/Jarkko

  reply	other threads:[~2017-01-29 15:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 21:20 [PATCH 0/3] Get rid of BUG() Jarkko Sakkinen
2017-01-26 21:20 ` [PATCH 1/3] intel_sgx: do not use BUG() in sgx_free_page() Jarkko Sakkinen
2017-01-27 15:45   ` Andy Shevchenko
2017-01-29 15:11     ` Jarkko Sakkinen [this message]
2017-01-28 13:32 ` [PATCH 0/3] Get rid of BUG() Andy Shevchenko

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=20170129151108.kpyyf3oksfrxqqhs@intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=intel-sgx-kernel-dev@ml01.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.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

Powered by JetHome