bdpayne/libvmi — pull request #120 by tklengyel (2013-10-31 16:48:15+00:00)
Title: Restrict use VMI_MEMACCESS_R and VMI_MEMACCESS_RX for Xen

While testing the events subsystem I encountered guest crashes when setting a page with either VMI_MEMACCESS_R or VMI_MEMACCESS_RX and trying to read from the page in the guest. The crash reason was given as bad vmexit 0x31 (EXIT_REASON_EPT_MISCONFIG), currently unhandled by Xen.

According to the Intel manual this is an expected behavior:
Intel® 64 and IA-32 Architectures Software Developer’s Manual
* 8.2.3.1 EPT Misconfigurations
* AN EPT misconfiguration occurs if any of the following is identified while translating a guest-physical address:
* * The value of bits 2:0 of an EPT paging-structure entry is either 010b (write-only) or 110b (write/execute).

So while Xen allows us to set the EPT flags to write-only or write-execute-only without any warning, we should catch it in here because these flags are in effect unusable with Xen.