Message ID | 20200529175407.2109-7-sean.j.christopherson@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | x86/sgx: Misc fixes for v31 | expand |
On Fri, May 29, 2020 at 10:54:07AM -0700, Sean Christopherson wrote: > Terminate the section loop with '<' instead of '<=' and drop the > associated pr_warn in sgx_page_cache_init(). Per Boris, there's no > point in warning the user if they can't do anything about it. > > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Applied this directly to the correct patch, thanks. /Jarkko
diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c index ba5486a1ef6f4..c51a3ad7fcce0 100644 --- a/arch/x86/kernel/cpu/sgx/main.c +++ b/arch/x86/kernel/cpu/sgx/main.c @@ -692,7 +692,7 @@ static bool __init sgx_page_cache_init(void) u64 pa, size; int i; - for (i = 0; i <= ARRAY_SIZE(sgx_epc_sections); i++) { + for (i = 0; i < ARRAY_SIZE(sgx_epc_sections); i++) { cpuid_count(SGX_CPUID, i + SGX_CPUID_FIRST_VARIABLE_SUB_LEAF, &eax, &ebx, &ecx, &edx); @@ -705,11 +705,6 @@ static bool __init sgx_page_cache_init(void) break; } - if (i == ARRAY_SIZE(sgx_epc_sections)) { - pr_warn("No free slot for an EPC section\n"); - break; - } - pa = sgx_calc_section_metric(eax, ebx); size = sgx_calc_section_metric(ecx, edx);
Terminate the section loop with '<' instead of '<=' and drop the associated pr_warn in sgx_page_cache_init(). Per Boris, there's no point in warning the user if they can't do anything about it. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> --- arch/x86/kernel/cpu/sgx/main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)