Aron Griffis
2006-Jul-06 20:49 UTC
[Fedora-xen] [PATCH] enable xen-ia64 in fedora kernel cvs
This patch enables xen-ia64 support in the fedora kernel. It applies to the cvs tree checked out according to the instructions at http://people.redhat.com/davej/ At this point I''m requesting this patch be applied. Until the hypervisor is updated to match the generic linux-2.6-xen.patch, it won''t actually boot xen on ia64, but IMHO the changes are clean and there''s no reason to believe they won''t work when %includexen and %buildxen are re-enabled. (It has already been demonstrated previously on this list that the patches work in general and that fedora-xen-ia64 builds, boots and runs ;-) Breakdown of the changes: - Add $(CFG)-ia64-xen.config target to devel/Makefile.config - Add devel/configs/config-xen-ia64 override snippet - Add xen_flags, xen_target and xen_image to spec-file to genericize building of the hypervisor - Add two symlinks that are specific to building on ia64. These symlinks aren''t required in xen-ia64-unstable upstream, so include shell conditionals to announce when they should be retired from the spec file Caveats: - As described earlier, we need Juan to start matching the hypervisor tarball to the xen-unstable changeset associated with linux-2.6-xen.patch. It breaks boot on ia64 presently, but could affect any architecture, so this is an important change in general. - As of 2.6.17, configs/config-ia64-generic needs CONFIG_PNPACPI=y to boot on systems without a graphics head. This is not related to xen so I didn''t include it in this patch. I''ll be sending a separate patch for this issue, cc''ing fedora-ia64 Signed-off-by: Aron Griffis <aron@hp.com> devel/configs/config-xen-ia64 | 19 ++++++++++++ devel/Makefile.config | 18 ++++++++++-- devel/kernel-2.6.spec | 60 ++++++++++++++++++++++++++++------------ 3 files changed, 76 insertions(+), 21 deletions(-) diff -r da3fa23e3220 -r 08b309b90c4f devel/Makefile.config --- a/devel/Makefile.config Thu Jul 06 11:34:32 2006 -0400 +++ b/devel/Makefile.config Thu Jul 06 16:40:56 2006 -0400 @@ -13,7 +13,8 @@ CONFIGFILES = \ $(CFG)-ppc.config $(CFG)-ppc-smp.config \ $(CFG)-ppc64.config $(CFG)-ppc64-kdump.config $(CFG)-ia64.config \ $(CFG)-i686-xen-PAE.config \ - $(CFG)-i686-xen.config $(CFG)-x86_64-xen.config + $(CFG)-i686-xen.config $(CFG)-x86_64-xen.config \ + $(CFG)-ia64-xen.config PLATFORMS = x86 x86_64 powerpc powerpc32 powerpc64 s390 ia64 # sparc sparc64 TEMPFILES = $(addprefix temp-, $(addsuffix -generic, $(PLATFORMS))) @@ -21,8 +22,10 @@ configs: $(CONFIGFILES) configs: $(CONFIGFILES) @rm -f kernel-*-config @rm -f $(TEMPFILES) - @rm -f temp-xen-generic temp-x86-xen-generic temp-x86_64-xen-generic \ - temp-generic temp-x86_64-xen-generic-tmp + @rm -f temp-generic temp-xen-generic \ + temp-x86-xen-generic \ + temp-x86_64-xen-generic temp-x86_64-xen-generic-tmp \ + temp-ia64-xen-generic temp-ia64-xen-generic-tmp # Augment the clean target to clean up our own cruft clean :: @@ -69,6 +72,12 @@ temp-x86_64-xen-generic-tmp: configs/con perl scripts/merge.pl $^ > $@ temp-x86_64-xen-generic: configs/config-xen-x86_64 temp-x86_64-xen-generic-tmp + perl scripts/merge.pl $^ > $@ + +temp-ia64-xen-generic-tmp: configs/config-xen-generic temp-ia64-generic + perl scripts/merge.pl $^ > $@ + +temp-ia64-xen-generic: configs/config-xen-ia64 temp-ia64-xen-generic-tmp perl scripts/merge.pl $^ > $@ kernel-$(VERSION)-i686.config: configs/config-i686 temp-x86-generic @@ -134,3 +143,6 @@ kernel-$(VERSION)-x86_64-xen.config: con kernel-$(VERSION)-x86_64-xen.config: configs/config-xen-xen temp-x86_64-xen-generic perl scripts/merge.pl $^ x86_64 > $@ +kernel-$(VERSION)-ia64-xen.config: configs/config-xen-xen temp-ia64-xen-generic + perl scripts/merge.pl $^ ia64 > $@ + diff -r da3fa23e3220 -r 08b309b90c4f devel/kernel-2.6.spec --- a/devel/kernel-2.6.spec Thu Jul 06 11:34:32 2006 -0400 +++ b/devel/kernel-2.6.spec Thu Jul 06 16:40:56 2006 -0400 @@ -31,6 +31,9 @@ Summary: The Linux kernel (the core of t %define xen_version 20060610 %define make_target bzImage %define kernel_image x86 +%define xen_flags verbose=y debug=y crash_debug=y +%define xen_target vmlinuz +%define xen_image vmlinuz %define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE} @@ -50,10 +53,14 @@ Summary: The Linux kernel (the core of t %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-*.config %endif -# Xen and kdump only build on i686 and x86_64 ... +# kdump only builds on i686 and x86_64 %ifnarch i686 x86_64 +%define buildkdump 0 +%endif + +# Xen only builds on i686, x86_64 and ia64 ... +%ifnarch i686 x86_64 ia64 %define buildxen 0 -%define buildkdump 0 %endif %ifarch ppc64 @@ -127,11 +134,15 @@ Summary: The Linux kernel (the core of t %endif %ifarch ia64 -%define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-ia64.config +%define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-ia64*.config %define image_install_path boot/efi/EFI/redhat #define signmodules 1 %define make_target compressed %define kernel_image vmlinux.gz +# ia64 doesn''t building with debug=y at the moment +%define xen_flags verbose=y crash_debug=y +%define xen_target compressed +%define xen_image vmlinux.gz %endif # @@ -230,6 +241,7 @@ Source34: kernel-%{kversion}-x86_64-xen. Source34: kernel-%{kversion}-x86_64-xen.config Source35: kernel-%{kversion}-i686-kdump.config Source36: kernel-%{kversion}-i686-xen-PAE.config +Source37: kernel-%{kversion}-ia64-xen.config #Source66: kernel-%{kversion}-sparc.config #Source67: kernel-%{kversion}-sparc64.config @@ -774,17 +786,29 @@ cd linux-%{kversion}.%{_target_cpu} # %patch950 -p1 -b .p.xen # -# ... and back out all the ia64-specific sections, as they currently prevent +# ... and back out all the tpm-specific sections, as they currently prevent # non-xen builds from working. -# Now also with tpm -# -for f in `find drivers/char/tpm arch/ia64/ include/asm-ia64/ include/xen/interface/arch-ia64.h* -type f -name "*.p.xen"` ; do \ +# +for f in `find drivers/char/tpm -type f -name "*.p.xen"` ; do \ g=`dirname $f`/`basename $f .p.xen`; \ mv "$f" "$g"; \ if [ ! -s "$g" ] ; then rm -f "$g" ; fi; \ done # Delete the rest of the backup files, they just confuse the build later find -name "*.p.xen" | xargs rm -f + +# These are fixed in xen-ia64-unstable, they will announce their retirement +# automatically when the changes propogate down the chain to Juan +if [[ ! -f arch/ia64/kernel/asm-offsets.c ]]; then + ln -sf ../../../../xen/include/asm-ia64/asm-xsi-offsets.h include/asm-ia64/xen/ +else + printf "*\n* please retire asm-xsi-offsets.h symlink from kernel-2.6.spec\n*\n" +fi +if grep -q xenia64_init drivers/xen/core/Makefile; then + ln -sf ../../../arch/ia64/xen/drivers/xenia64_init.c drivers/xen/core/ +else + printf "*\n* please retire xenia64_init.c symlink from kernel-2.6.spec\n*\n" +fi %patch951 -p1 %patch952 -p1 @@ -1192,15 +1216,15 @@ mkdir -p $RPM_BUILD_ROOT/boot %if %{includexen} %if %{buildxen} cd xen - mkdir -p $RPM_BUILD_ROOT/%{image_install_path} + mkdir -p $RPM_BUILD_ROOT/%{image_install_path} $RPM_BUILD_ROOT/boot %if %{buildxenPAE} - make debug=y verbose=y crash_debug=y pae=y - install -m 644 xen.gz $RPM_BUILD_ROOT/boot/xen.gz-%{KVERREL}-PAE + make %{?_smp_mflags} %{xen_flags} pae=y + install -m 644 xen.gz $RPM_BUILD_ROOT/%{image_install_path}/xen.gz-%{KVERREL}-PAE install -m 755 xen-syms $RPM_BUILD_ROOT/boot/xen-syms-%{KVERREL}-PAE make clean %endif - make debug=y verbose=y crash_debug=y - install -m 644 xen.gz $RPM_BUILD_ROOT/boot/xen.gz-%{KVERREL} + make %{?_smp_mflags} %{xen_flags} + install -m 644 xen.gz $RPM_BUILD_ROOT/%{image_install_path}/xen.gz-%{KVERREL} install -m 755 xen-syms $RPM_BUILD_ROOT/boot/xen-syms-%{KVERREL} cd .. %endif @@ -1222,11 +1246,11 @@ BuildKernel %make_target %kernel_image s %if %{includexen} %if %{buildxenPAE} -BuildKernel vmlinuz vmlinuz xen-PAE +BuildKernel %xen_target %xen_image xen-PAE %endif %if %{buildxen} -BuildKernel vmlinuz vmlinuz xen +BuildKernel %xen_target %xen_image xen %endif %endif @@ -1331,7 +1355,7 @@ fi %post xen [ ! -x /usr/sbin/module_upgrade ] || /usr/sbin/module_upgrade %{rpmversion}-%{release}-xen if [ -e /proc/xen/xsd_kva -o ! -d /proc/xen ]; then - /sbin/new-kernel-pkg --package kernel-xen --mkinitrd --depmod --install --multiboot=/boot/xen.gz-%{KVERREL} %{KVERREL}xen + /sbin/new-kernel-pkg --package kernel-xen --mkinitrd --depmod --install --multiboot=/%{image_install_path}/xen.gz-%{KVERREL} %{KVERREL}xen else /sbin/new-kernel-pkg --package kernel-xen --mkinitrd --depmod --install %{KVERREL}xen fi @@ -1348,7 +1372,7 @@ fi %post xen-PAE [ ! -x /usr/sbin/module_upgrade ] || /usr/sbin/module_upgrade %{rpmversion}-%{release}-xen-PAE if [ -e /proc/xen/xsd_kva ]; then - /sbin/new-kernel-pkg --package kernel-xen-PAE --mkinitrd --depmod --install --multiboot=/boot/xen.gz-%{KVERREL}-PAE %{KVERREL}xen-PAE + /sbin/new-kernel-pkg --package kernel-xen-PAE --mkinitrd --depmod --install --multiboot=/%{image_install_path}/xen.gz-%{KVERREL}-PAE %{KVERREL}xen-PAE else /sbin/new-kernel-pkg --package kernel-xen-PAE --mkinitrd --depmod --install %{KVERREL}xen-PAE fi @@ -1477,7 +1501,7 @@ fi /boot/symvers-%{KVERREL}xen.gz /boot/symsets-%{KVERREL}xen.tar.gz /boot/config-%{KVERREL}xen -/boot/xen.gz-%{KVERREL} +/%{image_install_path}/xen.gz-%{KVERREL} /boot/xen-syms-%{KVERREL} %dir /lib/modules/%{KVERREL}xen /lib/modules/%{KVERREL}xen/kernel @@ -1502,7 +1526,7 @@ fi /boot/symvers-%{KVERREL}xen-PAE.gz /boot/symsets-%{KVERREL}xen-PAE.tar.gz /boot/config-%{KVERREL}xen-PAE -/boot/xen.gz-%{KVERREL}-PAE +/%{image_install_path}/xen.gz-%{KVERREL}-PAE /boot/xen-syms-%{KVERREL}-PAE %dir /lib/modules/%{KVERREL}xen-PAE /lib/modules/%{KVERREL}xen-PAE/kernel diff -r da3fa23e3220 -r 08b309b90c4f devel/configs/config-xen-ia64 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/devel/configs/config-xen-ia64 Thu Jul 06 16:40:56 2006 -0400 @@ -0,0 +1,19 @@ +# override i686 xen + +# CONFIG_X86 is not set +# CONFIG_X86_XEN is not set +CONFIG_IA64=y +CONFIG_XEN=y +CONFIG_XEN_IA64_DOM0_VP=y +CONFIG_XEN_DISABLE_SERIAL=y + +# override ia64 generic + +# CONFIG_IA64_GENERIC is not set +CONFIG_IA64_DIG=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +CONFIG_FLATMEM_MANUAL=y +CONFIG_FORCE_MAX_ZONEORDER=11 + +# internal #defines conflict with xen-ia64 +# CONFIG_FB_NEOMAGIC is not set