WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] x86: clean up building in mm/hap/

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86: clean up building in mm/hap/
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Fri, 29 Apr 2011 11:35:32 +0100
Delivery-date: Fri, 29 Apr 2011 03:35:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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>

--- a/xen/arch/x86/mm/hap/Makefile
+++ b/xen/arch/x86/mm/hap/Makefile
@@ -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 $@
--- a/xen/arch/x86/mm/hap/guest_walk.c
+++ b/xen/arch/x86/mm/hap/guest_walk.c
@@ -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_PA
     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:



Attachment: i386-hap-no-walk-l4.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86: clean up building in mm/hap/, Jan Beulich <=