- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Enrvironment:
Kernel Version: 4.18.19 (compiled from source)
Processor: Intel i7-7700k
OS: Ubuntu 16.04
I am trying to play with VMFUNC, and I need to enable and prepare eptp list in kvm. However, I find that writing to EPTP_LIST_ADDRESS(which is offset 2024) and VM_FUNCTION_CONTROL(which is 2018) will (almost) always cause a vmwrite error.
For example, the following line
vmcs_write64(EPTP_LIST_ADDRESS, 0);
will give this error in dmesg
[167.780855] vmwirte error: reg 2024 value 0 (err 1)
And if I write the actual physical address of a page into it, I get
[167.786527] vmwrite error: reg 2024 value 68cbd15ff840 (err -782239680)
Note that -782239680 seems to be 0xd15ff840
There is similar error when writing to VM_FUNCTION_CONTROL field, but not other fileds. I am sure that my cpu has VMFUNC by the following 2 functions
static inline bool cpu_has_vmx_vmfunc(void) { return vmcs_config_cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_ENABLE_VMFUNC; } static inline bool cpu_has_vmx_eptp_switching(void) { u64 vmx_msr; rdmsrl(MSR_IA32_VMX_VMFUNC, vmx_msr); return vmx_msr & 0x1; }
Both functions return true, so I think my process do support such features.
Why is problem happening, am I missing anything? Thanks.
- Tags:
- Virtualization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey Zihan.Y, for what you are doing I need a bit more information to help you. Are you writing your code in kernel space or user space?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page