Hello, I''ve made a first pass at modifying the Fedora Rawhide xen and kernel rpms to support ia64. There is still a lot of work to do before this would be suitable for inclusion in Fedora, but hopefully this represents a proof-of-concept that can be improved to that point. If you''d like to browse or contribute, the bits are available as mercurial repositories at: http://free.linux.hp.com/~agriffis/ There are 5 repositories presently: fedora-xen-rpm Tracks xen.src.rpm from rawhide. fedora-xen-ia64 Pulls from fedora-xen-rpm, contains (trivial) modifications for ia64 fedora-kernel-rpm Tracks kernel.src.rpm from rawhide. fedora-kernel-ia64 Pulls from fedora-kernel-rpm, contains modifications for ia64 xen-ia64-unstable-2.6.17 Forward port of xen-ia64-unstable sparse tree from 2.6.16.13 to 2.6.17, generates linux-2.6-xen.patch for fedora-kernel-ia64 Here is my non-comprehensive list of notes/issues for fedora-kernel-ia64: 1. Upstream xen is presently based on 2.6.16.13. Fedora kernel is (or was yesterday) based on 2.6.17-rc4-git5. To port xen forward, the most maintainable method seems to be to do the port in the context of a xen-ia64-unstable mercurial clone (xen-ia64-unstable-2.6.17 above). Using this method makes it relatively easy to: (a) port forward to a new kernel at any time using the sparse-merge script (b) pull new changes from upstream xen and avoid most manual merging (c) extract a patch at any time that represents the forward-port of xen to a new kernel (d) generate a patch at any time that adds xen support to the fedora kernel (linux-2.6-xen.patch generated with "make mkpatches") The only caveat here is that I probably didn''t do the forward port perfectly. In particular I know I bungled the TPM stuff because there are lots of changes going into kernel.org and xen simultaneously. Additionally I didn''t pay a lot of attention to other architectures for the moment. Hopefully 2.6.17 will pop any day now, then xen upstream will move to it, and we won''t have to carry the forward port in the Fedora patch. If by some chance this doesn''t happen, then my forward porting work will need to be revisited. 2. This first pass was created using the xen-ia64-unstable repo instead of the xen-unstable repo. This is because xen-unstable is broken recently on ia64. When the two have been resynced upstream, and xen-unstable works on ia64, we should move this prototype to using xen-unstable (which is what the current Fedora Xen patch is based on). 3. The bare metal config is built for Generic. The xen0 and xenU configs are built for DIG-Compliant. It seems that the kernel won''t build for Generic with CONFIG_XEN enabled. Using DIG-compliant for the xen kernels is probably okay for now, but it would be good to get Generic building. 4. After applying patch700 (linux-2.6-xen.patch), the spec file executes xen-mkbuildtree-pre if it exists for the architecture. In effect, this is applying an ia64-specific patch, even though it looks more generic in the spec. The special modifications being made by xen-mkbuildtree-pre need to be folded into linux-2.6-xen.patch to prevent architecture-specific maintenance headaches in the stack of Fedora kernel patches. 5. My forward port broke the exec-shield patch application. Juan has this resolved in his version, but that''s based on an older xen-unstable changeset. I commented out patch810-812 for the moment. 6. The xen patch is missing some function prototypes. (I believe this is a problem in xen upstream not something introduced by my port.) The Fedora kernel build normally turns on -Werror-implicit-function-declaration in patch1018 (linux-2.6-debug-Wundef.patch). I commented out this patch for the moment. 7. The hypervisor doesn''t build on ia64 with "debug=y verbose=y crash_debug=y". For the moment it builds with default flags on ia64 instead. 8. /sbin/new-kernel-pkg doesn''t handle installation of the hypervisor to the EFI partition. This should be a trivial fix. 9. Various other rpms need trivial updates to build/install on ia64, for example libvirt. 10. Anaconda needs updates to handle installation of xen on ia64 (interaction with elilo, etc) 11. After finally getting a full build, I tested it once on my rx2620. The hypervisor booted, but the console didn''t get hooked up for xen0, and eventually the machine reset. Hopefully these are trivial configuration or elilo.conf updates, but there may be more work involved. If you''d like to build these rpms for yourself, here''s the quick and dirty guide (thanks Anil): hg clone http://free.linux.hp.com/~agriffis/fedora-kernel-ia64 # or http://free.linux.hp.com/~agriffis/fedora-xen-ia64 cd fedora-kernel-ia64 mkdir -p BUILD RPMS/ia64 source bashrc-snippet # might want this in your ~/.bashrc cd SPECS rpmbuild -ba kernel-2.6.spec Regards, Aron
Akio Takebe
2006-May-22 08:09 UTC
[Fedora-xen] Re: [Xen-ia64-devel] fedora-xen-ia64 first pass
Hi, Aron Which distro do you use on your rpmbuild system? Fedora5-ia64? or RHEL4? Cannot we completely make fedora-xen-ia64 yet? I had the following error. Did I have mistakes? + rm -rf /var/tmp/xen-3.0.2-4-root/usr/share/doc/xen-3.0.2 + /bin/mkdir -p /var/tmp/xen-3.0.2-4-root/usr/share/doc/xen-3.0.2 + cp -pr COPYING README /var/tmp/xen-3.0.2-4-root/usr/share/doc/xen-3.0.2 + cp -pr docs/pdf/ /var/tmp/xen-3.0.2-4-root/usr/share/doc/xen-3.0.2 + cp -pr docs/misc/ /var/tmp/xen-3.0.2-4-root/usr/share/doc/xen-3.0.2 + exit 0 warning: File listed twice: /usr/lib/xen warning: File listed twice: /usr/lib/xen/boot Provides: _pyext2.so()(64bit) acm.so()(64bit) config(xen) = 3.0.2-4 libxenctrl.so.3.0()(64bit) libxenguest.so.3.0()(64bit) libxenstore.so()(64bit) xc.so()(64bit) xs.so()(64bit) Requires(interp): /bin/sh /bin/sh Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires(post): /bin/sh Requires(preun): /bin/sh Requires: /bin/bash /bin/sh /usr/bin/env /usr/bin/python bridge-utils config(xen) = 3.0.2-4 libSDL-1.2.so.0()(64bit) libc.so.6.1()(64bit) libc.so.6.1(GLIBC_2.2)(64bit) libc.so.6. 1(GLIBC_2.3)(64bit) libc.so.6.1(GLIBC_2.3.4)(64bit) libc.so.6.1(GLIBC_2.4)(64bit) libext2fs.so.2()(64bit) libjpeg.so.62()(64bit) libm.so.6.1()(64bit) libncurses.so.5()(64bit) lib nsl.so.1()(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2)(64bit) libpthread.so.0(GLIBC_2.3.2)(64bit) libutil.so.1()(64bit) libutil.so.1(GLIBC_2.0)(64bit) libvirt-pyth on libxenctrl.so.3.0()(64bit) libxenguest.so.3.0()(64bit) libxenstore.so()(64bit) libz.so.1()(64bit) python(abi) = 2.4 python-abi = 2.4 udev >= 059 Processing files: xen-debuginfo-3.0.2-4 Provides: _pyext2.so.debug()(64bit) acm.so.debug()(64bit) libxenctrl.so.3.0.0.debug()(64bit) libxenguest.so.3.0.0.debug()(64bit) xc.so.debug()(64bit) xs.so.debug()(64bit) Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/xen-3.0.2-4-root warning: Could not canonicalize hostname: tiger72 error: Could not open /root/fedora/fedora-xen-ia64/SRPMS/xen-3.0.2-4.src.rpm: No such file or directory So I do the following step. Is this step the same as yours? 1. make rpm of kernel (as-is Anil''s step)> hg clone http://free.linux.hp.com/~agriffis/fedora-kernel-ia64 > cd fedora-kernel-ia64 > mkdir -p BUILD RPMS/ia64 > source bashrc-snippet # might want this in your ~/.bashrc > cd SPECS > rpmbuild -ba kernel-2.6.spec2. make xen # rpmbuild -bp xen.spec # cd ../BUILD/xen-unstable.hg/ # make xen # make tools # make install-tools # cp xen/xen.gz /boot/efi/efi/redhat/ Best Regards, Akio Takebe>Hello, > >I''ve made a first pass at modifying the Fedora Rawhide xen and kernel >rpms to support ia64. There is still a lot of work to do before this >would be suitable for inclusion in Fedora, but hopefully this >represents a proof-of-concept that can be improved to that point. > >If you''d like to browse or contribute, the bits are available as >mercurial repositories at: > > http://free.linux.hp.com/~agriffis/ > >There are 5 repositories presently: > > fedora-xen-rpm Tracks xen.src.rpm from rawhide. > > fedora-xen-ia64 Pulls from fedora-xen-rpm, contains > (trivial) modifications for ia64 > > fedora-kernel-rpm Tracks kernel.src.rpm from rawhide. > > fedora-kernel-ia64 Pulls from fedora-kernel-rpm, contains > modifications for ia64 > > xen-ia64-unstable-2.6.17 Forward port of xen-ia64-unstable > sparse tree from 2.6.16.13 to 2.6.17, > generates linux-2.6-xen.patch for > fedora-kernel-ia64 > >Here is my non-comprehensive list of notes/issues for >fedora-kernel-ia64: > >1. Upstream xen is presently based on 2.6.16.13. Fedora kernel is (or > was yesterday) based on 2.6.17-rc4-git5. To port xen forward, the > most maintainable method seems to be to do the port in the context > of a xen-ia64-unstable mercurial clone (xen-ia64-unstable-2.6.17 > above). Using this method makes it relatively easy to: > > (a) port forward to a new kernel at any time using the > sparse-merge script > > (b) pull new changes from upstream xen and avoid most manual > merging > > (c) extract a patch at any time that represents the forward-port > of xen to a new kernel > > (d) generate a patch at any time that adds xen support to the > fedora kernel (linux-2.6-xen.patch generated with "make > mkpatches") > > The only caveat here is that I probably didn''t do the forward port > perfectly. In particular I know I bungled the TPM stuff because > there are lots of changes going into kernel.org and xen > simultaneously. Additionally I didn''t pay a lot of attention to > other architectures for the moment. > > Hopefully 2.6.17 will pop any day now, then xen upstream will move > to it, and we won''t have to carry the forward port in the Fedora > patch. If by some chance this doesn''t happen, then my forward > porting work will need to be revisited. > >2. This first pass was created using the xen-ia64-unstable repo > instead of the xen-unstable repo. This is because xen-unstable is > broken recently on ia64. When the two have been resynced upstream, > and xen-unstable works on ia64, we should move this prototype to > using xen-unstable (which is what the current Fedora Xen patch is > based on). > >3. The bare metal config is built for Generic. The xen0 and xenU > configs are built for DIG-Compliant. It seems that the kernel > won''t build for Generic with CONFIG_XEN enabled. Using > DIG-compliant for the xen kernels is probably okay for now, but it > would be good to get Generic building. > >4. After applying patch700 (linux-2.6-xen.patch), the spec file > executes xen-mkbuildtree-pre if it exists for the architecture. > In effect, this is applying an ia64-specific patch, even though it > looks more generic in the spec. The special modifications being > made by xen-mkbuildtree-pre need to be folded into > linux-2.6-xen.patch to prevent architecture-specific maintenance > headaches in the stack of Fedora kernel patches. > >5. My forward port broke the exec-shield patch application. Juan has > this resolved in his version, but that''s based on an older > xen-unstable changeset. I commented out patch810-812 for the > moment. > >6. The xen patch is missing some function prototypes. (I believe this > is a problem in xen upstream not something introduced by my port.) > The Fedora kernel build normally turns on > -Werror-implicit-function-declaration in patch1018 > (linux-2.6-debug-Wundef.patch). I commented out this patch for the > moment. > >7. The hypervisor doesn''t build on ia64 with "debug=y verbose=y > crash_debug=y". For the moment it builds with default flags on > ia64 instead. > >8. /sbin/new-kernel-pkg doesn''t handle installation of the hypervisor > to the EFI partition. This should be a trivial fix. > >9. Various other rpms need trivial updates to build/install on ia64, > for example libvirt. > >10. Anaconda needs updates to handle installation of xen on ia64 > (interaction with elilo, etc) > >11. After finally getting a full build, I tested it once on my rx2620. > The hypervisor booted, but the console didn''t get hooked up for > xen0, and eventually the machine reset. Hopefully these are > trivial configuration or elilo.conf updates, but there may be more > work involved. > >If you''d like to build these rpms for yourself, here''s the quick and >dirty guide (thanks Anil): > > hg clone http://free.linux.hp.com/~agriffis/fedora-kernel-ia64 > # or http://free.linux.hp.com/~agriffis/fedora-xen-ia64 > cd fedora-kernel-ia64 > mkdir -p BUILD RPMS/ia64 > source bashrc-snippet # might want this in your ~/.bashrc > cd SPECS > rpmbuild -ba kernel-2.6.spec > >Regards, >Aron > >_______________________________________________ >Xen-ia64-devel mailing list >Xen-ia64-devel@lists.xensource.com >http://lists.xensource.com/xen-ia64-devel
Aron Griffis
2006-May-22 15:22 UTC
[Fedora-xen] Re: [Xen-ia64-devel] fedora-xen-ia64 first pass
Akio Takebe wrote: [Mon May 22 2006, 04:09:43AM EDT]> Which distro do you use on your rpmbuild system? > Fedora5-ia64? or RHEL4?Fedora Rawhide, ISO images available from ftp://oss.sgi.com/projects/fedora/download/weekly/> Cannot we completely make fedora-xen-ia64 yet? > I had the following error. Did I have mistakes? >[..snip..]> error: Could not open /root/fedora/fedora-xen-ia64/SRPMS/xen-3.0.2-4.src.rpm: No such file or directoryThis was the problem. The SRPMS directory does not exist. I updated bashrc-snippet to create this automatically, see fedora-kernel-ia64 cset 16.> So I do the following step. > Is this step the same as yours? > > 1. make rpm of kernel (as-is Anil''s step) > > hg clone http://free.linux.hp.com/~agriffis/fedora-kernel-ia64 > > cd fedora-kernel-ia64 > > mkdir -p BUILD RPMS/ia64 > > source bashrc-snippet # might want this in your ~/.bashrc > > cd SPECS > > rpmbuild -ba kernel-2.6.spec > > 2. make xen > # rpmbuild -bp xen.spec > # cd ../BUILD/xen-unstable.hg/ > # make xen > # make tools > # make install-tools > # cp xen/xen.gz /boot/efi/efi/redhat/Following full build of rpms, you should install the packages instead of installing manually. (I understand you installed manually here because the packages did not build completely... sorry!) However there are some dependencies needed from extras yet. While we are waiting for extras to be built in its entirety, I will supply a yum repository in a follow-up message. Regards, Aron
Akio Takebe
2006-May-23 04:59 UTC
[Fedora-xen] Re: [Xen-ia64-devel] fedora-xen-ia64 first pass
Hi, Aron Thank you for your help. I can make RPMS/ia64/xen-3.0.2-4.ia64.rpm. fedora-xen-ia64/RPMS/ia64/xen-3.0.2-4.ia64.rpm includes all tools of xen. (don''t includes xen(hypervisor) and domain''s kernel) But I cannot make fedora-kernel-ia64 yet. ====================== gcc -Wp,-MD,arch/ia64/kernel/.irq_lsapic.o.d -nostdinc -isystem /usr/lib/gcc/ia64-redhat-linux/4.1.0/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -DHAVE_W ORKING_TEXT_ALIGN -DHAVE_MODEL_SMALL_ATTRIBUTE -DHAVE_SERIALIZE_DIRECTIVE -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -fomit-frame-poin ter -g -pipe -ffixed-r13 -mfixed-range=f12-f15,f32-f127 -falign-functions=32 -frename-registers -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -mc onstant-gp -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(irq_lsapic)" -D"KBUILD_MODNAME=KBUILD_STR(irq_lsapic)" -c -o arch/ia64/kernel/.tmp_irq_lsapic.o arch/ia64/kernel/ir q_lsapic.c mm/page_alloc.c: In function ''alloc_node_mem_map'': mm/page_alloc.c:2143: error: ''MAX_ORDER_NR_PAGES'' undeclared (first use in this function) mm/page_alloc.c:2143: error: (Each undeclared identifier is reported only once mm/page_alloc.c:2143: error: for each function it appears in.) make[1]: *** [mm/page_alloc.o] Error 1 make: *** [mm] Error 2 make: *** Waiting for unfinished jobs.... ====================== This error is caused by SOURCES/linux-2.6-xen-ia64-10022.patch MAX_ORDER_NR_PAGES is not defined. What does this patch mean? ======================@@ -2124,14 +2127,22 @@ static void __init alloc_node_mem_map(st #ifdef CONFIG_FLAT_NODE_MEM_MAP /* ia64 gets its own node_mem_map, before this, without bootmem */ if (!pgdat->node_mem_map) { - unsigned long size; + unsigned long size, start, end; struct page *map; - size = (pgdat->node_spanned_pages + 1) * sizeof(struct page); + /* + * The zone''s endpoints aren''t required to be MAX_ORDER + * aligned but the node_mem_map endpoints must be in order + * for the buddy allocator to function correctly. + */ + start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1); + end = pgdat->node_start_pfn + pgdat->node_spanned_pages; + end = ALIGN(end, MAX_ORDER_NR_PAGES); + size = (end - start) * sizeof(struct page); map = alloc_remap(pgdat->node_id, size); if (!map) map = alloc_bootmem_node(pgdat, size); - pgdat->node_mem_map = map; + pgdat->node_mem_map = map + (pgdat->node_start_pfn - start); } #ifdef CONFIG_FLATMEM /* ================================== I''m not clear about directory construction. What do each directory mean? I want to know the following directory''s meaning. # ls -F fedora-kernel-ia64/BUILD/kernel-2.6.16/ Config.mk extract.pub kernel.pub kernel.sec linux-2.6.16.ia64/ pubring.gpg random_seed secring.gpg vanilla/ xen/ xen-10022/ Are kernels of domain0/domainU made at linux-2.6.16.ia64? If so, each linux-2.6.16.ia64 must be remade at each building time. Am I right? Best Regards, Akio Takebe
Aron Griffis
2006-May-23 12:45 UTC
[Fedora-xen] Re: [Xen-ia64-devel] fedora-xen-ia64 first pass
Hi Akio, Akio Takebe wrote: [Tue May 23 2006, 12:59:43AM EDT]> mm/page_alloc.c: In function ''alloc_node_mem_map'': > mm/page_alloc.c:2143: error: ''MAX_ORDER_NR_PAGES'' undeclared (first use in this function) > mm/page_alloc.c:2143: error: (Each undeclared identifier is reported only once > mm/page_alloc.c:2143: error: for each function it appears in.)This was due to a mistake on my part. I had mismatched kernel versions between the fedora kernel and the xen patch (-git9 vs. -git10). It should be fixed now in cset 21> I''m not clear about directory construction. > What do each directory mean? > I want to know the following directory''s meaning. > > # ls -F fedora-kernel-ia64/BUILD/kernel-2.6.16/ > Config.mk extract.pub kernel.pub kernel.sec linux-2.6.16.ia64/ > pubring.gpg random_seed secring.gpg vanilla/ xen/ xen-10022/ > > Are kernels of domain0/domainU made at linux-2.6.16.ia64? > If so, each linux-2.6.16.ia64 must be remade at each building time. > Am I right?That''s right. See the %build section of kernel-2.6.spec Regards, Aron
Akio Takebe
2006-May-23 12:58 UTC
[Fedora-xen] Re: [Xen-ia64-devel] fedora-xen-ia64 first pass
Hi, Aron>Hi Akio, > >Akio Takebe wrote: [Tue May 23 2006, 12:59:43AM EDT] >> mm/page_alloc.c: In function ''alloc_node_mem_map'': >> mm/page_alloc.c:2143: error: ''MAX_ORDER_NR_PAGES'' undeclared (first use >> in this function) >> mm/page_alloc.c:2143: error: (Each undeclared identifier is reported only >> once >> mm/page_alloc.c:2143: error: for each function it appears in.) > >This was due to a mistake on my part. I had mismatched kernel >versions between the fedora kernel and the xen patch (-git9 vs. >-git10). It should be fixed now in cset 21 >I remove that part, then I can make rpm. I can install xen''s, dom0''s and domU''s rpm by deleting requirement libvirt. (I think it is not necessary to boot dom0. ) So I tried boot xen & dom0. But I cannot boot it yet. Could you boot dom0?>> I''m not clear about directory construction. >> What do each directory mean? >> I want to know the following directory''s meaning. >> >> # ls -F fedora-kernel-ia64/BUILD/kernel-2.6.16/ >> Config.mk extract.pub kernel.pub kernel.sec linux-2.6.16.ia64/ >> pubring.gpg random_seed secring.gpg vanilla/ xen/ xen-10022/ >> >> Are kernels of domain0/domainU made at linux-2.6.16.ia64? >> If so, each linux-2.6.16.ia64 must be remade at each building time. >> Am I right? > >That''s right. See the %build section of kernel-2.6.specOK, I''ll see it. Best Regards, Akio Takebe
Aron Griffis
2006-May-23 13:22 UTC
[Fedora-xen] Re: [Xen-ia64-devel] fedora-xen-ia64 first pass
Akio Takebe wrote: [Tue May 23 2006, 08:58:36AM EDT]> >This was due to a mistake on my part. I had mismatched kernel > >versions between the fedora kernel and the xen patch (-git9 vs. > >-git10). It should be fixed now in cset 21 > > I remove that part, then I can make rpm.Ok, it would be better to use cset 21, though, since it''s based on a newer xen-ia64-unstable.> I can install xen''s, dom0''s and domU''s rpm > by deleting requirement libvirt. > (I think it is not necessary to boot dom0. )You might also be interested in --nodeps :-)> So I tried boot xen & dom0. > But I cannot boot it yet. > > Could you boot dom0?No, bare metal boots, but dom0 fails. I haven''t debugged it yet. Aron
Akio Takebe
2006-May-23 13:31 UTC
[Fedora-xen] Re: [Xen-ia64-devel] fedora-xen-ia64 first pass
Hi,Aron>Akio Takebe wrote: [Tue May 23 2006, 08:58:36AM EDT] >> >This was due to a mistake on my part. I had mismatched kernel >> >versions between the fedora kernel and the xen patch (-git9 vs. >> >-git10). It should be fixed now in cset 21 >> >> I remove that part, then I can make rpm. > >Ok, it would be better to use cset 21, though, since it''s based on >a newer xen-ia64-unstable. > >> I can install xen''s, dom0''s and domU''s rpm >> by deleting requirement libvirt. >> (I think it is not necessary to boot dom0. ) > >You might also be interested in --nodeps :-) >Ah, Good point. Thanks.>> So I tried boot xen & dom0. >> But I cannot boot it yet. >> >> Could you boot dom0? > >No, bare metal boots, but dom0 fails. I haven''t debugged it yet. >Does bare metal mean dom0? or xen&dom0 or only xen? I attached my log, is my problem the same as you? Best Regards, Akio Takebe
Aron Griffis
2006-May-23 14:33 UTC
[Fedora-xen] Re: [Xen-ia64-devel] fedora-xen-ia64 first pass
Akio Takebe wrote: [Tue May 23 2006, 09:31:48AM EDT]> Does bare metal mean dom0? or xen&dom0 or only xen?No hypervisor, and CONFIG_XEN disabled in the kernel.> I attached my log, is my problem the same as you?Yes, I''m glad we''re seeing the same thing :-) Aron