This repository was archived by the owner on Jun 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +23
-1
lines changed
Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 11* .ko
22* .o
33* .cmd
4+ * .mod
45* .mod. *
56* .symvers
67* .order
Original file line number Diff line number Diff line change @@ -23,4 +23,4 @@ install: default
2323endif
2424
2525clean :
26- rm -vrf * .o * .ko * .order * .symvers * .mod.c .tmp_versions .* o.cmd
26+ rm -vrf * .o * .ko * .order * .symvers * .mod.c .tmp_versions .* o.cmd * .mod
Original file line number Diff line number Diff line change 7979#define SGX_EDMM_SPIN_COUNT 20
8080
8181#define SGX_VA_SLOT_COUNT 512
82+ #ifndef MSR_IA32_SGXLEPUBKEYHASH0
83+ #define MSR_IA32_SGXLEPUBKEYHASH0 0x0000008C
84+ #define MSR_IA32_SGXLEPUBKEYHASH1 0x0000008D
85+ #define MSR_IA32_SGXLEPUBKEYHASH2 0x0000008E
86+ #define MSR_IA32_SGXLEPUBKEYHASH3 0x0000008F
87+ #endif
8288
8389struct sgx_epc_page {
8490 resource_size_t pa ;
Original file line number Diff line number Diff line change @@ -184,6 +184,15 @@ static int sgx_pm_suspend(struct device *dev)
184184 return 0 ;
185185}
186186
187+ static void sgx_reset_pubkey_hash (void * failed )
188+ {
189+ if (wrmsrl_safe (MSR_IA32_SGXLEPUBKEYHASH0 , 0xa6053e051270b7acULL ) ||
190+ wrmsrl_safe (MSR_IA32_SGXLEPUBKEYHASH1 , 0x6cfbe8ba8b3b413dULL ) ||
191+ wrmsrl_safe (MSR_IA32_SGXLEPUBKEYHASH2 , 0xc4916d99f2b3735dULL ) ||
192+ wrmsrl_safe (MSR_IA32_SGXLEPUBKEYHASH3 , 0xd4f8c05909f9bb3bULL ))
193+ * (int * )failed = - EIO ;
194+ }
195+
187196static SIMPLE_DEV_PM_OPS (sgx_drv_pm , sgx_pm_suspend , NULL) ;
188197
189198static int sgx_dev_init (struct device * parent )
@@ -193,6 +202,7 @@ static int sgx_dev_init(struct device *parent)
193202 unsigned long size ;
194203 int ret ;
195204 int i ;
205+ int msr_reset_failed = 0 ;
196206
197207 pr_info ("intel_sgx: " DRV_DESCRIPTION " v" DRV_VERSION "\n" );
198208
@@ -271,6 +281,11 @@ static int sgx_dev_init(struct device *parent)
271281 goto out_workqueue ;
272282 }
273283
284+ on_each_cpu (sgx_reset_pubkey_hash , & msr_reset_failed , 1 );
285+ if (msr_reset_failed ) {
286+ pr_info ("intel_sgx: can not reset SGX LE public key hash MSRs\n" );
287+ }
288+
274289 return 0 ;
275290out_workqueue :
276291 destroy_workqueue (sgx_add_page_wq );
You can’t perform that action at this time.
0 commit comments