asamy / ksm

A fast, hackable and simple x64 VT-x hypervisor for Windows and Linux. Builtin userspace sandbox and introspection engine.
https://asamy.github.io/ksm/
GNU General Public License v2.0
826 stars 181 forks source link

read_vmcs(GUEST_CR3) error #31

Open sctb512 opened 4 years ago

sctb512 commented 4 years ago

Type of this issue (please specify)

System information

  1. CPU: inrel core i5-6200u
  2. Kernel: linux
  3. Kernel version: 3.16.0-23-generic

Issue description

I want to execute read_vmcs(GUEST_CR3), but it occurs errors. I want to creat a model for EPT translating. what should i do? Thanks.

open_device(); do_ioctl(dev, KSM_IOCTL_SUBVERT, NULL, 0); do_ioctl(dev, KSM_MY_EPT_START, NULL, 0); do_ioctl(dev, KSM_MY_EPT_HANDLE, NULL, 0); ......

case KSM_MY_EPT_HANDLE: ...... cr3 = vmcs_read(GUEST_CR3);

For Linux

Expected Behavior

read cr3 of guest and translate EPT from gva to hpa.