From: Cathy Zhang <cathy.zhang@intel.com>
To: linux-sgx@vger.kernel.org, x86@kernel.org
Cc: jarkko@kernel.org, reinette.chatre@intel.com,
dave.hansen@intel.com, ashok.raj@intel.com,
cathy.zhang@intel.com, chao.p.peng@linux.intel.com,
yang.zhong@intel.com
Subject: [PATCH v5 4/9] x86/sgx: Save the size of each EPC section
Date: Fri, 20 May 2022 18:38:59 +0800 [thread overview]
Message-ID: <20220520103904.1216-5-cathy.zhang@intel.com> (raw)
In-Reply-To: <20220520103904.1216-1-cathy.zhang@intel.com>
SGX CPUSVN update process should check all EPC pages to ensure they are
marked as unused. For EPC pages are stored in EPC sections, it's
required to save the size of each section, as the indicator for the end
of each section's traversing to unuse EPC pages.
Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
---
Changes since v3:
- Update commit log to explain clearly why record the size. (Suggested
by Jarkko Sakkinen)
---
arch/x86/kernel/cpu/sgx/sgx.h | 1 +
arch/x86/kernel/cpu/sgx/main.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/x86/kernel/cpu/sgx/sgx.h b/arch/x86/kernel/cpu/sgx/sgx.h
index 4ad0e5396eef..775477e0b8af 100644
--- a/arch/x86/kernel/cpu/sgx/sgx.h
+++ b/arch/x86/kernel/cpu/sgx/sgx.h
@@ -63,6 +63,7 @@ struct sgx_epc_section {
void *virt_addr;
struct sgx_epc_page *pages;
struct sgx_numa_node *node;
+ u64 size;
};
extern struct sgx_epc_section sgx_epc_sections[SGX_MAX_EPC_SECTIONS];
diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
index ec2775652a50..5fbad67d529f 100644
--- a/arch/x86/kernel/cpu/sgx/main.c
+++ b/arch/x86/kernel/cpu/sgx/main.c
@@ -662,6 +662,7 @@ static bool __init sgx_setup_epc_section(u64 phys_addr, u64 size,
}
section->phys_addr = phys_addr;
+ section->size = size;
xa_store_range(&sgx_epc_address_space, section->phys_addr,
phys_addr + size - 1, section, GFP_KERNEL);
--
2.17.1
next prev parent reply other threads:[~2022-05-20 10:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-20 10:38 [PATCH v5 0/9] Support microcode updates affecting SGX Cathy Zhang
2022-05-20 10:38 ` [PATCH v5 1/9] x86/sgx: Introduce mechanism to prevent new initializations of EPC pages Cathy Zhang
2022-05-20 19:05 ` Jarkko Sakkinen
2022-05-20 10:38 ` [PATCH v5 2/9] x86/sgx: Save enclave pointer for VA page Cathy Zhang
2022-05-20 19:07 ` Jarkko Sakkinen
2022-05-20 10:38 ` [PATCH v5 3/9] x86/sgx: Keep record for SGX VA and Guest page type Cathy Zhang
2022-05-20 19:11 ` Jarkko Sakkinen
2022-05-23 0:06 ` Zhang, Cathy
2022-05-23 6:09 ` Zhang, Cathy
2022-05-23 19:19 ` Jarkko Sakkinen
2022-05-20 10:38 ` Cathy Zhang [this message]
2022-05-20 10:39 ` [PATCH v5 5/9] x86/sgx: Forced EPC page zapping for EUPDATESVN Cathy Zhang
2022-05-20 10:39 ` [PATCH v5 6/9] x86/sgx: Define error codes for ENCLS[EUPDATESVN] Cathy Zhang
2022-05-20 10:39 ` [PATCH v5 7/9] x86/sgx: Implement ENCLS[EUPDATESVN] Cathy Zhang
2022-05-20 10:39 ` [PATCH v5 8/9] x86/cpu: Call ENCLS[EUPDATESVN] procedure in microcode update Cathy Zhang
2022-05-20 10:39 ` [PATCH v5 9/9] x86/sgx: Call ENCLS[EUPDATESVN] during SGX initialization Cathy Zhang
2022-05-24 19:15 ` [PATCH v5 0/9] Support microcode updates affecting SGX Thomas Gleixner
2022-05-24 19:26 ` Borislav Petkov
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=20220520103904.1216-5-cathy.zhang@intel.com \
--to=cathy.zhang@intel.com \
--cc=ashok.raj@intel.com \
--cc=chao.p.peng@linux.intel.com \
--cc=dave.hansen@intel.com \
--cc=jarkko@kernel.org \
--cc=linux-sgx@vger.kernel.org \
--cc=reinette.chatre@intel.com \
--cc=x86@kernel.org \
--cc=yang.zhong@intel.com \
/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