linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] x86/sgx: Do not update sgx_nr_free_pages in sgx_setup_epc_section()
@ 2021-04-05 23:26 Jarkko Sakkinen
  2021-04-05 23:26 ` [PATCH v2 2/2] x86/sgx: Add sgx_nr_{all, free}_pages to the debugfs Jarkko Sakkinen
  2021-04-07 15:49 ` [PATCH v2 1/2] x86/sgx: Do not update sgx_nr_free_pages in sgx_setup_epc_section() Borislav Petkov
  0 siblings, 2 replies; 17+ messages in thread
From: Jarkko Sakkinen @ 2021-04-05 23:26 UTC (permalink / raw)
  To: linux-sgx
  Cc: Jarkko Sakkinen, Dave Hansen, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, x86, H. Peter Anvin, linux-kernel

Now that the sanitization process will make pages available by calling
sgx_free_epc_page(), sgx_setup_epc_section() should not touch to
sgx_nr_free_pages. This will result sgx_nr_free_pages to contain 2x the
number of actual free pages. Simply, remove the statement.

Fixes: 51ab30eb2ad4 ("x86/sgx: Replace section->init_laundry_list with sgx_dirty_page_list")
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
---
 arch/x86/kernel/cpu/sgx/main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
index 13a7599ce7d4..7df7048cb1c9 100644
--- a/arch/x86/kernel/cpu/sgx/main.c
+++ b/arch/x86/kernel/cpu/sgx/main.c
@@ -657,7 +657,6 @@ static bool __init sgx_setup_epc_section(u64 phys_addr, u64 size,
 		list_add_tail(&section->pages[i].list, &sgx_dirty_page_list);
 	}
 
-	sgx_nr_free_pages += nr_pages;
 	return true;
 }
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-04-08 16:27 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 23:26 [PATCH v2 1/2] x86/sgx: Do not update sgx_nr_free_pages in sgx_setup_epc_section() Jarkko Sakkinen
2021-04-05 23:26 ` [PATCH v2 2/2] x86/sgx: Add sgx_nr_{all, free}_pages to the debugfs Jarkko Sakkinen
2021-04-07 15:56   ` Borislav Petkov
2021-04-07 16:09     ` Jarkko Sakkinen
2021-04-07 16:15       ` Borislav Petkov
2021-04-08  8:52         ` Jarkko Sakkinen
2021-04-08  9:01           ` Borislav Petkov
2021-04-08  9:13           ` Jarkko Sakkinen
2021-04-08  9:32             ` Borislav Petkov
2021-04-08 16:27               ` Jarkko Sakkinen
2021-04-07 15:49 ` [PATCH v2 1/2] x86/sgx: Do not update sgx_nr_free_pages in sgx_setup_epc_section() Borislav Petkov
2021-04-07 16:03   ` Jarkko Sakkinen
2021-04-07 16:18     ` Borislav Petkov
2021-04-08  8:48       ` Jarkko Sakkinen
2021-04-08  8:56         ` Borislav Petkov
2021-04-08  9:22           ` Jarkko Sakkinen
2021-04-08  9:29             ` Borislav Petkov

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).