diff options
Diffstat (limited to 'target-i386/hax-interface.h')
-rw-r--r-- | target-i386/hax-interface.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/target-i386/hax-interface.h b/target-i386/hax-interface.h index 5a9ed31..22d4acc 100644 --- a/target-i386/hax-interface.h +++ b/target-i386/hax-interface.h @@ -316,6 +316,14 @@ enum exit_status { * Now the vcpu is only paused when to be destroid, so simply return to hax */ HAX_EXIT_PAUSED, + /* from API 2.0 */ + /* + * In API 1.0, HAXM driver utilizes QEMU to decode and emulate MMIO + * operations. + * From 2.0, HAXM driver will decode some MMIO instructions to improve + * MMIO handling performance, especially for GLES hardware acceleration + */ + HAX_EXIT_FAST_MMIO, }; /* @@ -328,6 +336,15 @@ struct hax_module_version uint32_t cur_version; }; +/* This interface is support only after API version 2 */ +struct hax_qemu_version +{ + /* Current API version in QEMU*/ + uint32_t cur_version; + /* The least API version supported by QEMU */ + uint32_t least_version; +}; + /* See comments for HAX_VM_IOCTL_ALLOC_RAM ioctl */ struct hax_alloc_ram_info { @@ -347,4 +364,55 @@ struct hax_set_ram_info uint64_t va; }; +/* + * We need to load the HAXM (HAX Manager) to tell if the host system has the + * required capabilities to operate, and we use hax_capabilityinfo to get such + * info from HAXM. + * + * To prevent HAXM from over-consuming RAM, we set the maximum amount of RAM + * that can be used for guests at HAX installation time. Once the quota is + * reached, HAXM will no longer attempt to allocate memory for guests. + * Detect that HAXM is out of quota can take the emulator to non-HAXM model + */ +struct hax_capabilityinfo +{ + /* bit 0: 1 - HAXM is working + * 0 - HAXM is not working possibly because VT/NX is disabled + NX means Non-eXecution, aks. XD (eXecution Disable) + * bit 1: 1 - HAXM has hard limit on how many RAM can be used as guest RAM + * 0 - HAXM has no memory limitation + */ +#define HAX_CAP_STATUS_WORKING 0x1 +#define HAX_CAP_STATUS_NOTWORKING 0x0 +#define HAX_CAP_WORKSTATUS_MASK 0x1 +#define HAX_CAP_MEMQUOTA 0x2 + uint16_t wstatus; + /* + * valid when HAXM is not working + * bit 0: HAXM is not working because VT is not enabeld + * bit 1: HAXM is not working because NX not enabled + */ +#define HAX_CAP_FAILREASON_VT 0x1 +#define HAX_CAP_FAILREASON_NX 0x2 + uint16_t winfo; + uint32_t pad; + uint64_t mem_quota; +}; + +/* API 2.0 */ + +struct hax_fastmmio +{ + uint64_t gpa; + uint64_t value; + uint8_t size; + uint8_t direction; + uint16_t reg_index; + uint32_t pad0; + uint64_t _cr0; + uint64_t _cr2; + uint64_t _cr3; + uint64_t _cr4; +}; + #endif |