#include <asm/mem_access.h>
#include <public/mem_event.h>
#include <xen/rangeset.h>
+#include <public/arch-x86/cpuid.h>
bool_t __read_mostly hvm_enabled;
*eax = *ebx = *ecx = *edx = 0;
if ( hvm_funcs.hypervisor_cpuid_leaf )
hvm_funcs.hypervisor_cpuid_leaf(sub_idx, eax, ebx, ecx, edx);
+
+ if ( sub_idx == 0 )
+ {
+ /*
+ * Indicate that memory mapped from other domains (either grants or
+ * foreign pages) has valid IOMMU entries.
+ */
+ *eax |= XEN_HVM_CPUID_IOMMU_MAPPINGS;
+ }
}
void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
/* EAX Features */
#define XEN_HVM_CPUID_APIC_ACCESS_VIRT (1u << 0) /* Virtualized APIC registers */
#define XEN_HVM_CPUID_X2APIC_VIRT (1u << 1) /* Virtualized x2APIC accesses */
+/* Memory mapped from other domains has valid IOMMU entries */
+#define XEN_HVM_CPUID_IOMMU_MAPPINGS (1u << 2)
#define XEN_CPUID_MAX_NUM_LEAVES 4