xenpaging: Add a check to Xen for EPT.
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 28 Jul 2010 06:54:40 +0000 (07:54 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 28 Jul 2010 06:54:40 +0000 (07:54 +0100)
There isn't seem to be a way to directly check for EPT, so instead
check for HAP and an Intel processor. If EPT isn't enabled, then
return an error to the tool.

Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
xen/arch/x86/mm/mem_event.c

index 5584328dd638ea7fcce48e152284cf03eeea0ab8..5ffd040d2b7556e406ef14d26c8c367a57135a8a 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 
+#include <asm/domain.h>
 #include <xen/event.h>
 #include <asm/p2m.h>
 #include <asm/mem_event.h>
@@ -225,6 +226,12 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
             mfn_t ring_mfn;
             mfn_t shared_mfn;
 
+            /* Currently only EPT is supported */
+            rc = -ENODEV;
+            if ( !(hap_enabled(d) &&
+                  (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)) )
+                break;
+
             /* Get MFN of ring page */
             guest_get_eff_l1e(v, ring_addr, &l1e);
             gfn = l1e_get_pfn(l1e);