# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1304241414 -3600
# Node ID e2fb962d13ffd6e848c263c8a54ee0b089d7bc1c
# Parent 485b7c5e6f1719606be68cae3c413836f113cc56
x86: clean up building in mm/hap/
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@xxxxxxxxxx>
---
diff -r 485b7c5e6f17 -r e2fb962d13ff xen/arch/x86/mm/hap/Makefile
--- a/xen/arch/x86/mm/hap/Makefile Sun May 01 10:15:11 2011 +0100
+++ b/xen/arch/x86/mm/hap/Makefile Sun May 01 10:16:54 2011 +0100
@@ -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 $@
diff -r 485b7c5e6f17 -r e2fb962d13ff xen/arch/x86/mm/hap/guest_walk.c
--- a/xen/arch/x86/mm/hap/guest_walk.c Sun May 01 10:15:11 2011 +0100
+++ b/xen/arch/x86/mm/hap/guest_walk.c Sun May 01 10:16:54 2011 +0100
@@ -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 @@
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:
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|