# define BDOOR_CMD_FAS_GET_PLATFORM_NAME 2
#define BDOOR_CMD_SENDPSHAREHINTS 66
#define BDOOR_CMD_ENABLE_USB_MOUSE 67
-#define BDOOR_CMD_MAX 68
+#define BDOOR_CMD_GET_VCPU_INFO 68
+# define BDOOR_CMD_VCPU_SLC64 0
+#define BDOOR_CMD_MAX 69
/*
DWORD Hostinfo_OpenProcessBits(void);
#endif
extern Bool Hostinfo_NestingSupported(void);
+extern Bool Hostinfo_SLC64Supported(void);
extern Bool Hostinfo_TouchBackDoor(void);
extern Bool Hostinfo_TouchVirtualPC(void);
extern Bool Hostinfo_TouchXen(void);
#define CPUID_AMD_VENDOR_STRING "AuthcAMDenti"
#define CPUID_CYRIX_VENDOR_STRING "CyriteadxIns"
#define CPUID_VIA_VENDOR_STRING "CentaulsaurH"
+
#define CPUID_HYPERV_HYPERVISOR_VENDOR_STRING "Microsoft Hv"
#define CPUID_KVM_HYPERVISOR_VENDOR_STRING "KVMKVMKVM\0\0\0"
#define CPUID_VMWARE_HYPERVISOR_VENDOR_STRING "VMwareVMware"
#define CPUID_XEN_HYPERVISOR_VENDOR_STRING "XenVMMXenVMM"
+
#define CPUID_INTEL_VENDOR_STRING_FIXED "GenuineIntel"
#define CPUID_AMD_VENDOR_STRING_FIXED "AuthenticAMD"
#define CPUID_CYRIX_VENDOR_STRING_FIXED "CyrixInstead"
}
+/*
+ *----------------------------------------------------------------------
+ *
+ * Hostinfo_SLC64Supported --
+ *
+ * Access the backdoor with an SLC64 control query. This is used
+ * to determine if we are running inside a VM that supports SLC64.
+ * This function should only be called after determining that the
+ * backdoor is present with Hostinfo_TouchBackdoor().
+ *
+ * Results:
+ * TRUE if the outer VM supports SLC64.
+ * FALSE otherwise.
+ *
+ * Side effects:
+ * Exception if not in a VM, so don't do that!
+ *
+ *----------------------------------------------------------------------
+ */
+
+Bool
+Hostinfo_SLC64Supported(void)
+{
+#if defined(__i386__) || defined(__x86_64__)
+ uint32 result;
+ __asm__ __volatile__(
+ "inl %%dx, %%eax"
+ : "=a" (result)
+ : "0" (BDOOR_MAGIC),
+ "c" (BDOOR_CMD_GET_VCPU_INFO),
+ "d" (BDOOR_PORT)
+ );
+ return (result & (1 << BDOOR_CMD_VCPU_SLC64)) != 0;
+#endif
+ return FALSE;
+}
+
+
/*
*----------------------------------------------------------------------
*