From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: intel-sgx-kernel-dev@ml01.01.org
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
Darren Hart <dvhart@infradead.org>,
platform-driver-x86@vger.kernel.org (open list:X86 PLATFORM
DRIVERS), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 1/3] intel_sgx: do not use BUG() in sgx_free_page()
Date: Thu, 26 Jan 2017 23:20:36 +0200 [thread overview]
Message-ID: <20170126212038.12809-2-jarkko.sakkinen@linux.intel.com> (raw)
In-Reply-To: <20170126212038.12809-1-jarkko.sakkinen@linux.intel.com>
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);
}
spin_lock(&sgx_free_list_lock);
--
2.9.3
next prev parent reply other threads:[~2017-01-26 21:21 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 ` Jarkko Sakkinen [this message]
2017-01-27 15:45 ` [PATCH 1/3] intel_sgx: do not use BUG() in sgx_free_page() Andy Shevchenko
2017-01-29 15:11 ` Jarkko Sakkinen
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=20170126212038.12809-2-jarkko.sakkinen@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.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;
as well as URLs for NNTP newsgroup(s).