trikolon wrote:Of course, its very simple, Jan Beulich @ Suse does the hard work!, I just make some minor changes, I download the latest kernel-source rpm which can be found in several places , they are not always updated in sync so I just get the latest one for the version I am working on, unfortunately because the current supported openSUSE kernel version is 2.6.27 the patches are kept up to date with bleeding edge kernel.org source, so for example I had to grab 2.6.29 quickly before they moved on to 2.6.30-git1 etc, Jan recently sent me the last 2.6.30 version patches so that is what I will be using for the next release as they will soon move to 2.6.31-rc2-git7 etc.
Download the source from:
http://download.opensuse.org/repositori ... ctory/src/
http://download.opensuse.org/factory/re ... /suse/src/
http://download.opensuse.org/repositori ... ndard/src/
ftp://ftp.suse.com/pub/projects/kernel/ ... AD/x86_64/
I rpm2targz the rpm and then extract patches-xen.tar.bz2 and try to apply the patches to the appropriate vanilla kernel source, there are always some failures but they are usually quite easy to fix.
I do not use all of the opensuse patches that are contained in patches-xen.tar.bz2, as some of them are for backwards compatibility, are Xen specific fixes for other opensuse kernel patches, or require patches to xen-tools, for example I believe opensuse supports adding cpu's to a linux domU by starting with for example 8 cpus, then hot unplugging all but 1, thus allowing them to be increased while the domain is running, a nice feature but I don't want to start maintaining Xen patches as well!
When I finish the next version I will post a diff output showing just how small the changes are.
Andy
nice, but how do you figure out what the right patch-order is? thats the point where i usually mess everything up
ben
Oops, I forgot to explain that step, after converting the kernel source rpm to a tarball and extracting it there will be a file called series.conf which contains a full list of all of the opensuse kernel patches in the order they are applied, series.conf is used by guards which is run as part of the rpm build process, e.g. ./guards i386 x86_64 <series.conf , but I just open the series.conf directly as it includes some info/descriptions of the patches, just make sure that you don't include patches which are commented out with # or +.
So then we have a list of the Xen patches that rpm would apply, the next step is to comment out any that were created by xen-port-patches.py from other opensuse kernel patches, there is a easy way to do that:
ubermicro patches.xen # pwd
/usr/src/suse_kernels/suse-kernel-source-2.6.30-50.1/patches.xen
ubermicro patches.xen # grep "Automatically created" * | grep "xen-port-patches.py" | grep -v "patches.kernel.org"
xen3-driver-core-misc-add-nodename-support-for-misc-devices.patch:Automatically created from "patches.suse/driver-core-misc-add-nodename-support-for-misc-devices.patch" by xen-port-patches.py
xen3-kdb-x86:Automatically created from "patches.suse/kdb-x86" by xen-port-patches.py
xen3-panic-on-io-nmi.diff:Automatically created from "patches.suse/panic-on-io-nmi.diff" by xen-port-patches.py
xen3-seccomp-disable-tsc-option:Automatically created from "patches.fixes/seccomp-disable-tsc-option" by xen-port-patches.py
xen3-stack-unwind:Automatically created from "patches.suse/stack-unwind" by xen-port-patches.py
xen3-x86-mark_rodata_rw.patch:Automatically created from "patches.suse/x86-mark_rodata_rw.patch" by xen-port-patches.py
xen3-x86_64-unwind-annotations:Automatically created from "patches.arch/x86_64-unwind-annotations" by xen-port-patches.py
None of these will work unless the corresponding patch is applied to the kernel first so I comment them out, I also open each patch and read the description as some others e.g. patches.xen/tmem are for bleeding edge features which most users don't need
I don't actually repeat this process each time a new kernel rpm is released, I just update my existing patches list, here is the one I used for the 2.6.30-r1 ebuild:
#both uml framebuffer and xen need this one.
patches.xen/add-console-use-vt
#split out patches
patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-i386.patch
patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-x86_64.patch
patches.xen/ipv6-no-autoconf
patches.xen/pci-guestdev
patches.xen/pci-reserve
patches.xen/sfc-driverlink
patches.xen/sfc-resource-driver
patches.xen/sfc-driverlink-conditional
patches.xen/sfc-external-sram
# bulk stuff, new files for xen
#patches.xen/tmem
patches.xen/xen3-auto-xen-arch.diff
patches.xen/xen3-auto-xen-drivers.diff
patches.xen/xen3-auto-include-xen-interface.diff
# kconfig bits for xen
patches.xen/xen3-auto-xen-kconfig.diff
# common code changes
patches.xen/xen3-auto-common.diff
patches.xen/xen3-auto-arch-x86.diff
patches.xen/xen3-auto-arch-i386.diff
patches.xen/xen3-auto-arch-x86_64.diff
# fixups due to upstream Xen parts
patches.xen/xen3-fixup-xen
patches.xen/sfc-sync-headers
patches.xen/sfc-endianness
# changes outside arch/{i386,x86_64}/xen
patches.xen/xen3-fixup-kconfig
patches.xen/xen3-fixup-common
patches.xen/xen3-fixup-arch-x86
# ports of other patches
patches.xen/xen3-patch-2.6.18
patches.xen/xen3-patch-2.6.19
patches.xen/xen3-patch-2.6.20
patches.xen/xen3-patch-2.6.21
patches.xen/xen3-patch-2.6.22
patches.xen/xen3-patch-2.6.23
patches.xen/xen3-patch-2.6.24
patches.xen/xen3-patch-2.6.25
patches.xen/xen3-patch-2.6.26
patches.xen/xen3-patch-2.6.27
patches.xen/xen3-patch-2.6.28
patches.xen/xen3-patch-2.6.29
patches.xen/xen3-patch-2.6.30
#patches.xen/xen3-seccomp-disable-tsc-option not required
#patches.xen/xen3-driver-core-misc-add-nodename-support-for-misc-devices.patch
#patches.xen/xen3-kdb-x86
#patches.xen/xen3-stack-unwind suse feature
#patches.xen/xen3-panic-on-io-nmi.diff
#patches.xen/xen3-x86_64-unwind-annotations
patches.xen/xen-balloon-max-target
#patches.xen/xen-modular-blktap backwards compatability old module name
#patches.xen/xen-blkback-bimodal-suse backwards compatability
#patches.xen/xen-blkif-protocol-fallback-hack backwards compatability
patches.xen/xen-blkback-cdrom
patches.xen/xen-blktap-write-barriers
patches.xen/xen-scsifront-block-timeout-update
patches.xen/xen-op-packet
patches.xen/xen-blkfront-cdrom
patches.xen/xen-sections
#patches.xen/xen-swiotlb-heuristics caused problems on dell optiplex system, not essential
patches.xen/xen-kconfig-compat
patches.xen/xen-cpufreq-report
patches.xen/xen-staging-build
patches.xen/xen-sysdev-suspend
patches.xen/xen-ipi-per-cpu-irq
patches.xen/xen-virq-per-cpu-irq
patches.xen/xen-configurable-guest-devices
patches.xen/xen-netback-nr-irqs
patches.xen/xen-netback-notify-multi
patches.xen/xen-x86-panic-no-reboot
patches.xen/xen-x86-dcr-fallback
patches.xen/xen-x86-consistent-nmi
patches.xen/xen-x86-no-lapic
patches.xen/xen-x86-pmd-handling
patches.xen/xen-x86-bigmem
patches.xen/xen-x86-machphys-prediction
patches.xen/xen-x86-exit-mmap
patches.xen/xen-x86_64-pgd-pin
patches.xen/xen-x86_64-pgd-alloc-order
patches.xen/xen-x86_64-dump-user-pgt
patches.xen/xen-x86_64-note-init-p2m
Having made the list of patches I have a script which extracts the vanilla kernel source and attempts to apply the patches, when it fails it stops and drops to bash so that I can fix the problem manually, to give you an idea of the changes here is the diff output between the original and my updated patches:
diff -ur /mnt/fatfiler/suse_kernels/suse-kernel-source-2.6.30-50.1/patches.xen/xen3-auto-common.diff /usr/src/xen-patches/2.6.30/work/patches.xen/xen3-auto-common.diff
--- /mnt/fatfiler/suse_kernels/suse-kernel-source-2.6.30-50.1/patches.xen/xen3-auto-common.diff 2009-06-24 09:57:42.000000000 +0100
+++ /usr/src/xen-patches/2.6.30/work/patches.xen/xen3-auto-common.diff 2009-06-30 14:20:41.000000000 +0100
@@ -19,9 +19,9 @@
obj-$(CONFIG_NUBUS) += nubus/
obj-y += macintosh/
+obj-$(CONFIG_XEN) += xen/
+ obj-$(CONFIG_IDE) += ide/
obj-$(CONFIG_SCSI) += scsi/
obj-$(CONFIG_ATA) += ata/
- obj-$(CONFIG_IDE) += ide/
--- head-2009-06-23.orig/drivers/acpi/Makefile 2009-06-23 12:03:47.000000000 +0200
+++ head-2009-06-23/drivers/acpi/Makefile 2009-06-23 12:28:48.000000000 +0200
@@ -61,3 +61,6 @@ obj-$(CONFIG_ACPI_SBS) += sbs.o
@@ -3411,8 +3411,8 @@
1 << PG_private | 1 << PG_private_2 | \
1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \
1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \
-- 1 << PG_waiters | __PG_UNEVICTABLE | __PG_MLOCKED)
-+ 1 << PG_waiters | __PG_UNEVICTABLE | __PG_MLOCKED | __PG_XEN)
+- __PG_UNEVICTABLE | __PG_MLOCKED)
++ __PG_UNEVICTABLE | __PG_MLOCKED | __PG_XEN)
/*
* Flags checked when a page is prepped for return by the page allocator.
diff -ur /mnt/fatfiler/suse_kernels/suse-kernel-source-2.6.30-50.1/patches.xen/xen3-fixup-arch-x86 /usr/src/xen-patches/2.6.30/work/patches.xen/xen3-fixup-arch-x86
--- /mnt/fatfiler/suse_kernels/suse-kernel-source-2.6.30-50.1/patches.xen/xen3-fixup-arch-x86 2009-06-24 09:57:42.000000000 +0100
+++ /usr/src/xen-patches/2.6.30/work/patches.xen/xen3-fixup-arch-x86 2009-06-30 14:36:09.000000000 +0100
@@ -2,18 +2,6 @@
From:
jbeulich@novell.com
Patch-mainline: obsolete
---- head-2009-04-21.orig/arch/x86/kdb/kdba_bt.c 2009-04-21 10:18:50.000000000 +0200
-+++ head-2009-04-21/arch/x86/kdb/kdba_bt.c 2009-04-21 12:15:27.000000000 +0200
-@@ -3168,6 +3168,9 @@ bb_usage_mov(const struct bb_operand *sr
- bb_is_int_reg(dst->base_rc) &&
- full_register_dst) {
- #ifdef CONFIG_X86_32
-+#ifndef TSS_sysenter_sp0
-+#define TSS_sysenter_sp0 SYSENTER_stack_sp0
-+#endif
- /* mov from TSS_sysenter_sp0+offset to esp to fix up the
- * sysenter stack, it leaves esp well defined. mov
- * TSS_ysenter_sp0+offset(%esp),%esp is followed by up to 5
--- head-2009-04-21.orig/arch/x86/power/Makefile 2009-04-21 10:18:25.000000000 +0200
+++ head-2009-04-21/arch/x86/power/Makefile 2009-04-21 12:15:27.000000000 +0200
@@ -5,3 +5,5 @@ CFLAGS_cpu_$(BITS).o := $(nostackp)
diff -ur /mnt/fatfiler/suse_kernels/suse-kernel-source-2.6.30-50.1/patches.xen/xen3-fixup-common /usr/src/xen-patches/2.6.30/work/patches.xen/xen3-fixup-common
--- /mnt/fatfiler/suse_kernels/suse-kernel-source-2.6.30-50.1/patches.xen/xen3-fixup-common 2009-06-24 09:57:42.000000000 +0100
+++ /usr/src/xen-patches/2.6.30/work/patches.xen/xen3-fixup-common 2009-06-30 14:33:44.000000000 +0100
@@ -310,16 +310,16 @@
--- head-2009-06-09.orig/kernel/kexec.c 2009-06-09 15:22:27.000000000 +0200
+++ head-2009-06-09/kernel/kexec.c 2009-06-09 15:29:19.000000000 +0200
@@ -45,8 +45,10 @@
- #include <linux/kdb.h>
- #endif
+ #include <asm/system.h>
+ #include <asm/sections.h>
+#ifndef CONFIG_XEN
/* Per cpu memory for storing cpu states in case of system crash. */
note_buf_t* crash_notes;
+#endif
- int dump_after_notifier;
/* vmcoreinfo stuff */
+ static unsigned char vmcoreinfo_data[VMCOREINFO_BYTES];
@@ -1168,6 +1170,7 @@ static void final_note(u32 *buf)
memcpy(buf, ¬e, sizeof(note));
}
@@ -349,9 +349,9 @@
return -ENOMEM;
}
+#endif
- #ifdef CONFIG_SYSCTL
- register_sysctl_table(kexec_sys_table);
- #endif
+ return 0;
+ }
+ module_init(crash_notes_memory_init)
--- head-2009-06-09.orig/mm/memory.c 2009-06-09 15:22:27.000000000 +0200
+++ head-2009-06-09/mm/memory.c 2009-06-09 15:29:19.000000000 +0200
@@ -811,10 +811,12 @@ static unsigned long zap_pte_range(struc
diff -ur /mnt/fatfiler/suse_kernels/suse-kernel-source-2.6.30-50.1/patches.xen/xen3-fixup-kconfig /usr/src/xen-patches/2.6.30/work/patches.xen/xen3-fixup-kconfig
--- /mnt/fatfiler/suse_kernels/suse-kernel-source-2.6.30-50.1/patches.xen/xen3-fixup-kconfig 2009-06-24 09:57:42.000000000 +0100
+++ /usr/src/xen-patches/2.6.30/work/patches.xen/xen3-fixup-kconfig 2009-06-30 14:22:35.000000000 +0100
@@ -12,17 +12,6 @@
config ARCH_SUSPEND_POSSIBLE
def_bool y
---- head-2009-06-09.orig/arch/x86/Kconfig.debug 2009-05-29 11:25:52.000000000 +0200
-+++ head-2009-06-09/arch/x86/Kconfig.debug 2009-06-09 15:29:14.000000000 +0200
-@@ -273,7 +273,7 @@ config OPTIMIZE_INLINING
-
- config KDB
- bool "Built-in Kernel Debugger support"
-- depends on DEBUG_KERNEL
-+ depends on DEBUG_KERNEL && !XEN
- select KALLSYMS
- select KALLSYMS_ALL
- help
--- head-2009-06-09.orig/drivers/xen/Kconfig 2009-06-09 15:01:37.000000000 +0200
+++ head-2009-06-09/drivers/xen/Kconfig 2009-06-09 15:29:14.000000000 +0200
@@ -22,6 +22,9 @@ config XEN_PRIVILEGED_GUEST
diff -ur /mnt/fatfiler/suse_kernels/suse-kernel-source-2.6.30-50.1/patches.xen/xen3-patch-2.6.23 /usr/src/xen-patches/2.6.30/work/patches.xen/xen3-patch-2.6.23
--- /mnt/fatfiler/suse_kernels/suse-kernel-source-2.6.30-50.1/patches.xen/xen3-patch-2.6.23 2009-06-24 09:57:42.000000000 +0100
+++ /usr/src/xen-patches/2.6.30/work/patches.xen/xen3-patch-2.6.23 2009-06-30 14:48:04.000000000 +0100
@@ -2669,13 +2669,12 @@
This driver implements the front-end of the Xen virtual
--- head-2009-06-23.orig/drivers/block/Makefile 2009-06-23 09:56:31.000000000 +0200
+++ head-2009-06-23/drivers/block/Makefile 2009-06-23 12:52:36.000000000 +0200
-@@ -34,7 +34,7 @@ obj-$(CONFIG_BLK_DEV_SX8) += sx8.o
+@@ -34,6 +34,6 @@ obj-$(CONFIG_BLK_DEV_SX8) += sx8.o
obj-$(CONFIG_BLK_DEV_UB) += ub.o
obj-$(CONFIG_BLK_DEV_HD) += hd.o
-obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += xen-blkfront.o
+obj-$(CONFIG_XEN_BLKFRONT) += xen-blkfront.o
- obj-$(CONFIG_CIPHER_TWOFISH) += loop_fish2.o
swim_mod-objs := swim.o swim_asm.o
--- head-2009-06-23.orig/drivers/block/xen-blkfront.c 2009-06-23 09:56:31.000000000 +0200
As you can see the changes are quite small.
Andy