Attached is an (ugly but relatively simple) patch that allows Xenlinux/ia64 to be built using the linux "-sparse" tree methodology (once I populate some files in the -sparse tree). The changes are not dramatic and I think they can be done much more cleanly, but I''m not a build expert so would appreciate improvements from those more comfortable with the Xen build environment... and perhaps it can be made more generic so the ppc guys can benefit too. The primary changes are: 1) wherever a make is done with ARCH=xen, this needs to be converted to ARCH=ia64. (This can probably be done as ARCH=$(XENARCH) or something like that but I''m not sure how to do it without requiring x86 and x86_64 builds to specify XENARCH= at build time.) 2) A sequence of mkbuildtree "massage" commands need to be executed before mkbuildtree does its linking thing. Perhaps this could be done as: if -e mkbuildtree.prelink.$XENARCH mkbuildtree.prelink.$XENARCH Though ia64 doesn''t need it, maybe also add a "postlink" equivalent? There is also one change because the ia64 defconfig filename is different. I can change this filename to conform with the existing convention but perhaps the defconfig pathname could be set as part of the prelink file? Could someone with the necessary build knowledge make the improvements and commit this please? Let me know if/when it goes in and I will populate the ia64 -sparse branches. Thanks, Dan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 9/19/05, Magenheimer, Dan (HP Labs Fort Collins) <dan.magenheimer@hp.com> wrote:> The primary changes are: > 1) wherever a make is done with ARCH=xen, this needs > to be converted to ARCH=ia64. (This can probably > be done as ARCH=$(XENARCH) or something like that > but I''m not sure how to do it without requiring x86 > and x86_64 builds to specify XENARCH= at build time.)Please define LINUX_ARCH in buildconfigs/Rules.mk and use that where we run make ARCH=xen. If you can name your config file xen0_defconfig_ia64 and use LINUX_ARCH for the path, then you won''t need to duplicate the config file code. Please also change all mk.linux files.> 2) A sequence of mkbuildtree "massage" commands need to > be executed before mkbuildtree does its linking thing. > Perhaps this could be done as: > if -e mkbuildtree.prelink.$XENARCH > mkbuildtree.prelink.$XENARCH > Though ia64 doesn''t need it, maybe also add a "postlink" > equivalent?Why do you need to move these out of the way in the first place? If any of the changes we''ve made break ia64, then we should cleanup our changes.> Could someone with the necessary build knowledge make > the improvements and commit this please? Let me know if/when > it goes in and I will populate the ia64 -sparse branches.Please give creating a patch another try, taking the suggestions above into consideration. Thanks! christian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Mon, 2005-09-19 at 06:43 -0700, Magenheimer, Dan (HP Labs Fort Collins) wrote:> +ifeq ($(ARCH),ia64) > + yes "" | $(MAKE) -C $(LINUX_DIR) oldconfig > +elseWhy are you piping in tons of nothing into Make here using the "yes" command? -- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Magenheimer, Dan (HP Labs Fort Collins)
2005-Sep-19 15:29 UTC
RE: [Xen-devel] (no subject)
> On Mon, 2005-09-19 at 06:43 -0700, Magenheimer, Dan (HP Labs Fort > Collins) wrote: > > > +ifeq ($(ARCH),ia64) > > + yes "" | $(MAKE) -C $(LINUX_DIR) oldconfig > > +else > > Why are you piping in tons of nothing into Make here using the "yes" > command?This mechanically does the same as manually hitting "enter" at every prompt from "make oldconfig", thus it applies the default response for every unconfigured option without manual intervention. Dan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> Collins) wrote: > > +ifeq ($(ARCH),ia64) > > + yes "" | $(MAKE) -C $(LINUX_DIR) oldconfig > > +else > > Why are you piping in tons of nothing into Make here using the "yes" > command?I guess, to answer <ret> (choose default) to any questions oldconfig throws up. Cheers, Mark _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 9/19/05, Magenheimer, Dan (HP Labs Fort Collins) <dan.magenheimer@hp.com> wrote:> > On Mon, 2005-09-19 at 06:43 -0700, Magenheimer, Dan (HP Labs Fort > > Collins) wrote: > > > > > +ifeq ($(ARCH),ia64) > > > + yes "" | $(MAKE) -C $(LINUX_DIR) oldconfig > > > +else > > > > Why are you piping in tons of nothing into Make here using the "yes" > > command? > > This mechanically does the same as manually hitting > "enter" at every prompt from "make oldconfig", thus it > applies the default response for every unconfigured > option without manual intervention.I think it''s preferable to have default config files which don''t cause any prompting. Also if people upgrade, they probably want to be prompted on any new options. If not, then let''s get the default behaviour for "make oldconfig" changed upstream... christian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Magenheimer, Dan (HP Labs Fort Collins)
2005-Sep-19 16:49 UTC
RE: [Xen-devel] (no subject)
(Sorry about the "no subject" in the original message... fat fingers on my part.)> Please define LINUX_ARCH in buildconfigs/Rules.mk and use that where > we run make ARCH=xen. > If you can name your config file xen0_defconfig_ia64 and use > LINUX_ARCH for the path, then you won''t need to duplicate the config > file code.OK, I see. This cleans it up nicely. New patch attached.> Please also change all mk.linux files.Done.> > 2) A sequence of mkbuildtree "massage" commands need to > > be executed before mkbuildtree does its linking thing. > > Perhaps this could be done as: > > if -e mkbuildtree.prelink.$XENARCH > > mkbuildtree.prelink.$XENARCH > > Though ia64 doesn''t need it, maybe also add a "postlink" > > equivalent? > > Why do you need to move these out of the way in the first place? If > any of the changes we''ve made break ia64, then we should cleanup our > changes.Do the changes have no impact to non-Xen non-x86 kernels? Since xenlinux/ia64 is transparently paravirtualized, the changes looked like they might be xen-specific, and xenlinux/ia64 has been running out-of-tree without any of those changes, the script moves them aside. If there''s no impact, I can move them back in (but will probably do so slowly for testing purposes). In any case, drivers/xen definitely is not yet fully archdep, so I need to use the pre- or post-mkbuildtree to do some patching in the short term. Agree in the longer term, these files should be empty but if you don''t mind greatly, having the archdep hooks there will probably make things easier for arch''s for now.> > Could someone with the necessary build knowledge make > > the improvements and commit this please? Let me know if/when > > it goes in and I will populate the ia64 -sparse branches. > > Please give creating a patch another try, taking the suggestions above > into consideration. Thanks!OK, let me know if this is better. Thanks, Dan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Magenheimer, Dan (HP Labs Fort Collins)
2005-Sep-19 16:57 UTC
RE: [Xen-devel] (no subject)
> > > Why are you piping in tons of nothing into Make here > using the "yes" > > > command? > > > > This mechanically does the same as manually hitting > > "enter" at every prompt from "make oldconfig", thus it > > applies the default response for every unconfigured > > option without manual intervention. > > I think it''s preferable to have default config files which don''t cause > any prompting. > > Also if people upgrade, they probably want to be prompted on any new > options. If not, then let''s get the default behaviour for "make > oldconfig" changed upstream...I''ve just used this for convenience. The defconfigs in Linux/ia64 cause prompting and the config change required for Xen/ia64 support (because it is transparently paravirtualized) is adding "CONFIG_XEN=y". But I can easily put the output of make oldconfig in the xen defconfig file if the preference is to have no prompting (thus the "yes" pipe is removed from the previously posted patch). Thanks, Dan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Mon, Sep 19, 2005 at 09:49:05AM -0700, Magenheimer, Dan (HP Labs Fort Collins) wrote:> > Please define LINUX_ARCH in buildconfigs/Rules.mk and use that where > > we run make ARCH=xen. > > If you can name your config file xen0_defconfig_ia64 and use > > LINUX_ARCH for the path, then you won''t need to duplicate the config > > file code. > > OK, I see. This cleans it up nicely. New patch attached.You have to export LINUX_ARCH to the script. We don''t want to unconditionally polute the environment of all the commands we run, so you''ll have to add it to all the calls to mkbuildtree. I think I''d prefer xen-mkbuildtree-{pre,post} as the name of the scripts to run, but not too fussed about that...> Do the changes have no impact to non-Xen non-x86 kernels? > Since xenlinux/ia64 is transparently paravirtualized, > the changes looked like they might be xen-specific, and > xenlinux/ia64 has been running out-of-tree without any > of those changes, the script moves them aside. If there''s > no impact, I can move them back in (but will probably > do so slowly for testing purposes). > > In any case, drivers/xen definitely is not yet fully > archdep, so I need to use the pre- or post-mkbuildtree > to do some patching in the short term. Agree in the longer > term, these files should be empty but if you don''t mind > greatly, having the archdep hooks there will probably > make things easier for arch''s for now.Ok, let''s go with the pre/post link scripts for now, but I think it would be good to make our changes work when building non-x86/non-xen. christian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Magenheimer, Dan (HP Labs Fort Collins)
2005-Sep-19 19:20 UTC
RE: [Xen-devel] (no subject)
> > > Please define LINUX_ARCH in buildconfigs/Rules.mk and use > that where > > > we run make ARCH=xen. > > > If you can name your config file xen0_defconfig_ia64 and use > > > LINUX_ARCH for the path, then you won''t need to duplicate > the config > > > file code. > > > > OK, I see. This cleans it up nicely. New patch attached. > > You have to export LINUX_ARCH to the script. We don''t want to > unconditionally polute the environment of all the commands we > run, so you''ll have to add it to all the calls to mkbuildtree.I''m not sure I follow... I don''t know exactly how make or bash work wrt to exporting... I didn''t explicitly export LINUX_ARCH but it seems to be known by mkbuildtree and all the mk.linux''s anyway. (I successfully built for x86 and ia64 with the patch.) Or are you suggesting I *not* define it in buildconfigs/Rules.mk so as to avoid polluting the environment?> I think I''d prefer xen-mkbuildtree-{pre,post} as the name of > the scripts > to run, but not too fussed about that...That''s OK with me. If enlightenment (is that a bad word in Xen land now?) from the above requires me to re-generate the patch, I will change the names. Thanks! Dan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Mon, Sep 19, 2005 at 12:20:41PM -0700, Magenheimer, Dan (HP Labs Fort Collins) wrote:> > > OK, I see. This cleans it up nicely. New patch attached. > > > > You have to export LINUX_ARCH to the script. We don''t want to > > unconditionally polute the environment of all the commands we > > run, so you''ll have to add it to all the calls to mkbuildtree. > > I''m not sure I follow... I don''t know exactly how make or bash > work wrt to exporting... I didn''t explicitly export LINUX_ARCH > but it seems to be known by mkbuildtree and all the mk.linux''s > anyway. (I successfully built for x86 and ia64 with the > patch.) > > Or are you suggesting I *not* define it in buildconfigs/Rules.mk > so as to avoid polluting the environment?Rules.mk is fine. What I meant is that LINUX_ARCH won''t get passed to mkbuildtree unless you add it to its environment. I confirmed this now by adding this to mkbuildtree: echo ${LINUX_ARCH} >>/tmp/xxxxxxxx LINUX_ARCH is empty and thus your hook script won''t run. Maybe you have LINUX_ARCH set in your shell environment where you ran make? Odd...> That''s OK with me. If enlightenment (is that a bad word in > Xen land now?) from the above requires me to re-generate > the patch, I will change the names.Cheers! christian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Magenheimer, Dan (HP Labs Fort Collins)
2005-Sep-19 20:52 UTC
RE: [Xen-devel] (no subject)
> > > You have to export LINUX_ARCH to the script. We don''t want to > > > unconditionally polute the environment of all the commands we > > > run, so you''ll have to add it to all the calls to mkbuildtree. > > > > I''m not sure I follow... I don''t know exactly how make or bash > > work wrt to exporting... I didn''t explicitly export LINUX_ARCH > > but it seems to be known by mkbuildtree and all the mk.linux''s > > anyway. (I successfully built for x86 and ia64 with the > > patch.) > > > > Or are you suggesting I *not* define it in buildconfigs/Rules.mk > > so as to avoid polluting the environment? > > Rules.mk is fine. What I meant is that LINUX_ARCH won''t get > passed to mkbuildtree unless you add it to its environment. > I confirmed this now by adding this to mkbuildtree: > echo ${LINUX_ARCH} >>/tmp/xxxxxxxx > LINUX_ARCH is empty and thus your hook script won''t run. Maybe > you have LINUX_ARCH set in your shell environment where you ran > make? Odd...No, it''s not in my shell environment. However, when I run make to build for ia64 I run it as: ''make LINUX_ARCH=ia64 ...'' and I''m guessing make must export it to subshells. If I add the ''echo'', I do get ia64 in /tmp/xxxxxx and the ia64 hook scripts do get run. But if I build (for xen/x86) with just ''make'', nothing gets echoed to the file and, as you pointed out, no hook script gets run. But that''s the default behavior we want, correct? I suppose it would be nice if on ia64 just ''make'' did the right thing, e.g. set LINUX_ARCH=ia64 without the need to specify it on the command line. In that case, adding it to all the calls to mkbuildtree is necessary. How do I set LINUX_ARCH in Rules.mk so that it is set to ''xen'' if x86 (or x86_64) and the architecture it is running on (e.g. ia64) otherwise? So I think the patch is OK as is... I''ve built successfully for both x86 and ia64... but I can still change it and resubmit if you prefer the other way. Thanks, Dan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Mon, Sep 19, 2005 at 01:52:36PM -0700, Magenheimer, Dan (HP Labs Fort Collins) wrote:> > Rules.mk is fine. What I meant is that LINUX_ARCH won''t get > > passed to mkbuildtree unless you add it to its environment. > > I confirmed this now by adding this to mkbuildtree: > > echo ${LINUX_ARCH} >>/tmp/xxxxxxxx > > LINUX_ARCH is empty and thus your hook script won''t run. Maybe > > you have LINUX_ARCH set in your shell environment where you ran > > make? Odd... > > No, it''s not in my shell environment. However, when I run make > to build for ia64 I run it as: ''make LINUX_ARCH=ia64 ...'' and > I''m guessing make must export it to subshells. If I add the > ''echo'', I do get ia64 in /tmp/xxxxxx and the ia64 hook scripts > do get run.Yes, that explains it.> I suppose it would be nice if on ia64 just ''make'' did the > right thing, e.g. set LINUX_ARCH=ia64 without the need to > specify it on the command line. In that case, adding it > to all the calls to mkbuildtree is necessary. How do > I set LINUX_ARCH in Rules.mk so that it is set to ''xen'' > if x86 (or x86_64) and the architecture it is running on > (e.g. ia64) otherwise?I''ll check it in tomorrow, and I''ll make it set LINUX_ARCH dependent on ARCH, like you did in your original patch... Thanks! christian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Magenheimer, Dan (HP Labs Fort Collins)
2005-Sep-21 20:49 UTC
RE: [Xen-devel] (no subject)
> > I suppose it would be nice if on ia64 just ''make'' did the > > right thing, e.g. set LINUX_ARCH=ia64 without the need to > > specify it on the command line. In that case, adding it > > to all the calls to mkbuildtree is necessary. How do > > I set LINUX_ARCH in Rules.mk so that it is set to ''xen'' > > if x86 (or x86_64) and the architecture it is running on > > (e.g. ia64) otherwise? > > I''ll check it in tomorrow, and I''ll make it set LINUX_ARCH > dependent on ARCH, like you did in your original patch...Thanks very much! I tried it and it works great! Using this, I have started committing files into the ia64 subdirs of -sparse in xen-ia64-unstable.hg which will be pulled into the xen-unstable tree at the next sync. I have already built and tested a "driver-less" domain0 from -sparse. Dan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Magenheimer, Dan (HP Labs Fort Collins)
2005-Sep-23 19:07 UTC
RE: [Xen-devel] (no subject)
> -----Original Message----- > From: Magenheimer, Dan (HP Labs Fort Collins) > Sent: Wednesday, September 21, 2005 2:50 PM > To: ''Christian Limpach'' > Cc: xen-devel@lists.xensource.com > Subject: RE: [Xen-devel] (no subject) > > > > I suppose it would be nice if on ia64 just ''make'' did the > > > right thing, e.g. set LINUX_ARCH=ia64 without the need to > > > specify it on the command line. In that case, adding it > > > to all the calls to mkbuildtree is necessary. How do > > > I set LINUX_ARCH in Rules.mk so that it is set to ''xen'' > > > if x86 (or x86_64) and the architecture it is running on > > > (e.g. ia64) otherwise? > > > > I''ll check it in tomorrow, and I''ll make it set LINUX_ARCH > > dependent on ARCH, like you did in your original patch... > > Thanks very much! I tried it and it works great! Using > this, I have started committing files into the ia64 subdirs > of -sparse in xen-ia64-unstable.hg which will be pulled > into the xen-unstable tree at the next sync. I have already > built and tested a "driver-less" domain0 from -sparse.Oops, I tried it only using a cross-compiler. When I compiled natively on ia64, it is still necessary to specify LINUX_ARCH=ia64 on the make-line, else I get x86 configs. I think the fix is to change in buildconfig/Rules.mk from ifneq ($(ARCH),ia64) to ifneq ($(XEN_TARGET_ARCH),ia64) I''ll roll this fix in at the next merge with xen-ia64-unstable. Thanks, Dan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 9/23/05, Magenheimer, Dan (HP Labs Fort Collins) <dan.magenheimer@hp.com> wrote:> Oops, I tried it only using a cross-compiler. When I compiled > natively on ia64, it is still necessary to specify > LINUX_ARCH=ia64 on the make-line, else I get x86 configs. > > I think the fix is to change in buildconfig/Rules.mk from > > ifneq ($(ARCH),ia64) > to > ifneq ($(XEN_TARGET_ARCH),ia64) > > I''ll roll this fix in at the next merge with xen-ia64-unstable.Yes, thanks! christian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel