File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,11 @@ static int hardware_detect_support(void)
211
211
return - ENODEV ;
212
212
}
213
213
214
+ if (!cpu_has_vmx_unrestricted_guest_cap ()) {
215
+ pr_fatal ("%s, unrestricted guest not supported\n" , __func__ );
216
+ return - ENODEV ;
217
+ }
218
+
214
219
ret = check_vmx_mmu_cap ();
215
220
if (ret )
216
221
return ret ;
Original file line number Diff line number Diff line change 390
390
/* CR4 bits hv want to trap to track status change */
391
391
#define CR4_TRAP_MASK (CR4_PSE | CR4_PAE)
392
392
393
+ #define VMX_SUPPORT_UNRESTRICTED_GUEST (1<<5)
394
+
393
395
/* External Interfaces */
394
396
int exec_vmxon_instr (void );
395
397
uint64_t exec_vmread (uint32_t field );
@@ -410,11 +412,15 @@ static inline uint8_t get_vcpu_mode(struct vcpu *vcpu)
410
412
return vcpu -> arch_vcpu .cpu_mode ;
411
413
}
412
414
415
+ static inline bool cpu_has_vmx_unrestricted_guest_cap (void )
416
+ {
417
+ return !!(msr_read (MSR_IA32_VMX_MISC ) & VMX_SUPPORT_UNRESTRICTED_GUEST );
418
+ }
419
+
413
420
typedef struct _descriptor_table_ {
414
421
uint16_t limit ;
415
422
uint64_t base ;
416
423
}__attribute__((packed )) descriptor_table ;
417
-
418
424
#endif /* ASSEMBLER */
419
425
420
426
#endif /* VMX_H_ */
You can’t perform that action at this time.
0 commit comments