Guidance compiling kernel with xen

Hi,

I am not sure if this is the right section to ask this, but does anybody know what I should enable in menuconfig in order to compile a kernel with full xen support? I tried to do that earlier, and while the initial standard kernel compiled fine, when I try to select kernel xen support under processor type and features and then i try to compile it errors out like this:

MKELF scripts/mod/elfconfig.h
GEN include/generated/bounds.h
GEN scripts/mod/devicetable-offsets.h
CC arch/x86/kernel/asm-offsets.s
HOSTCC scripts/mod/modpost.o
In file included from include/xen/hypercall.h:4:0,
from /usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/hypervisor.h:244,
from /usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/special_insns.h:8,
from /usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/processor.h:23,
from /usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/asm/atomic.h:6,
from include/linux/atomic.h:4,
from include/linux/crypto.h:20,
from arch/x86/kernel/asm-offsets.c:8:
/usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/hypercall.h: In function ‘HYPERVISOR_physdev_op’:
/usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/hypercall.h:322:21: error: storage size of ‘op’ isn’t known
struct physdev_op op;
^
/usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/hypercall.h:322:21: warning: unused variable ‘op’ -Wunused-variable]
SHIPPED scripts/genksyms/parse.tab.h
SHIPPED scripts/genksyms/parse.tab.c
HOSTCC scripts/genksyms/lex.lex.o
In file included from include/linux/spinlock_types.h:13:0,
from include/linux/spinlock.h:81,
from include/linux/mmzone.h:7,
from include/linux/gfp.h:4,
from include/linux/slab.h:12,
from include/linux/crypto.h:24,
from arch/x86/kernel/asm-offsets.c:8:
/usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/spinlock_types.h: At top level:
/usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/spinlock_types.h:53:3: error: #error NR_CPUS >= 256 not implemented

error NR_CPUS >= 256 not implemented

^
In file included from include/linux/spinlock.h:87:0,
from include/linux/mmzone.h:7,
from include/linux/gfp.h:4,
from include/linux/slab.h:12,
from include/linux/crypto.h:24,
from arch/x86/kernel/asm-offsets.c:8:
/usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/spinlock.h: In function ‘__byte_spin_is_contended’:
/usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/spinlock.h:185:13: error: ‘arch_spinlock_t’ has no member named ‘spinners’
return lock->spinners != 0;
^
/usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/spinlock.h: In function ‘__byte_spin_lock’:
/usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/arch/x86/include/mach-xen/asm/spinlock.h:202:49: error: ‘arch_spinlock_t’ has no member named ‘spinners’
: “+m” (lock->lock), “+q” (val), “+m” (lock->spinners): : “memory”);
^
make[3]: *** [arch/x86/kernel/asm-offsets.s] Error 1
make[2]: *** [prepare0] Error 2
make[2]: *** Waiting for unfinished jobs…
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/genksyms/parse.tab.o
HOSTCC scripts/selinux/mdp/mdp
HOSTCC scripts/mod/sumversion.o
HOSTCC scripts/kallsyms
HOSTLD scripts/genksyms/genksyms
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/pnmtologo
HOSTCC scripts/conmakehash
HOSTCC scripts/bin2c
HOSTCC scripts/sortextable
HOSTCC scripts/asn1_compiler
HOSTLD scripts/mod/modpost
error: Bad exit status from /var/tmp/rpm-tmp.sx1T4c (%build)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.sx1T4c (%build)
make[1]: *** [rpm] Error 1
make: *** [rpm] Error 2

I have a feeling I am supposed to configure something else in menuconfig but I don’t know what and under what category. Any help is greatly appreciated.

Kind Regards,

Never compiled a xen kernel myself.

But is there any particular reason why you don’t just use kernel-xen as shipped with openSUSE?

Anyway, I guess you could start by booting that standard kernel-xen and call “make cloneconfig” to configure your kernel source in the same way.
Then adapt the config to your specific needs.

During the build I remove most of the unnecessary drivers and features I don’t need, and tune the cpu governor for performance…I get better performance when I compile it myself…Thank you for the suggestion. I’ll try that and work my way from that config…one question though, in what path do I need to run make cloneconfig? and where would the config file be cloned

In the kernel’s source directory of course. Apparently /usr/src/packages/BUILD/kernel-3.11.10_vaseer_11_rebuildv_xen/ in your case.
You call it instead of “make menuconfig”, and the configuration will be taken (“cloned”) from the running kernel.

You should be able to change it afterwards by running “make xconfig” or whatever, maybe even editing the file “.config” manually.