File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1218,12 +1218,24 @@ static void override_uefi_vmcs(struct vcpu *vcpu)
1218
1218
& vcpu -> arch_vcpu .contexts [vcpu -> arch_vcpu .cur_context ];
1219
1219
1220
1220
if (get_vcpu_mode (vcpu ) == PAGE_PROTECTED_MODE ) {
1221
- cur_context -> cr3 = (uint64_t )efi_ctx -> cr3 | CR3_PWT ;
1221
+ /* Set up guest CR0 field */
1222
+ field = VMX_GUEST_CR0 ;
1223
+ cur_context -> cr0 = efi_ctx -> cr0 | CR0_PG | CR0_PE | CR0_NE ;
1224
+ exec_vmwrite (field , cur_context -> cr0 & 0xFFFFFFFF );
1225
+ pr_dbg ("VMX_GUEST_CR0: 0x%016llx " , cur_context -> cr0 );
1226
+
1222
1227
/* Set up guest CR3 field */
1223
1228
field = VMX_GUEST_CR3 ;
1229
+ cur_context -> cr3 = efi_ctx -> cr3 ;
1224
1230
exec_vmwrite (field , cur_context -> cr3 & 0xFFFFFFFF );
1225
1231
pr_dbg ("VMX_GUEST_CR3: 0x%016llx " , cur_context -> cr3 );
1226
1232
1233
+ /* Set up guest CR4 field */
1234
+ field = VMX_GUEST_CR4 ;
1235
+ cur_context -> cr4 = efi_ctx -> cr4 | CR4_VMXE ;
1236
+ exec_vmwrite (field , cur_context -> cr4 & 0xFFFFFFFF );
1237
+ pr_dbg ("VMX_GUEST_CR4: 0x%016llx " , cur_context -> cr4 );
1238
+
1227
1239
/* Selector */
1228
1240
field = VMX_GUEST_CS_SEL ;
1229
1241
exec_vmwrite (field , efi_ctx -> cs_sel );
You can’t perform that action at this time.
0 commit comments