From: "Jan Beulich" Subject: [PATCH] x86: clean up building in mm/hap/ Date: Fri, 29 Apr 2011 11:35:32 +0100 Message-ID: <4DBAB094020000780003EE38@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part6F439564.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part6F439564.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --- a/xen/arch/x86/mm/hap/Makefile +++ b/xen/arch/x86/mm/hap/Makefile @@ -1,12 +1,9 @@ obj-y +=3D hap.o obj-y +=3D guest_walk_2level.o obj-y +=3D guest_walk_3level.o -obj-y +=3D guest_walk_4level.o +obj-$(x86_64) +=3D guest_walk_4level.o obj-y +=3D p2m-ept.o obj-y +=3D nested_hap.o =20 -guest_levels =3D $(subst level,,$(filter %level,$(subst ., ,$(subst _, = ,$(1))))) -guest_walk_defns =3D -DGUEST_PAGING_LEVELS=3D$(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=3D$* -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) =20 -#if GUEST_PAGING_LEVELS <=3D CONFIG_PAGING_LEVELS +#if GUEST_PAGING_LEVELS > CONFIG_PAGING_LEVELS +#error GUEST_PAGING_LEVELS must not exceed CONFIG_PAGING_LEVELS +#endif =20 #include #include @@ -119,28 +121,6 @@ unsigned long hap_p2m_ga_to_gfn(GUEST_PA return INVALID_GFN; } =20 -#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 - =20 /* * Local variables: --=__Part6F439564.0__= Content-Type: text/plain; name="i386-hap-no-walk-l4.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="i386-hap-no-walk-l4.patch" Building 4-level guest walks is unnecessary for x86-32, and with this=0Ano = longer being built the fallback code used here isn't necessary=0Aanymore = either.=0A=0AAdditonally the mechanism to determine the value of GUEST_PAGI= NG_LEVELS=0Ato be passed to the compiler can be much simplified given that = we're=0Ausing a pattern rule here.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/arch/x86/mm/hap/Makefile=0A+++ = b/xen/arch/x86/mm/hap/Makefile=0A@@ -1,12 +1,9 @@=0A obj-y +=3D hap.o=0A = obj-y +=3D guest_walk_2level.o=0A obj-y +=3D guest_walk_3level.o=0A-obj-y = +=3D guest_walk_4level.o=0A+obj-$(x86_64) +=3D guest_walk_4level.o=0A = obj-y +=3D p2m-ept.o=0A obj-y +=3D nested_hap.o=0A =0A-guest_levels =3D = $(subst level,,$(filter %level,$(subst ., ,$(subst _, ,$(1)))))=0A-guest_wa= lk_defns =3D -DGUEST_PAGING_LEVELS=3D$(call guest_levels,$(1))=0A-=0A = guest_walk_%level.o: guest_walk.c Makefile=0A- $(CC) $(CFLAGS) $(call = guest_walk_defns,$(@F)) -c $< -o $@=0A+ $(CC) $(CFLAGS) -DGUEST_PAGING_LEVE= LS=3D$* -c $< -o $@=0A--- a/xen/arch/x86/mm/hap/guest_walk.c=0A+++ = b/xen/arch/x86/mm/hap/guest_walk.c=0A@@ -32,7 +32,9 @@=0A #define = _hap_p2m_ga_to_gfn(levels) hap_p2m_ga_to_gfn_##levels##_levels=0A #define = hap_p2m_ga_to_gfn(levels) _hap_p2m_ga_to_gfn(levels)=0A =0A-#if GUEST_PAGIN= G_LEVELS <=3D CONFIG_PAGING_LEVELS=0A+#if GUEST_PAGING_LEVELS > CONFIG_PAGI= NG_LEVELS=0A+#error GUEST_PAGING_LEVELS must not exceed CONFIG_PAGING_LEVEL= S=0A+#endif=0A =0A #include =0A #include =0A@@ = -119,28 +121,6 @@ unsigned long hap_p2m_ga_to_gfn(GUEST_PA=0A return = INVALID_GFN;=0A }=0A =0A-#else=0A-=0A-unsigned long hap_gva_to_gfn(GUEST_PA= GING_LEVELS)(=0A- struct vcpu *v, struct p2m_domain *p2m, unsigned long = gva, uint32_t *pfec)=0A-{=0A- gdprintk(XENLOG_ERR,=0A- = "Guest paging level is greater than host paging level!\n");=0A- = domain_crash(v->domain);=0A- return INVALID_GFN;=0A-}=0A-=0A-unsigned = long hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)(=0A- struct vcpu *v, struct = p2m_domain *p2m, unsigned long cr3,=0A- paddr_t ga, uint32_t *pfec)=0A-{= =0A- gdprintk(XENLOG_ERR,=0A- "Guest paging level is = greater than host paging level!\n");=0A- domain_crash(v->domain);=0A- = return INVALID_GFN;=0A-}=0A-#endif=0A-=0A =0A /*=0A * Local variables:=0A --=__Part6F439564.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part6F439564.0__=--