The guest_physical_to_physical function translates a guest physical address to a host physical address. The cpu_mode argument sets the processor mode for the lookup. Access type is defined by access. The function returns a physical_block_t struct with valid bit and the address. The host physical address is valid when the valid flag is not 0. The function also returns block_start and block_end. The start and end of a block has the same linear mapping as the translated address. The range is inclusive, so block_end should be the address of the last byte of the block. This information can be used to figure out how often the function needs to be called for traversing larger address ranges.
If the chosen processor's current mode does not use EPT translation, the function should use the identity mapping between guest and host physical addresses. An example of such situation would be an x86 processor outside of VMX non-root mode or with EPT controls disabled.
To check if the processor's current VMCS state has EPT enabled, is_ept_active function should be used.
SIM_INTERFACE(x86_ept) { physical_block_t (*guest_physical_to_physical)( conf_object_t *obj, generic_address_t address, x86_processor_mode_t cpu_mode, access_t access); bool (*is_ept_active)(conf_object_t* obj); }; #define X86_EPT_INTERFACE "x86_ept"