Date: Sun, 19 Jul 2009 20:39:19 -0400 From: Christopher Thunes <c2thunes@brewtab.com> To: Adrian Chadd <adrian@freebsd.org> Cc: freebsd-xen@freebsd.org Subject: Re: buildworld fails for rev195572 Message-ID: <4A63BCB7.8040702@brewtab.com> In-Reply-To: <d763ac660907190049p7c86ab9dg717f6ea59f9ce667@mail.gmail.com> References: <4A61CDA2.7020907@gmail.com> <d763ac660907190049p7c86ab9dg717f6ea59f9ce667@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------080804000500070103060902 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I've attached a patch to fix this issues (pr136271_fix.patch), but even after this was done the kernel still failed to build because of a linking issue. The linking failure is due to sys/i386/xen/pmap.c lacking a definition for pmap_page_set_memattr. The attached xen_pmap_fix.patch will add the definition which I copied out of src/sys/i386/i386/pmap.c. I don't know if this was reasonable to do, but it did compile and the kernel did at least attempt to boot on a Xen 3.2.1 machine I have. - Chris Thunes Adrian Chadd wrote: > I'm sure it's my fault and I'm sure it will be easy to fix. I'm just > busy on other projects at the moment. > > I'll commit a patch if someone figures out the fix and attaches it to > the relevant PR. > > Thanks, > > > > adrian > > 2009/7/18 Yury A. Buldakov <yury.buldakov@gmail.com>: >> %subj >> >> While doing >> make -DALWAYS_CHECK_MAKE buildkernel KERNCONF=XEN >> >> or >> cd /usr/src/sys/i386/compile/XEN >> make >> >> build fails with: >> ------ >> cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls >> -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes >> -Wpointer-arith -Winline - >> Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. >> -I../../.. -I../../../contrib/altq -D_KERNEL >> -DHAVE_KERNEL_OPTION_HEADERS -include o >> pt_global.h -fno-common -finline-limit=8000 --param >> inline-unit-growth=100 --param large-function-growth=1000 >> -mno-align-long-strings -mpreferred-stack-boun >> dary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding >> -fstack-protector -Werror ../../../xdr/xdr_mbuf.c >> cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls >> -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes >> -Wpointer-arith -Winline - >> Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. >> -I../../.. -I../../../contrib/altq -D_KERNEL >> -DHAVE_KERNEL_OPTION_HEADERS -include o >> pt_global.h -fno-common -finline-limit=8000 --param >> inline-unit-growth=100 --param large-function-growth=1000 >> -mno-align-long-strings -mpreferred-stack-boun >> dary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding >> -fstack-protector -Werror ../../../xdr/xdr_mem.c >> cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls >> -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes >> -Wpointer-arith -Winline - >> Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. >> -I../../.. -I../../../contrib/altq -D_KERNEL >> -DHAVE_KERNEL_OPTION_HEADERS -include o >> pt_global.h -fno-common -finline-limit=8000 --param >> inline-unit-growth=100 --param large-function-growth=1000 >> -mno-align-long-strings -mpreferred-stack-boun >> dary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding >> -fstack-protector -Werror ../../../xdr/xdr_reference.c >> cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls >> -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes >> -Wpointer-arith -Winline - >> Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. >> -I../../.. -I../../../contrib/altq -D_KERNEL >> -DHAVE_KERNEL_OPTION_HEADERS -include o >> pt_global.h -fno-common -finline-limit=8000 --param >> inline-unit-growth=100 --param large-function-growth=1000 >> -mno-align-long-strings -mpreferred-stack-boun >> dary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding >> -fstack-protector -Werror ../../../xdr/xdr_sizeof.c >> cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls >> -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes >> -Wpointer-arith -Winline - >> Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. >> -I../../.. -I../../../contrib/altq -D_KERNEL >> -DHAVE_KERNEL_OPTION_HEADERS -include o >> pt_global.h -fno-common -finline-limit=8000 --param >> inline-unit-growth=100 --param large-function-growth=1000 >> -mno-align-long-strings -mpreferred-stack-boun >> dary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding >> -fstack-protector -Werror ../../../xen/gnttab.c >> cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls >> -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes >> -Wpointer-arith -Winline - >> Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. >> -I../../.. -I../../../contrib/altq -D_KERNEL >> -DHAVE_KERNEL_OPTION_HEADERS -include o >> pt_global.h -fno-common -finline-limit=8000 --param >> inline-unit-growth=100 --param large-function-growth=1000 >> -mno-align-long-strings -mpreferred-stack-boun >> dary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding >> -fstack-protector -Werror ../../../xen/features.c >> cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls >> -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes >> -Wpointer-arith -Winline - >> Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. >> -I../../.. -I../../../contrib/altq -D_KERNEL >> -DHAVE_KERNEL_OPTION_HEADERS -include o >> pt_global.h -fno-common -finline-limit=8000 --param >> inline-unit-growth=100 --param large-function-growth=1000 >> -mno-align-long-strings -mpreferred-stack-boun >> dary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding >> -fstack-protector -Werror ../../../xen/evtchn/evtchn.c >> cc1: warnings being treated as errors >> ../../../xen/evtchn/evtchn.c:653: warning: initialization from >> incompatible pointer type >> *** Error code 1 >> >> Stop in /usr/src/sys/i386/compile/XEN. >> ----- >> >> If I try to build it with >> make WEARROR= >> I got this >> ----- >> ... >> cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls >> -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes >> -Wpointer-arith -Winline - >> Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. >> -I../../.. -I../../../contrib/altq -D_KERNEL >> -DHAVE_KERNEL_OPTION_HEADERS -include o >> pt_global.h -fno-common -finline-limit=8000 --param >> inline-unit-growth=100 --param large-function-growth=1000 >> -mno-align-long-strings -mpreferred-stack-boun >> dary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding >> -fstack-protector vnode_if.c >> :> hack.c >> cc -shared -nostdlib hack.c -o hack.So >> rm -f hack.c >> MAKE=make sh ../../../conf/newvers.sh XEN >> cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls >> -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes >> -Wpointer-arith -Winline - >> Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. >> -I../../.. -I../../../contrib/altq -D_KERNEL >> -DHAVE_KERNEL_OPTION_HEADERS -include o >> pt_global.h -fno-common -finline-limit=8000 --param >> inline-unit-growth=100 --param large-function-growth=1000 >> -mno-align-long-strings -mpreferred-stack-boun >> dary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding >> -fstack-protector vers.c >> linking kernel >> device_pager.o(.text+0x1a9): In function `dev_pager_getpages': >> : undefined reference to `pmap_page_set_memattr' >> device_pager.o(.text+0x1c5): In function `dev_pager_getpages': >> : undefined reference to `pmap_page_set_memattr' >> device_pager.o(.text+0x2a8): In function `dev_pager_getpages': >> : undefined reference to `pmap_page_set_memattr' >> device_pager.o(.text+0x4c0): In function `dev_pager_dealloc': >> : undefined reference to `pmap_page_set_memattr' >> vm_contig.o(.text+0x776): In function `kmem_alloc_contig': >> : undefined reference to `pmap_page_set_memattr' >> vm_page.o(.text+0x1536): more undefined references to >> `pmap_page_set_memattr' follow >> *** Error code 1 >> >> Stop in /usr/src/sys/i386/compile/XEN. >> ----- >> My config is almost default XEN config with commented out debug-related >> options. >> _______________________________________________ >> freebsd-xen@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-xen >> To unsubscribe, send any mail to "freebsd-xen-unsubscribe@freebsd.org" >> > _______________________________________________ > freebsd-xen@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-xen > To unsubscribe, send any mail to "freebsd-xen-unsubscribe@freebsd.org" --------------080804000500070103060902 Content-Type: text/x-diff; name="pr136271_fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pr136271_fix.patch" diff -burN src-old/sys/xen/evtchn/evtchn.c src/sys/xen/evtchn/evtchn.c --- src-old/sys/xen/evtchn/evtchn.c 2009-05-30 08:53:13.000000000 +0000 +++ src/sys/xen/evtchn/evtchn.c 2009-07-19 14:28:54.000000000 +0000 @@ -626,7 +626,7 @@ static int xenpic_source_pending(struct intsrc *isrc); static void xenpic_suspend(struct pic* pic); static void xenpic_resume(struct pic* pic); -static void xenpic_assign_cpu(struct intsrc *, u_int apic_id); +static int xenpic_assign_cpu(struct intsrc *, u_int apic_id); struct pic xenpic_dynirq_template = { @@ -752,10 +752,11 @@ TODO; } -static void +static int xenpic_assign_cpu(struct intsrc *isrc, u_int apic_id) { TODO; + return 0; } void --------------080804000500070103060902 Content-Type: text/x-diff; name="xen_pmap_fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xen_pmap_fix.patch" --- src-old/sys/i386/xen/pmap.c 2009-07-12 19:31:20.000000000 -0400 +++ src/sys/i386/xen/pmap.c 2009-07-19 17:27:51.000000000 -0400 @@ -3921,6 +3921,24 @@ kmem_free(kernel_map, base, size); } +/* + * Sets the memory attribute for the specified page. + */ +void +pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) +{ + + m->md.pat_mode = ma; + + /* + * Flush CPU caches to make sure any data isn't cached that shouldn't + * be, etc. + */ + /* If "Self Snoop" is supported, do nothing. */ + if (!(cpu_feature & CPUID_SS)) + pmap_invalidate_cache(); +} + int pmap_change_attr(va, size, mode) vm_offset_t va; --------------080804000500070103060902--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A63BCB7.8040702>