File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ static void __noreturn tdx_panic(const char *msg)
194
194
__tdx_hypercall (& args );
195
195
}
196
196
197
- static void tdx_parse_tdinfo (u64 * cc_mask )
197
+ static void tdx_setup (u64 * cc_mask )
198
198
{
199
199
struct tdx_module_args args = {};
200
200
unsigned int gpa_width ;
@@ -219,6 +219,9 @@ static void tdx_parse_tdinfo(u64 *cc_mask)
219
219
gpa_width = args .rcx & GENMASK (5 , 0 );
220
220
* cc_mask = BIT_ULL (gpa_width - 1 );
221
221
222
+ /* Kernel does not use NOTIFY_ENABLES and does not need random #VEs */
223
+ tdg_vm_wr (TDCS_NOTIFY_ENABLES , 0 , -1ULL );
224
+
222
225
/*
223
226
* The kernel can not handle #VE's when accessing normal kernel
224
227
* memory. Ensure that no #VE will be delivered for accesses to
@@ -969,11 +972,11 @@ void __init tdx_early_init(void)
969
972
setup_force_cpu_cap (X86_FEATURE_TSC_RELIABLE );
970
973
971
974
cc_vendor = CC_VENDOR_INTEL ;
972
- tdx_parse_tdinfo (& cc_mask );
973
- cc_set_mask (cc_mask );
974
975
975
- /* Kernel does not use NOTIFY_ENABLES and does not need random #VEs */
976
- tdg_vm_wr (TDCS_NOTIFY_ENABLES , 0 , -1ULL );
976
+ /* Configure the TD */
977
+ tdx_setup (& cc_mask );
978
+
979
+ cc_set_mask (cc_mask );
977
980
978
981
/*
979
982
* All bits above GPA width are reserved and kernel treats shared bit
You can’t perform that action at this time.
0 commit comments