]> xenbits.xensource.com Git - xen.git/commitdiff
x86: clean up building in mm/hap/
authorJan Beulich <jbeulich@novell.com>
Sun, 1 May 2011 09:16:54 +0000 (10:16 +0100)
committerJan Beulich <jbeulich@novell.com>
Sun, 1 May 2011 09:16:54 +0000 (10:16 +0100)
Building 4-level guest walks is unnecessary for x86-32, and with this
no longer being built the fallback code used here isn't necessary
anymore either.

Additonally the mechanism to determine the value of
GUEST_PAGING_LEVELS to be passed to the compiler can be much
simplified given that we're using a pattern rule here.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/mm/hap/Makefile
xen/arch/x86/mm/hap/guest_walk.c

index 49716d2a40c6979c910eb65510e50b75d40353cd..8e0ab38f655b9fe5a0897f8ffd7995fead3d13a4 100644 (file)
@@ -1,12 +1,9 @@
 obj-y += hap.o
 obj-y += guest_walk_2level.o
 obj-y += guest_walk_3level.o
-obj-y += guest_walk_4level.o
+obj-$(x86_64) += guest_walk_4level.o
 obj-y += p2m-ept.o
 obj-y += nested_hap.o
 
-guest_levels  = $(subst level,,$(filter %level,$(subst ., ,$(subst _, ,$(1)))))
-guest_walk_defns = -DGUEST_PAGING_LEVELS=$(call guest_levels,$(1))
-
 guest_walk_%level.o: guest_walk.c Makefile
-       $(CC) $(CFLAGS) $(call guest_walk_defns,$(@F)) -c $< -o $@
+       $(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
index 8bbf9dbf957f35c198ce4ee841ac26336a578d8e..cb8548222fd51efa9535c90a768df23097515576 100644 (file)
@@ -32,7 +32,9 @@
 #define _hap_p2m_ga_to_gfn(levels) hap_p2m_ga_to_gfn_##levels##_levels
 #define hap_p2m_ga_to_gfn(levels) _hap_p2m_ga_to_gfn(levels)
 
-#if GUEST_PAGING_LEVELS <= CONFIG_PAGING_LEVELS
+#if GUEST_PAGING_LEVELS > CONFIG_PAGING_LEVELS
+#error GUEST_PAGING_LEVELS must not exceed CONFIG_PAGING_LEVELS
+#endif
 
 #include <asm/guest_pt.h>
 #include <asm/p2m.h>
@@ -119,28 +121,6 @@ unsigned long hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)(
     return INVALID_GFN;
 }
 
-#else
-
-unsigned long hap_gva_to_gfn(GUEST_PAGING_LEVELS)(
-    struct vcpu *v, struct p2m_domain *p2m, unsigned long gva, uint32_t *pfec)
-{
-    gdprintk(XENLOG_ERR,
-             "Guest paging level is greater than host paging level!\n");
-    domain_crash(v->domain);
-    return INVALID_GFN;
-}
-
-unsigned long hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)(
-    struct vcpu *v, struct p2m_domain *p2m, unsigned long cr3,
-    paddr_t ga, uint32_t *pfec)
-{
-    gdprintk(XENLOG_ERR,
-             "Guest paging level is greater than host paging level!\n");
-    domain_crash(v->domain);
-    return INVALID_GFN;
-}
-#endif
-
 
 /*
  * Local variables: