From: Kristen Carlson Accardi <kristen@linux.intel.com>
To: linux-sgx@vger.kernel.org, dave.hansen@intel.com
Cc: haitao.huang@linux.intel.com, jarkko@kernel.org
Subject: [PATCH 1/2] x86/sgx: fixup for available backing pages calculation
Date: Wed, 26 Jan 2022 11:17:10 -0800 [thread overview]
Message-ID: <20220126191711.4917-2-kristen@linux.intel.com> (raw)
In-Reply-To: <20220126191711.4917-1-kristen@linux.intel.com>
Remove improper parentheses from calculation for available
backing bytes. Wtihout this fix, the result will be incorrect
due to rounding.
Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
---
arch/x86/kernel/cpu/sgx/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
index 990f341bbd30..c4030fb608c6 100644
--- a/arch/x86/kernel/cpu/sgx/main.c
+++ b/arch/x86/kernel/cpu/sgx/main.c
@@ -881,7 +881,7 @@ static bool __init sgx_page_cache_init(void)
return false;
}
- available_backing_bytes = total_epc_bytes * (sgx_overcommit_percent / 100);
+ available_backing_bytes = total_epc_bytes * sgx_overcommit_percent / 100;
atomic_long_set(&sgx_nr_available_backing_pages, available_backing_bytes >> PAGE_SHIFT);
return true;
--
2.20.1
next prev parent reply other threads:[~2022-01-26 19:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 19:17 [PATCH 0/2] Fixups for overcommit limit pages Kristen Carlson Accardi
2022-01-26 19:17 ` Kristen Carlson Accardi [this message]
2022-01-26 20:17 ` [PATCH 1/2] x86/sgx: fixup for available backing pages calculation Jarkko Sakkinen
2022-01-26 19:17 ` [PATCH 2/2] x86/sgx: Allow sgx_reclaim_pages() to report failure Kristen Carlson Accardi
2022-01-26 20:19 ` Jarkko Sakkinen
2022-01-26 20:20 ` Jarkko Sakkinen
2022-01-28 18:26 ` Dave Hansen
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=20220126191711.4917-2-kristen@linux.intel.com \
--to=kristen@linux.intel.com \
--cc=dave.hansen@intel.com \
--cc=haitao.huang@linux.intel.com \
--cc=jarkko@kernel.org \
--cc=linux-sgx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.